/* Hibi — marketing site
   Tokens and composition rules are lifted from the app's locked design system
   (hibi/docs/DESIGN.md §2-§4). Do not introduce a second accent colour, a drop
   shadow, a rounded pill, or an emoji: all four are ruled out there. */

:root {
  --nihon: #bc002d;
  --nihon-on-dark: #e84868;
  --bone: #faf7f2;
  --sumi: #0e0e0f;
  --ink: #1a1a1a;
  --gray-warm: #6b6256;
  --gray-cool: #8a8a8e;
  --hairline-dark: rgba(250, 247, 242, 0.14);
  --hairline-light: rgba(26, 26, 26, 0.16);
  --dusk-top: #3a2e5c;
  --dusk-bottom: #1f1740;

  --serif: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --tight: "Inter Tight", "Inter", -apple-system, sans-serif;

  --measure: 62ch;
  --gutter: clamp(20px, 8vw, 96px);
  --rule-gap: 4px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--sumi);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}

/* height:auto is load-bearing: every <img> carries width/height attributes for
   layout stability, and without this the attribute height wins over the CSS
   width and the shot renders at 1434px tall. */
img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

::selection { background: var(--nihon); color: var(--bone); }

/* ---------- shared type ---------- */

.eyebrow {
  font-family: var(--tight);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--nihon-on-dark);
  margin: 0 0 18px;
}

.on-bone .eyebrow { color: var(--nihon); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.16;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(36px, 6.4vw, 68px); }
h2 { font-size: clamp(28px, 4.2vw, 44px); margin-bottom: 20px; }
h3 { font-size: clamp(19px, 2vw, 22px); line-height: 1.3; }

p { margin: 0 0 1.1em; max-width: var(--measure); }

.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--gray-cool);
  line-height: 1.6;
}

.on-bone .lede { color: var(--gray-warm); }

/* Two-rule structure: 0.5pt over 1.5pt, stacked tight. */
.rules { margin: 0 0 34px; }
.rules::before,
.rules::after {
  content: "";
  display: block;
  width: 72px;
  background: var(--nihon);
}
.rules::before { height: 1px; }
.rules::after { height: 3px; margin-top: var(--rule-gap); }

/* ---------- layout ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

section { padding-block: clamp(64px, 11vw, 132px); }

.on-bone {
  background: var(--bone);
  color: var(--ink);
}

.on-dusk {
  background: linear-gradient(180deg, var(--dusk-top), var(--dusk-bottom));
}

.hairline-top { border-top: 1px solid var(--hairline-dark); }
.on-bone .hairline-top { border-top-color: var(--hairline-light); }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 14, 15, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline-dark);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 62px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.wordmark .kanji {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--nihon-on-dark);
  line-height: 1;
}

.wordmark .latin {
  font-family: var(--tight);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.masthead nav {
  display: flex;
  gap: clamp(16px, 3vw, 34px);
  font-family: var(--tight);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead nav a {
  color: var(--gray-cool);
  text-decoration: none;
  padding-block: 8px;
}

.masthead nav a:hover { color: var(--bone); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 9vw, 104px) clamp(56px, 9vw, 110px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero-copy { position: relative; z-index: 2; }

.hero h1 { margin-bottom: 22px; }

/* The one display character per surface, bleeding off-canvas. */
.hero-anchor {
  position: absolute;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(200px, 30vw, 440px);
  line-height: 0.82;
  color: var(--nihon);
  opacity: 0.13;
  left: -0.1em;
  bottom: -0.16em;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.hero-shot {
  position: relative;
  z-index: 2;
  justify-self: end;
  width: min(340px, 100%);
  border: 1px solid var(--hairline-dark);
}

/* ---------- call to action ---------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
  margin-top: 34px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 0 34px;
  border-radius: 4px;
  background: var(--nihon);
  color: #fff;
  font-family: var(--tight);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 0;
  position: relative;
}

.cta::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 3px;
  background: var(--bone);
}

.on-bone .cta::after { background: var(--ink); }

.cta[aria-disabled="true"] {
  background: transparent;
  color: var(--bone);
  border: 1px solid var(--hairline-dark);
  cursor: default;
}

.on-bone .cta[aria-disabled="true"] {
  color: var(--ink);
  border-color: var(--hairline-light);
}

.cta[aria-disabled="true"]::after { display: none; }

.cta-note {
  font-size: 14px;
  color: var(--gray-cool);
  margin: 0;
  max-width: 34ch;
}

.on-bone .cta-note { color: var(--gray-warm); }

/* ---------- the three-beat habit ---------- */

.beats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 52px;
  border-top: 1px solid var(--hairline-light);
}

.beat {
  padding: 30px clamp(18px, 2.4vw, 34px) 8px 0;
  border-right: 1px solid var(--hairline-light);
}

.beat:last-child { border-right: 0; }

.beat .num {
  font-family: var(--tight);
  font-weight: 700;
  font-size: 30px;
  color: var(--nihon);
  line-height: 1;
  display: block;
  margin-bottom: 14px;
}

.beat p { font-size: 16px; color: var(--gray-warm); margin: 8px 0 0; }

/* ---------- screenshot frames ---------- */

.frames {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 52px);
  margin-top: 56px;
}

.frame img {
  width: 100%;
  border: 1px solid var(--hairline-dark);
  background: var(--sumi);
}

/* Colour has to be restated: `.frame p` below is more specific than `.eyebrow`. */
.frame .eyebrow { margin: 22px 0 10px; color: var(--nihon-on-dark); }

.frame h3 { margin-bottom: 8px; }

.frame p {
  font-size: 15px;
  color: var(--gray-cool);
  margin: 0;
}

/* ---------- curriculum ---------- */

.arc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline-dark);
  border: 1px solid var(--hairline-dark);
  margin-top: 48px;
}

.arc > div {
  background: var(--sumi);
  padding: 28px clamp(18px, 2.4vw, 30px) 30px;
}

.arc .kana {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 46px;
  color: var(--nihon-on-dark);
  line-height: 1;
  display: block;
  margin-bottom: 16px;
}

.arc .days {
  font-family: var(--tight);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-cool);
  display: block;
  margin-bottom: 6px;
}

.arc p { font-size: 15px; color: var(--gray-cool); margin: 6px 0 0; }

.on-bone .arc {
  background: var(--hairline-light);
  border-color: var(--hairline-light);
}
.on-bone .arc > div { background: var(--bone); }
.on-bone .arc .kana { color: var(--nihon); }
.on-bone .arc .days,
.on-bone .arc p { color: var(--gray-warm); }

/* ---------- split feature rows ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(36px, 6vw, 86px);
  align-items: center;
}

.split + .split { margin-top: clamp(56px, 8vw, 104px); }

.split.flip .split-media { order: -1; }

.split-media img {
  width: min(300px, 100%);
  border: 1px solid var(--hairline-light);
}

/* ---------- pricing ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  max-width: 720px;
  margin-top: 44px;
  border-top: 1px solid var(--hairline-dark);
  border-bottom: 1px solid var(--hairline-dark);
}

.plan {
  padding: 30px 34px 34px 0;
  border-right: 1px solid var(--hairline-dark);
}

.plan:last-child { border-right: 0; padding-left: 34px; }

.plan .price {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  display: block;
}

.plan .per {
  font-family: var(--tight);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nihon-on-dark);
  display: block;
  margin-bottom: 16px;
}

.plan p { font-size: 15px; color: var(--gray-cool); margin: 10px 0 0; }

.fineprint {
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray-cool);
  max-width: 68ch;
  margin-top: 28px;
}

.on-bone .fineprint { color: var(--gray-warm); }

/* Inline links inside prose, per surface. */
.inline-link {
  color: var(--nihon-on-dark);
  text-underline-offset: 3px;
}

.on-bone .inline-link { color: var(--nihon); }

.on-bone .split-media img { border-color: var(--hairline-light); }
.split-media img { border-color: var(--hairline-dark); }

/* ---------- questions ---------- */

.qa { margin-top: 44px; border-top: 1px solid var(--hairline-light); }

.qa > div {
  padding: 26px 0;
  border-bottom: 1px solid var(--hairline-light);
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(20px, 4vw, 56px);
}

.qa h3 { font-size: 19px; }
.qa p { margin: 0; font-size: 16px; color: var(--gray-warm); }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--hairline-dark);
  padding-block: 54px 64px;
  font-size: 14px;
  color: var(--gray-cool);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px 40px;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  font-family: var(--tight);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

footer a { color: var(--gray-cool); text-decoration: none; }
footer a:hover { color: var(--bone); }
footer p { margin: 12px 0 0; max-width: 46ch; }

/* ---------- legal pages ---------- */

/* `.legal` sits on <html>, so it has to reach body: body carries its own sumi
   background and would otherwise paint straight over a background set here. */
.legal body {
  background: var(--bone);
  color: var(--ink);
}

.legal .masthead {
  background: rgba(250, 247, 242, 0.9);
  border-bottom-color: var(--hairline-light);
}

.legal .masthead nav a { color: var(--gray-warm); }
.legal .masthead nav a:hover { color: var(--ink); }
.legal .wordmark .kanji { color: var(--nihon); }

.legal footer {
  border-top-color: var(--hairline-light);
  color: var(--gray-warm);
}

.legal footer a { color: var(--gray-warm); }
.legal footer a:hover { color: var(--ink); }

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding-block: clamp(52px, 8vw, 92px) clamp(48px, 7vw, 88px);
}

.doc-head { margin-bottom: 44px; }

/* Restated over `.doc p`, which is otherwise more specific than `.eyebrow`. */
.doc .doc-head .eyebrow { color: var(--nihon); }

.doc-head h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 14px; }

.doc-head .updated {
  font-family: var(--tight);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-warm);
  margin: 0;
}

.doc h2 {
  font-size: clamp(21px, 2.4vw, 26px);
  margin: 46px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline-light);
}

.doc p, .doc li { color: var(--ink); max-width: none; }

.doc ul { padding-left: 20px; margin: 0 0 1.1em; }
.doc li { margin-bottom: 0.5em; }

.doc a { color: var(--nihon); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.doc .sibling {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--tight);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nihon);
  text-decoration: none;
  border-bottom: 2px solid var(--nihon);
  padding-bottom: 4px;
}

/* ---------- support page ---------- */

.support-lead { max-width: 720px; margin: 0 auto; }

.contact-plate {
  border: 1px solid var(--hairline-light);
  padding: 30px 34px;
  margin: 36px 0 8px;
}

.contact-plate .mail {
  font-family: var(--serif);
  font-weight: 700;
  /* Sized to fit the address on one line at 320px rather than break-word it,
     which is the fix the personal site's overflow recipe calls for. */
  font-size: clamp(15px, 5.2vw, 30px);
  color: var(--nihon);
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-shot { justify-self: start; width: min(290px, 78%); }
  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .qa > div { grid-template-columns: minmax(0, 1fr); }
  .split.flip .split-media { order: 0; }
  .arc { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .masthead nav { gap: 14px; font-size: 11px; }
  .masthead nav a.hide-sm { display: none; }
  .frames { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .beats { grid-template-columns: minmax(0, 1fr); }
  .beat { border-right: 0; border-bottom: 1px solid var(--hairline-light); padding-right: 0; }
  .beat:last-child { border-bottom: 0; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { border-right: 0; border-bottom: 1px solid var(--hairline-dark); padding-right: 0; }
  .plan:last-child { border-bottom: 0; padding-left: 0; padding-top: 30px; }
  .cta { width: 100%; }
  .contact-plate { padding: 24px 20px; }
  .doc h2 { margin-top: 38px; }
}

/* There is deliberately no scroll-reveal here. An opacity-0-until-observed
   pattern renders the page blank in throttled tabs, headless captures and
   social-card crawlers, which is exactly the failure the personal site
   documents. The page is static and always visible. */

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

.legal :focus-visible { outline-color: var(--nihon); }
