/* ==========================================================================
   Omamori by Post — research landing page
   Printed-matter aesthetic: washi paper, sumi ink, one vermillion accent.
   ========================================================================== */

:root {
  --paper: #faf7f0;
  --paper-deep: #f2ede1;
  --ink: #1a1815;
  --ink-soft: #4a4640;
  --ink-faint: #8a847a;
  --rule: #d9d2c3;
  --shu: #c73e2c;          /* vermillion — use sparingly */
  --ai: #2e3f55;           /* indigo — tiny secondary */

  --serif: "Fraunces", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mincho: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --summary-h: 0px;        /* set on mobile so the fixed bar never covers content */
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

::selection { background: var(--shu); color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.muted { color: var(--ink-faint); font-weight: 300; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

:focus-visible {
  outline: 2px solid var(--shu);
  outline-offset: 3px;
}

/* ---------- Hanko (the only logo) ---------- */
.hanko {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--shu);
  color: #fff;
  font-family: var(--mincho);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  border-radius: 2px;
  flex: none;
}
.hanko--sm { width: 24px; height: 24px; font-size: 14px; }
.hanko--lg { width: 56px; height: 56px; font-size: 32px; transform: rotate(-3deg); }

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--ink);
}
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand__name {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.01em;
}
.brand__name em { font-style: italic; font-weight: 300; }
.masthead__note {
  margin: 0 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: none;
}
.masthead__link {
  margin-left: auto;
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  white-space: nowrap;
}
.masthead__link:hover { color: var(--shu); border-color: var(--shu); }

@media (min-width: 720px) {
  .masthead__note { display: block; }
  .masthead__link { margin-left: 32px; }
}

/* ---------- Type ---------- */
.kicker {
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--shu);
  vertical-align: middle;
  margin-right: 12px;
}

.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(38px, 7.2vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
  font-variation-settings: "opsz" 144;
}

.lede {
  font-size: clamp(16px, 1.9vw, 18px);
  color: var(--ink-soft);
  max-width: 34em;
  margin: 0 0 32px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-title--sm { font-size: clamp(24px, 3vw, 30px); margin-bottom: 14px; }

.fig {
  font-family: var(--serif);
  font-style: italic;
  margin-right: 6px;
  color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  font: 500 15px/1.2 var(--sans);
  letter-spacing: 0.02em;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--shu); border-color: var(--shu); }
.btn--outline:hover { border-color: var(--shu); color: var(--shu); }
.btn--text {
  border-color: transparent;
  padding-left: 4px;
  padding-right: 4px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn--text:hover { color: var(--shu); }
.btn--stamp {
  background: var(--shu);
  border-color: var(--shu);
  color: #fff;
  width: 100%;
}
.btn--stamp:hover { background: var(--ink); border-color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: progress; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  gap: 40px;
  padding-top: clamp(40px, 8vw, 96px);
  padding-bottom: clamp(56px, 9vw, 112px);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin: 0;
}
.hero__aside { font-size: 14px; color: var(--ink-faint); }

.hero__figure { margin: 0; }
.hero__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--paper-deep);
}
figcaption {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-faint);
}

.vertical-jp {
  font-family: var(--mincho);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.3em;
  margin: 0;
  color: var(--ink);
}
.hero__vertical { display: none; }

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr) 48px;
    gap: 56px;
    align-items: end;
  }
  .hero__text { padding-bottom: 24px; }
  .hero__figure img { aspect-ratio: 3 / 4; }
  .hero__vertical {
    display: block;
    align-self: start;
    font-size: 30px;
    padding-top: 8px;
    border-left: 1px solid var(--shu);
    padding-left: 14px;
  }
}

/* ---------- Section heads ---------- */
.section-head {
  display: grid;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-head__jp {
  margin: 0;
  font-family: var(--mincho);
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--shu);
}
.section-head__sub {
  margin: 8px 0 0;
  max-width: 36em;
  color: var(--ink-soft);
}

/* ---------- About ---------- */
.about {
  padding-bottom: clamp(56px, 9vw, 112px);
}
.notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 32px;
}
.notes__item {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
}
.notes__num {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  color: var(--shu);
  font-size: 18px;
  margin-bottom: 6px;
}
.notes__item h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 8px;
}
.notes__item p { margin: 0; color: var(--ink-soft); }
.about__disclaimer {
  margin: 40px 0 0;
  max-width: 40em;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
}

@media (min-width: 760px) {
  .notes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
  .about__disclaimer { margin-left: calc(100% / 3 + 14px); }
}

/* ---------- Order form layout ---------- */
.order {
  padding-bottom: clamp(56px, 9vw, 112px);
}
.order__grid {
  display: grid;
  gap: 40px;
}
.order__form { min-width: 0; }

@media (min-width: 1000px) {
  .order__grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 64px;
    align-items: start;
  }
}

/* ---------- Steps ---------- */
.step {
  border: 0;
  margin: 0 0 clamp(48px, 7vw, 72px);
  padding: 0;
  min-width: 0;
}
.step__legend {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 0;
  margin-bottom: 10px;
}
.step__num {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--shu);
  font-variant-numeric: lining-nums;
}
.step__rule {
  width: 28px;
  height: 1px;
  background: var(--ink);
  flex: none;
}
.step__title {
  font-family: var(--serif);
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.15;
}
.step__done {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--shu);
  color: var(--shu);
  font-family: var(--mincho);
  font-weight: 700;
  font-size: 14px;
  border-radius: 50%;
  transform: rotate(-8deg);
  opacity: 0;
  transition: opacity .5s ease;
  flex: none;
}
.step.is-done .step__done { opacity: 1; }

.step__hint {
  margin: 0 0 22px;
  color: var(--ink-soft);
  max-width: 36em;
}

/* ---------- Options (order-slip style) ---------- */
.options {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.opt {
  position: relative;
  display: block;
  cursor: pointer;
}
/* Visually hide native radio, keep it accessible */
.opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.opt__body {
  position: relative;
  display: block;
  height: 100%;
  padding: 16px 48px 16px 14px;
  border: 1px solid transparent;
  border-bottom-color: var(--rule);
  transition: border-color .15s ease, background-color .15s ease;
}
.opt:hover .opt__body { background: var(--paper-deep); }

/* Selected-state stamp */
.opt__body::after {
  content: "選";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--shu);
  color: #fff;
  font-family: var(--mincho);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  border-radius: 2px;
  opacity: 0;
  transform: rotate(-4deg);
}
.opt input:checked + .opt__body {
  border-color: var(--shu);
  background: var(--paper);
}
.opt input:checked + .opt__body::after { opacity: 1; }
.opt input:focus-visible + .opt__body {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.opt__jp {
  display: block;
  font-family: var(--mincho);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  margin-bottom: 2px;
}
.opt input:checked + .opt__body .opt__jp { color: var(--shu); }
.opt__label {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.25;
}
.opt__label--lg { font-size: clamp(22px, 2.6vw, 26px); margin-bottom: 10px; }
.opt__meta {
  display: block;
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.opt__desc {
  display: block;
  color: var(--ink-soft);
  font-size: 15px;
  margin-top: 6px;
}
.opt__fine {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--ink-faint);
  font-style: italic;
}

/* Wish grid */
@media (min-width: 560px) {
  .options--wish {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 1px solid var(--rule);
  }
  .options--wish .opt__body { border-right-color: var(--rule); }
  .options--wish .opt input:checked + .opt__body { border-color: var(--shu); }
}
@media (min-width: 1000px) {
  .options--wish { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Style comparison */
.options--style {
  border-top: 0;
  gap: 20px;
}
.opt--style .opt__body {
  border: 1px solid var(--rule);
  padding: 16px 16px 22px;
}
.opt__tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  margin-bottom: 14px;
}
.opt__figure {
  display: block;
  margin: 0 0 18px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--paper-deep);
}
.opt__figure img { width: 100%; height: 100%; object-fit: cover; }
.opt__figure--plain {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
}
.opt__list {
  display: block;
  margin-top: 14px;
  border-top: 1px solid var(--rule);
}
.opt__list span {
  display: block;
  font-size: 14px;
  padding: 7px 0 7px 18px;
  border-bottom: 1px dotted var(--rule);
  position: relative;
}
.opt__list span::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 7px;
  height: 1px;
  background: var(--ink);
}
.opt--style input:checked + .opt__body { border-width: 1px; box-shadow: inset 0 0 0 1px var(--shu); }

@media (min-width: 680px) {
  .options--style { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Simple drawn charm for Style B (no illustration, just a typeset object) */
.charm {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.charm__cord {
  width: 18px;
  height: 22px;
  border: 1.5px solid var(--ai);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}
.charm__pouch {
  width: 74px;
  height: 108px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  position: relative;
}
.charm__pouch::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 6px;
  right: 6px;
  height: 1px;
  background: var(--ink);
}
.charm__jp {
  font-family: var(--mincho);
  font-size: 26px;
  font-weight: 700;
  writing-mode: vertical-rl;
}

/* Price tiers */
@media (min-width: 680px) {
  .options--price {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-left: 1px solid var(--rule);
  }
  .options--price .opt__body { border-right-color: var(--rule); padding: 18px 18px 22px; }
  .options--price .opt input:checked + .opt__body { border-color: var(--shu); }
}
.opt__price {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 42px;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: lining-nums;
}

/* Intent questions */
.question { margin-bottom: 26px; }
.question__label {
  margin: 0 0 10px;
  font-weight: 500;
}
.question__letter {
  font-family: var(--serif);
  font-style: italic;
  color: var(--shu);
  margin-right: 6px;
}
.question__note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}
.options--inline {
  border-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.opt--line { flex: 1 1 200px; }
.opt--line .opt__body {
  border: 1px solid var(--ink-faint);
  padding: 12px 44px 12px 14px;
}
.opt--line .opt__label { font-family: var(--sans); font-size: 15px; }
.opt--line .opt__body::after { top: 50%; margin-top: -11px; }

/* Email field */
.field { margin-bottom: 18px; }
.field__label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field__input {
  width: 100%;
  font: 400 19px/1.4 var(--serif);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 2px;
  -webkit-appearance: none;
  appearance: none;
}
.field__input::placeholder { color: var(--ink-faint); font-style: italic; }
.field__input:focus { outline: none; border-bottom: 2px solid var(--shu); padding-bottom: 9px; }
.field__input[aria-invalid="true"] { border-bottom-color: var(--shu); }
.field__help { margin: 8px 0 0; font-size: 13px; color: var(--ink-faint); }

.form-error {
  margin: 0 0 14px;
  color: var(--shu);
  font-size: 14px;
  min-height: 0;
}
.form-error:empty { display: none; }
.form-error a { color: var(--shu); }

.submit-row { margin-bottom: 20px; }
@media (min-width: 680px) {
  .btn--stamp { width: auto; min-width: 280px; }
}

.honest-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 40em;
}
.honest-note__mark {
  flex: none;
  font-family: var(--mincho);
  font-size: 13px;
  color: var(--shu);
  border: 1px solid var(--shu);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ---------- Summary ----------
   Desktop: sticky column beside the form (never overlaps it).
   Mobile: fixed bar at the bottom, collapsible, auto-hidden while the
   email step is on screen or any field has focus. */
.summary__details {
  background: var(--paper);
}
.summary__toggle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.summary__toggle::-webkit-details-marker { display: none; }
.summary__title {
  font-family: var(--serif);
  font-size: 20px;
}
.summary__progress {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.summary__list { margin: 12px 0 0; }
.summary__row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--rule);
  font-size: 14px;
}
.summary__row dt {
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 2px;
}
.summary__row dd { margin: 0; overflow-wrap: anywhere; }
.summary__row dd.is-set { color: var(--ink); }
.summary__row dd:not(.is-set) { color: var(--ink-faint); }
.summary__foot {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--ink-faint);
}

@media (max-width: 999px) {
  .summary {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    border-top: 1px solid var(--ink);
    background: var(--paper);
    transition: transform .25s ease, visibility .25s;
  }
  .summary__details { padding: 12px var(--gutter); max-height: 70vh; overflow-y: auto; }
  .summary__toggle::after {
    content: "+";
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1;
    margin-left: 8px;
  }
  .summary__details[open] .summary__toggle::after { content: "−"; }
  .summary__toggle { justify-content: flex-start; }
  .summary__progress { margin-left: auto; }
  .summary.is-hidden {
    transform: translateY(100%);
    visibility: hidden;
  }
  body.has-summary-bar { padding-bottom: 64px; }
}

@media (min-width: 1000px) {
  .summary {
    position: sticky;
    top: 24px;
    border-top: 2px solid var(--ink);
    padding-top: 14px;
  }
  .summary__toggle { pointer-events: none; cursor: default; }
}

/* ---------- Result ---------- */
.result {
  border-top: 2px solid var(--ink);
  padding-top: 28px;
  max-width: 760px;
  outline: none;
}
.result.is-visible { animation: fade-in .5s ease both; }
.result__head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 28px;
}
.result__lede { margin: 10px 0 0; color: var(--ink-soft); }
.result__list {
  margin: 0 0 28px;
  border-top: 1px solid var(--rule);
}
.result__list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.result__list dt {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 3px;
}
.result__list dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  overflow-wrap: anywhere;
}
.result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.result__status { font-size: 14px; color: var(--ink-soft); }

@media (max-width: 480px) {
  .result__list div { grid-template-columns: 1fr; gap: 2px; }
  .result__actions .btn { flex: 1 1 100%; }
}

/* When submitted, the order grid is replaced by the result */
.order.is-submitted .order__grid { display: none; }

/* ---------- Closing ---------- */
.closing {
  display: grid;
  gap: 32px;
  padding-bottom: clamp(56px, 9vw, 112px);
}
.closing__figure { margin: 0; }
.closing__figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--paper-deep);
}
.closing__text p { margin: 0; color: var(--ink-soft); max-width: 34em; }

@media (min-width: 900px) {
  .closing {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: 56px;
    align-items: end;
  }
}

/* ---------- Colophon ---------- */
.colophon {
  border-top: 1px solid var(--ink);
  padding: 24px 0 40px;
  font-size: 13px;
  color: var(--ink-faint);
}
.colophon__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}
.colophon p { margin: 0; }
.colophon__credit { margin-left: auto !important; }

/* ---------- Image fallback (if a hotlinked photo fails) ---------- */
img.is-broken {
  visibility: hidden;
}

/* ---------- Motion ---------- */
.fade-in { animation: fade-in .5s ease both; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
