/* ==========================================================================
   Hitsukyo — 謐境
   Ink on black. Restraint over ornament. Negative space is the material.
   ========================================================================== */

:root {
  --bg:         #0a0a0b;
  --bg-deep:    #060607;
  --bg-raise:   #101012;

  --ink:        #ede9e1;   /* warm paper white */
  --ink-dim:    #9c968b;
  --ink-faint:  #5f5a53;

  --seal:       #b8443a;   /* hanko vermillion — used once per view, never twice */

  --rule:       rgba(237, 233, 225, 0.10);
  --rule-soft:  rgba(237, 233, 225, 0.05);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans:  "Jost", "Futura", "Avenir Next", sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.5rem, 5vw, 6rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Film grain — the whole page sits under a single sheet of it. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0;
}

p { margin: 0 0 1.4em; }

a {
  color: inherit;
  text-decoration: none;
}

.link {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color 0.45s var(--ease), color 0.45s var(--ease);
}
.link:hover { border-color: var(--seal); color: #fff; }

/* Small caps label — the recurring structural motif */
.label {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Vertical Japanese rail, fixed to the left edge on wide screens */
.rail {
  position: fixed;
  left: clamp(1rem, 2.2vw, 2.25rem);
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 0.8125rem;
  letter-spacing: 0.5em;
  color: var(--ink-faint);
  opacity: 0.5;
  z-index: 5;
  pointer-events: none;
  user-select: none;
}
@media (max-width: 1100px) { .rail { display: none; } }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 76rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }

section { position: relative; }

/* Hairline divider that draws itself in */
.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: 0;
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8rem var(--gutter) 6rem;
  position: relative;
  isolation: isolate;
  /* The mark screen-blends against this. Without an explicit background the
     isolated group has a transparent backdrop, the blend has nothing to act
     on, and the artwork's black square paints opaquely over the page. */
  background: var(--bg);
}

/* Slow breathing halo, sitting low behind the slogan rather than the mark —
   any light falling across the artwork's square would reveal its edge. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 67%;
  translate: -50% -50%;
  width: min(72vw, 40rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237,233,225,0.05) 0%, rgba(237,233,225,0) 66%);
  animation: breathe 14s var(--ease) infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.12); opacity: 1; }
}

.mark {
  display: block;
  width: clamp(9rem, 22vw, 15.5rem);
  height: auto;
  margin: 0 auto clamp(3.5rem, 9vh, 7rem);
  /* The artwork is white ink on solid black; screen blending drops the
     black entirely so the strokes sit directly on the page. */
  mix-blend-mode: screen;
}

.slogan {
  font-size: clamp(2.35rem, 7.5vw, 5.25rem);
  font-style: italic;
  line-height: 1.05;
  margin-bottom: 1.75rem;
}
.slogan em {
  font-style: normal;
  color: var(--ink-dim);
}

.hero-sub {
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  color: var(--ink-dim);
  /* Wide enough that the longer of the two sentences holds one line. */
  max-width: 38rem;
  margin-inline: auto;
}

/* The break after "mind." is deliberate on screens wide enough to honour it.
   Below that it would strand a short line, so let the text flow instead. */
.hero-sub br { display: none; }

@media (min-width: 48em) {
  .hero-sub br { display: inline; }
}

/* Descending thread — the eye is led down, slowly */
.thread {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: clamp(3.5rem, 9vh, 6rem);
  background: linear-gradient(to bottom, rgba(237,233,225,0) 0%, var(--rule) 45%, rgba(237,233,225,0.28) 100%);
}
.thread::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--seal);
  animation: drop 4.5s var(--ease) infinite;
}

@keyframes drop {
  0%       { transform: translateY(-2.75rem); opacity: 0; }
  30%, 70% { opacity: 1; }
  100%     { transform: translateY(0); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.ma {
  padding: clamp(9rem, 22vh, 16rem) 0;
}

.statement {
  font-family: var(--serif);
  font-size: clamp(1.65rem, 4.2vw, 2.9rem);
  line-height: 1.32;
  max-width: 30ch;
  color: var(--ink);
}
.statement .quiet { color: var(--ink-faint); }

.etymology {
  margin-top: clamp(3rem, 7vh, 5rem);
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
  max-width: 30rem;
  color: var(--ink-dim);
  font-size: 0.9375rem;
}
.etymology b {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  margin-right: 0.35rem;
}

/* Romanised Japanese. Jost has no U+014D (ō), so the browser substitutes a
   fallback face for that single character and the macron lands off-metric.
   The serif stack covers Latin Extended-A — and italic serif is the standard
   way to set rōmaji regardless. */
.romaji {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15em;
  letter-spacing: 0.005em;
  color: var(--ink);
}

/* Numbered features — asymmetric, hairline-separated */
.features { padding-bottom: clamp(6rem, 14vh, 11rem); }

.feature {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: start;
  padding: clamp(2.5rem, 6vh, 4.25rem) 0;
  border-top: 1px solid var(--rule-soft);
}
.feature:last-child { border-bottom: 1px solid var(--rule-soft); }

.feature-num {
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1;
  color: var(--ink-faint);
  font-variant-numeric: lining-nums;
}

.feature-tag {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.6rem;
  white-space: nowrap;
}

.feature h3 {
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  padding-top: 0.15rem;
}

.feature p {
  color: var(--ink-dim);
  margin: 0;
  max-width: 32rem;
}

@media (max-width: 780px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .feature-num { font-size: 1.5rem; }
}

/* Availability */
.avail {
  padding: clamp(6rem, 15vh, 11rem) 0;
  text-align: center;
  border-top: 1px solid var(--rule-soft);
}
.avail h2 {
  font-size: clamp(1.9rem, 5vw, 3.15rem);
  margin-bottom: 1.25rem;
}
.avail p { color: var(--ink-dim); max-width: 26rem; margin-inline: auto; }

.seal {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.7rem 1.9rem;
  border: 1px solid var(--rule);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: border-color 0.5s var(--ease), color 0.5s var(--ease);
}
.seal:hover { border-color: var(--seal); color: var(--ink); }

/* --------------------------------------------------------------------------
   Footer — legal links live here: present, findable, never loud
   -------------------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--rule-soft);
  padding: clamp(3rem, 8vh, 5rem) 0 clamp(2.5rem, 6vh, 3.5rem);
  background: var(--bg-deep);
}

.foot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem clamp(2rem, 8vw, 6rem);
  align-items: flex-start;
  justify-content: space-between;
}

.foot-brand {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
}

.foot-legal {
  font-size: 0.8125rem;
  line-height: 1.9;
  color: var(--ink-faint);
  font-style: normal;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.foot-links a {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.4s var(--ease);
}
.foot-links a:hover { color: var(--ink); }

.foot-base {
  margin-top: clamp(2.5rem, 6vh, 3.75rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   Document pages (privacy / terms / support)
   -------------------------------------------------------------------------- */

.doc-head {
  padding: clamp(6rem, 16vh, 10rem) 0 clamp(2.5rem, 6vh, 4rem);
  border-bottom: 1px solid var(--rule-soft);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
  transition: color 0.4s var(--ease);
}
.back:hover { color: var(--ink); }
.back::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
}

.doc-head h1 {
  font-size: clamp(2.4rem, 6.5vw, 4rem);
  margin-bottom: 1rem;
}

.doc-body {
  padding: clamp(3.5rem, 9vh, 6rem) 0 clamp(5rem, 12vh, 8rem);
  max-width: 42rem;
}

.doc-body h2 {
  font-size: clamp(1.4rem, 3.2vw, 1.85rem);
  margin: clamp(3rem, 7vh, 4.5rem) 0 1.1rem;
}
.doc-body h2:first-child { margin-top: 0; }

.doc-body h3 {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 2.25rem 0 0.65rem;
}

.doc-body p,
.doc-body li {
  color: var(--ink-dim);
  font-size: 0.96875rem;
}

.doc-body ul {
  margin: 0 0 1.4em;
  padding-left: 1.1rem;
  list-style: none;
}
.doc-body ul li {
  position: relative;
  padding-left: 0.4rem;
  margin-bottom: 0.6rem;
}
.doc-body ul li::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 0.85em;
  width: 4px;
  height: 1px;
  background: var(--ink-faint);
}

.doc-body strong { color: var(--ink); font-weight: 400; }

.callout {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--seal);
  background: var(--bg-raise);
}
.callout p:last-child { margin-bottom: 0; }

.toc {
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 2.5rem;
}
.toc li { margin-bottom: 0.45rem; break-inside: avoid; }
.toc a {
  font-size: 0.875rem;
  color: var(--ink-dim);
  transition: color 0.35s var(--ease);
}
.toc a:hover { color: var(--ink); }
@media (max-width: 620px) { .toc { columns: 1; } }

/* Contact card on the support page */
.contact {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  margin: 2.5rem 0;
}
.contact div {
  background: var(--bg);
  padding: 1.5rem 1.6rem;
}
.contact dt {
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.55rem;
}
.contact dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink);
}
@media (min-width: 700px) {
  .contact { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   Entrance choreography — one orchestrated load, then stillness
   -------------------------------------------------------------------------- */

.rise {
  opacity: 0;
  transform: translateY(1.4rem);
  animation: rise 1.5s var(--ease) forwards;
}
.rise-1 { animation-delay: 0.15s; }
.rise-2 { animation-delay: 0.45s; }
.rise-3 { animation-delay: 0.75s; }
.rise-4 { animation-delay: 1.05s; }
.rise-5 { animation-delay: 1.35s; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* Scroll-revealed blocks */
.reveal {
  opacity: 0;
  transform: translateY(1.75rem);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.reveal.seen { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rise, .reveal { opacity: 1; transform: none; }
}

/* Focus states — visible, in keeping */
:focus-visible {
  outline: 1px solid var(--seal);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  z-index: 200;
  font-size: 0.8125rem;
}
.skip:focus { left: 1rem; top: 1rem; }
