/* hakanai.co — one design system for the studio site and every /app launch page.
   Tokens first; everything below uses them. Mobile-first; single column below 720px. */

:root {
  --paper: #F2EEE3;
  --outer: #E6E1D4;
  --ink: #22409A;
  --ink-soft: #5A72C0;
  --body: #33406B;
  --accent: #FF5A1F;         /* alternative: #E8FF3D (needs ink border on fills) */
  --black: #1A1A1A;
  --field: #FAF8F2;

  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 56px; --s-9: 72px; --s-10: 96px;

  --b-hair: 1px solid var(--ink);
  --b-struct: 2px solid var(--ink);
  --b-leader: 1.5px dashed var(--ink);

  --sheet-max: 1280px;
  --gutter: 20px;
  --section-y: var(--s-8);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-draw: 1.6s;
  --t-fade: .48s;
  --t-btn: 140ms;
}
@media (min-width: 720px) { :root { --gutter: 48px; --section-y: var(--s-9); } }
@media (min-width: 1024px) { :root { --gutter: 80px; --section-y: var(--s-10); } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--outer); color: var(--body); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--black); }
:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }
h1, h2, h3, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink); padding: 8px 12px; border: var(--b-struct); z-index: 100; }
.skip:focus { left: 8px; }

.sheet { max-width: var(--sheet-max); margin: 0 auto; background: var(--paper); }
@media (min-width: 1280px) { .sheet { border-left: var(--b-hair); border-right: var(--b-hair); } }
.wrap { padding-inline: var(--gutter); }

/* ---------- type ---------- */
.label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); line-height: 1.6; }
.label.strong { font-size: 13px; font-weight: 600; }
.num { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--ink); }
h1 { font-family: var(--sans); font-weight: 500; font-size: clamp(34px, 5vw, 50px); line-height: 1.08; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.h2 { font-family: var(--sans); font-weight: 500; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
.h3 { font-size: 20px; line-height: 1.3; font-weight: 500; color: var(--ink); }
.lead { font-size: clamp(18px, 2vw, 21px); line-height: 1.45; }
.lead.ink { color: var(--ink); font-weight: 500; }
.body { font-size: 17px; line-height: 1.6; color: var(--body); }
.small { font-size: 14px; line-height: 1.5; color: var(--body); }
.max { max-width: 720px; text-wrap: pretty; }
.appname { font-family: var(--mono); font-weight: 500; font-size: clamp(48px, 6vw, 64px); line-height: 1; letter-spacing: -.01em; color: var(--ink); }
.appname.xl { font-size: clamp(64px, 9vw, 96px); letter-spacing: -.02em; }
.ink { color: var(--ink); }

/* ---------- layout primitives ---------- */
.stack { display: flex; flex-direction: column; gap: var(--s-5); }
.stack-xs { display: flex; flex-direction: column; gap: var(--s-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s-6); }
@media (min-width: 720px) { .stack-lg { gap: var(--s-7); } }
.grow { flex-grow: 1; }
.grid-2, .grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
  .grid-3.gap-xl { gap: var(--s-7); }
  .grid-2.ba { gap: var(--s-5); }
}
.section { position: relative; padding-block: var(--section-y); border-top: var(--b-hair); }
.section > .wrap { position: relative; }
.section.hero { border-top: 0; padding-top: var(--s-7); padding-bottom: var(--s-6); }
@media (min-width: 720px) { .section.hero { padding-top: 80px; padding-bottom: 40px; } }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(242, 238, 227, .86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: var(--b-hair); }
.site-header .wrap { max-width: var(--sheet-max); margin: 0 auto; height: 60px; display: flex; align-items: center; justify-content: space-between; }
@media (min-width: 720px) { .site-header .wrap { height: 72px; } }
.wordmark { font-family: var(--mono); font-weight: 600; font-size: 15px; letter-spacing: .02em; text-decoration: none; }
@media (min-width: 720px) { .wordmark { font-size: 17px; } }
.nav { display: flex; gap: var(--s-4); }
@media (min-width: 720px) { .nav { gap: var(--s-6); } }
.nav a, .back { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .back:hover { text-decoration: underline; }

/* ---------- section head, leaders, dimension line ---------- */
.sec-head { display: flex; align-items: center; gap: 14px; }
.sec-head .leader { width: 40px; border-top: var(--b-leader); }
@media (min-width: 720px) { .sec-head .leader { width: 72px; } }
.sec-head h2 { font-size: 13px; letter-spacing: .16em; }
.col-head { display: flex; align-items: center; gap: var(--s-3); }
.col-head .leader { border-top: var(--b-leader); }
.glyph svg { width: 56px; height: 56px; flex-shrink: 0; }
@media (min-width: 720px) { .glyph svg { width: 64px; height: 64px; } }

.dimline { display: flex; align-items: center; width: 100%; }
.dimline .tick { width: 1.5px; height: 18px; background: var(--ink); flex-shrink: 0; }
.dimline .rule { flex-grow: 1; height: 1.5px; background: var(--ink); min-width: 12px; }
.dimline .measure { padding: 0 14px; text-align: center; font-size: 11px; }
@media (min-width: 720px) { .dimline .measure { font-size: 12px; } }
.dimline .ah { width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; flex-shrink: 0; }
.dimline .ah-l { border-right: 9px solid var(--ink); }
.dimline .ah-r { border-left: 9px solid var(--ink); }

/* ---------- hero ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-7); align-items: center; }
@media (min-width: 920px) { .hero-grid { grid-template-columns: minmax(0, 1fr) 600px; gap: var(--s-7); } .hero-grid-app { grid-template-columns: minmax(0, 1fr) 520px; } }
.hero .stack-lg { gap: var(--s-6); }
@media (min-width: 720px) { .hero .stack-lg { gap: var(--s-8); } }
.cta-row { display: flex; flex-direction: column; gap: var(--s-4); padding-top: var(--s-2); }
@media (min-width: 720px) { .cta-row { flex-direction: row; align-items: center; gap: 28px; } }
.textlink { font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-underline-offset: 4px; }
@media (min-width: 720px) { .textlink { justify-content: flex-start; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 var(--s-5); border: var(--b-struct); border-radius: 0;
  font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; cursor: pointer; width: 100%;
  transition: transform var(--t-btn) ease-out, box-shadow var(--t-btn) ease-out; }
@media (min-width: 720px) { .btn { width: auto; } .btn.full { width: 100%; } }
.btn-primary { background: var(--accent); color: var(--black); }
.btn-secondary { background: transparent; color: var(--ink); }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); color: var(--black); }
.btn:active { transform: none; box-shadow: none; }

/* ---------- illustrations ---------- */
.ill { width: 100%; }
.ill svg { width: 100%; height: auto; }
.ill-hero { max-width: 600px; margin-inline: auto; }
.ill-hero img { width: 100%; height: auto; }
.ill-diagram { max-width: 520px; margin-inline: auto; }
.ill-dial { max-width: 420px; }
.ill-product { max-width: 240px; }
svg .ln { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linecap: square; stroke-linejoin: miter; }
svg .lt { fill: none; stroke: var(--ink); stroke-width: 1; }
svg .ls { fill: none; stroke: var(--ink-soft); stroke-width: 1; }
svg .g2 { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: square; }
svg .dsh { fill: none; stroke: var(--ink); stroke-width: 1.25; stroke-dasharray: 4 4; }
svg .ah { fill: var(--ink); }
svg .tx { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; fill: var(--ink); }
svg .t9 { font-size: 9.5px; }
svg .tk { fill: var(--black); }
svg .bs { font-family: var(--sans); font-size: 19px; fill: var(--ink); }
svg .bs6 { font-weight: 600; }
svg .tm { text-anchor: middle; }
svg .hand .ln, svg .hand .lt, svg .hand .ls, svg .hand .g2, .ill-hero svg .ln, .ill-hero svg .lt { stroke-linecap: round; stroke-linejoin: round; }
.ill-hero svg .ls { opacity: .45; }
.ill-hero svg .dsh { stroke-dasharray: 9 7; }
svg .hand .ln { stroke-width: 2; } svg .hand .lt { stroke-width: 1.25; } svg .hand .g2 { stroke-width: 2.25; }

/* blueprint fragments behind sections: decorative, faint, never over text */
.frag { position: absolute; opacity: .13; pointer-events: none; overflow: hidden; }
.frag svg { width: 260px; height: auto; }
@media (min-width: 720px) { .frag svg { width: 420px; } }
.frag-tr { top: 24px; right: 0; } .frag-br { bottom: 24px; right: 0; } .frag-bl { bottom: 24px; left: 0; } .frag-tl { top: 24px; left: 0; }
.frag .tx { font-size: 9.5px; }

/* ---------- title-block tables ---------- */
.tb { border: var(--b-struct); background: var(--paper); }
.tb-head { display: flex; flex-wrap: wrap; border-bottom: var(--b-struct); }
.tb-head > span { padding: 10px 16px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.tb-head > span + span { border-left: var(--b-hair); }
.tb-row { display: flex; flex-wrap: wrap; border-bottom: var(--b-hair); }
.tb-row:last-child { border-bottom: 0; }
.tb-row > span { padding: 12px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); line-height: 1.5; }
.tb-row > span + span { border-left: var(--b-hair); }
.tb-row.dim > span { color: var(--ink-soft); }
.tb-row .acc { background: var(--accent); color: var(--black); font-weight: 600; }
.tb-row a { text-decoration: none; } .tb-row a:hover { text-decoration: underline; }
/* stores table: sans values, grid on desktop */
.tb.stores .tb-head { display: none; }
.tb.stores .tb-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; }
.tb.stores .tb-row > span { padding: 0; border: 0; }
.tb.stores .tb-row > span:nth-child(1) { grid-column: 1 / -1; font-family: var(--sans); font-size: 17px; text-transform: none; letter-spacing: 0; }
.tb.stores .tb-row > span:nth-child(1) a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--ink-soft); text-underline-offset: 4px; }
.tb.stores .tb-row > span:nth-child(2) { font-family: var(--sans); font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--body); }
@media (min-width: 720px) {
  .tb.stores .tb-head { display: grid; grid-template-columns: 1.3fr 1fr 160px 100px; }
  .tb.stores .tb-head > span { padding-inline: 24px; }
  .tb.stores .tb-row { grid-template-columns: 1.3fr 1fr 160px 100px; gap: 0; padding: 0; align-items: center; }
  .tb.stores .tb-row > span { padding: 16px 24px; }
  .tb.stores .tb-row > span:nth-child(1) { grid-column: auto; }
  .tb.stores .tb-row > span:nth-child(2) { font-size: 16px; }
  .tb.stores .tb-row > span + span { border-left: var(--b-hair); }
}
/* key/value (support, features) */
.kv > div { border-bottom: var(--b-hair); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { font-size: 11px; }
.kv dd { margin: 0; font-size: 16px; }
@media (min-width: 720px) {
  .kv > div { display: grid; grid-template-columns: 240px minmax(0, 1fr); padding: 0; gap: 0; }
  .kv dt { padding: 20px 24px; border-right: var(--b-hair); font-size: 12px; }
  .kv dd { padding: 18px 24px; font-size: 17px; }
}

/* ---------- drawing-sheet cards ---------- */
.drawing-sheet { border: var(--b-struct); padding: 6px; background: var(--paper); }
.ds-inner { border: var(--b-hair); display: flex; flex-direction: column; height: 100%; }
.titleblock { display: flex; flex-wrap: wrap; border-bottom: var(--b-hair); }
@media (min-width: 720px) { .titleblock { align-self: flex-end; border-left: var(--b-hair); } }
.titleblock > span { padding: 8px 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.titleblock > span + span { border-left: var(--b-hair); }
.titleblock .acc { background: var(--accent); color: var(--black); font-weight: 600; }
.ds-body { padding: 24px 20px 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: center; }
@media (min-width: 920px) { .ds-body { grid-template-columns: minmax(0, 1fr) 520px; gap: 40px; padding: 24px 40px 48px; } }
.dashlist li { display: flex; gap: 12px; font-size: 16px; line-height: 1.5; }
.dashlist li + li { margin-top: var(--s-2); }
.dashlist li::before { content: "—"; font-family: var(--mono); color: var(--ink); line-height: 24px; }
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .1em; }
.support-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: start; }
@media (min-width: 920px) { .support-grid { grid-template-columns: minmax(0, 1fr) 420px; gap: var(--s-8); } }

/* generic card (reviews, before/after) */
.card { border: var(--b-hair); background: var(--paper); display: flex; flex-direction: column; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: var(--b-hair); }
.card-head .label { font-size: 11px; }
.card-body { padding: 20px 16px 24px; }
@media (min-width: 720px) { .card-body { padding: 24px 32px 32px; } }
.review blockquote { padding: 20px 16px 12px; flex-grow: 1; font-size: 17px; line-height: 1.55; }
.review figcaption { padding: 0 16px 16px; font-size: 14px; display: flex; flex-direction: column; gap: 12px; }
.review figcaption strong { font-weight: 500; color: var(--ink); }
.stars { display: flex; gap: 3px; }
.stars svg { width: 14px; height: 14px; }
.stars polygon { fill: var(--accent); stroke: var(--ink); stroke-width: 1; }

/* placeholder tag — remove before launch by setting verified/placeholder flags in the data */
.ph { display: inline-block; align-self: flex-start; padding: 5px 8px; border: 1.5px dashed var(--black); background: var(--outer);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--black); line-height: 1.4; }

/* ---------- launch page specifics ---------- */
.prod { font-size: 18px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.swatch { width: 10px; height: 10px; background: var(--accent); border: 1px solid var(--ink); }
.badge { align-self: flex-start; border: 1.5px solid var(--ink); position: relative; }
.badge.before { padding: 12px 16px; font-size: 17px; }
.badge.before .strike { position: absolute; left: -6px; right: -6px; top: 50%; height: 2px; background: var(--ink); transform-origin: left center; }
.badge.after { padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.badge.after .date { font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 4px; text-underline-offset: 5px; }
.badge.after .label { font-size: 10.5px; letter-spacing: .12em; }
.steps { gap: var(--s-7); }
@media (min-width: 720px) { .steps { gap: var(--s-6); } }
.plan .card-body { padding: 24px 20px; flex-grow: 1; }
.plan .dashlist { flex-grow: 1; }
.price { display: flex; align-items: baseline; gap: 8px; }
.amount { font-family: var(--mono); font-weight: 500; font-size: 48px; line-height: 1; letter-spacing: -.02em; color: var(--ink); }

.signup-box { border: var(--b-struct); padding: 24px 20px; }
@media (min-width: 720px) { .signup-box { padding: 48px; } }
.signup { display: flex; flex-direction: column; gap: var(--s-2); max-width: 640px; }
.signup-row { display: flex; flex-direction: column; gap: var(--s-3); }
@media (min-width: 720px) { .signup-row { flex-direction: row; } }
.signup input[type="email"] { flex-grow: 1; min-height: 52px; padding: 0 16px; border: var(--b-struct); border-radius: 0; background: var(--field); font: 17px var(--sans); color: var(--black); }
.signup input::placeholder { color: #5A6690; }
.signup .status:empty { display: none; }
.signup .status.ok { color: var(--ink); } .signup .status.err { color: #8A2A0F; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.faq { border: var(--b-struct); }
.faq details { border-bottom: var(--b-hair); }
.faq details:last-child { border-bottom: 0; }
.faq summary { list-style: none; cursor: pointer; min-height: 60px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
@media (min-width: 720px) { .faq summary { padding: 18px 24px; } }
.faq .q { font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.faq .pm { font-family: var(--mono); font-size: 20px; color: var(--ink); line-height: 1; transition: transform 200ms ease-out; }
.faq details[open] .pm { transform: rotate(45deg); }
.faq details > p { padding: 0 16px 18px; max-width: 760px; font-size: 16px; }
@media (min-width: 720px) { .faq details > p { padding: 0 24px 22px; } }

/* ---------- footer ---------- */
.footer { overflow: hidden; padding-bottom: var(--s-6); }
.email { align-self: flex-start; font-family: var(--mono); font-weight: 500; font-size: clamp(22px, 4vw, 44px); letter-spacing: 0; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 4px; text-underline-offset: 8px; word-break: break-all; }
@media (min-width: 720px) { .email { text-decoration-thickness: 6px; text-underline-offset: 12px; } }
.footer-row { display: flex; flex-direction: column; gap: var(--s-4); padding-top: 20px; border-top: var(--b-hair); }
@media (min-width: 720px) { .footer-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 40px; } }
.footer .clock { color: var(--body); font-variant-numeric: tabular-nums; }

/* ---------- motion ----------
   Everything animates only once its section has .in (set by site.js via IntersectionObserver).
   Under prefers-reduced-motion, or without JS, elements render in their final state. */
@keyframes hk-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hk-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes hk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hk-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

html.motion .pending .draw .ln, html.motion .pending .draw .lt, html.motion .pending .draw .ls, html.motion .pending .draw .g2 { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
html.motion .pending .draw .late, html.motion .pending .fade, html.motion .pending .dimline .ahl, html.motion .pending .dimline .measure,
html.motion .pending .badge.after { opacity: 0; }
html.motion .pending .dimline .rule, html.motion .pending .badge.before .strike { transform: scaleX(0); }

html.motion .in .draw .ln, html.motion .in .draw .lt, html.motion .in .draw .ls, html.motion .in .draw .g2 { stroke-dasharray: 1 1; animation: hk-draw var(--t-draw) var(--ease-out) both; }
html.motion .in .draw .w1 { animation-delay: .1s; } html.motion .in .draw .w2 { animation-delay: .2s; } html.motion .in .draw .w3 { animation-delay: .3s; }
html.motion .in .draw .w4 { animation-delay: .4s; } html.motion .in .draw .w5 { animation-delay: .5s; }
html.motion .in .draw .late { animation: hk-fade .5s ease-out 1.4s both; }
html.motion .in .fade { animation: hk-up var(--t-fade) ease-out .08s both; }
html.motion .in .dimline .grow { transform-origin: left center; animation: hk-grow .7s var(--ease-out) .1s both; }
html.motion .in .dimline .grow2 { transform-origin: left center; animation: hk-grow .5s var(--ease-out) .8s both; }
html.motion .in .dimline .measure { animation: hk-fade .3s ease-out .75s both; }
html.motion .in .dimline .ahl { animation: hk-fade .2s ease-out 1.3s both; }
html.motion .in .badge.before .strike { animation: hk-grow .6s cubic-bezier(.65, 0, .35, 1) .5s both; }
html.motion .in .badge.after { animation: hk-up .5s ease-out 1.2s both; }

@media (prefers-reduced-motion: reduce) {
  html.motion .pending *, html.motion .in * { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
