/* chie.house — one product, one palette. Tokens match the iPhone app (App/Theme.swift). */
@font-face { font-family: "Newsreader"; font-weight: 400; font-display: swap; src: url("fonts/newsreader-latin-400-normal-BFBkh4jY.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 500; font-display: swap; src: url("fonts/newsreader-latin-500-normal-B66TYsaK.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal-C38fXH4l.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal-Cerq10X2.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal-LgqL8muc.woff2") format("woff2"); }

:root {
  --paper: #f7f4ef;      /* 生成り kinari */
  --surface: #fffdf9;    /* 胡粉 gofun */
  --sunken: #efebe4;
  --ink: #171a1d;        /* 墨 sumi */
  --muted: #62656a;      /* 鈍色 nibi */
  --line: #d9d4cd;       /* 白鼠 shironezumi */
  --shikon: #3d315b;     /* 紫紺 brand */
  --shikon-ink: #3d315b;
  --sakura: #d98691;     /* 桜, personal accents only */
  --on-shikon: #f7f4ef;
  --display: "Newsreader", "New York", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --content: 1180px;
  --gutter: clamp(20px, 4.2vw, 56px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131215; --surface: #1d1b21; --sunken: #27242c; --ink: #f1ede6; --muted: #a5a1aa; --line: #36323d;
    --shikon-ink: #c3b6e3; --on-shikon: #f7f4ef; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sakura); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--content); margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.wordmark { font-family: var(--display); font-size: 2rem; line-height: 1; letter-spacing: -0.01em; }
.wordmark .i { position: relative; }
.wordmark .i::after { content: ""; position: absolute; left: 50%; top: 0.06em; width: 0.15em; height: 0.15em; border-radius: 50%; background: var(--sakura); transform: translateX(-50%); }
.site-nav { display: flex; gap: 26px; font-size: .92rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 560px) { .site-nav { gap: 16px; font-size: .86rem; } .wordmark { font-size: 1.7rem; } }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.8rem, 7vw, 5rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.08; }
h3 { font-size: 1.4rem; line-height: 1.25; font-weight: 500; }
p { margin: 0; }
.eyebrow { font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--shikon-ink); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.muted { color: var(--muted); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.button { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 10px; background: var(--shikon); color: var(--on-shikon); text-decoration: none; font-weight: 500; font-size: .95rem; }
.button:hover { filter: brightness(1.12); }
.text-link { text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 3px; font-size: .95rem; font-weight: 500; }
.note { font-size: .85rem; color: var(--muted); }

/* Hero */
.hero { padding-block: clamp(56px, 9vw, 112px) clamp(48px, 7vw, 88px); }
.hero .container { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero-copy { display: grid; gap: 26px; }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } }

.phone { width: min(330px, 78vw); justify-self: center; border-radius: 46px; padding: 10px; background: #0d0c0f; box-shadow: 0 30px 60px -28px rgba(23, 20, 35, .45), 0 0 0 1px rgba(0,0,0,.06); }
.phone img { border-radius: 37px; width: 100%; height: auto; }

/* Sections */
section.band { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 4vw, 52px); max-width: 44em; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: grid; gap: 10px; align-content: start; }
.step .num { font-family: var(--display); font-size: 1.8rem; color: var(--shikon-ink); line-height: 1; }
.step p { color: var(--muted); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 64px) clamp(28px, 5vw, 72px); align-items: center; }
.feature { display: grid; gap: 12px; }
.feature p { color: var(--muted); }
.feature-shot { width: min(300px, 70vw); justify-self: center; }
.features + .features { margin-top: clamp(48px, 7vw, 96px); }
@media (min-width: 761px) { .features.reverse .feature-shot { order: -1; } }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.pledge-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pledge-row div { padding-top: 16px; border-top: 2px solid var(--sakura); display: grid; gap: 8px; }
.pledge-row p { color: var(--muted); font-size: .97rem; }
@media (max-width: 760px) { .pledge-row { grid-template-columns: 1fr; } }

.future { background: var(--shikon); color: var(--on-shikon); }
.future .eyebrow { color: #e9a3ad; }
.future .container { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.future p { color: rgba(247, 244, 239, .82); max-width: 40em; }
.future .copy { display: grid; gap: 16px; }
@media (max-width: 640px) { .future .container { grid-template-columns: 1fr; } }

/* Documents (pledge, privacy) */
.doc { padding-block: clamp(48px, 7vw, 96px); }
.doc .container { max-width: 820px; display: grid; gap: 22px; }
.doc h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); }
.doc h2 { font-size: 1.7rem; margin-top: 18px; }
.doc h3 { font-size: 1.2rem; margin-top: 8px; }
.doc p, .doc li { color: var(--ink); }
.doc ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.doc .meta { font-size: .9rem; color: var(--muted); }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--sakura); border-radius: 12px; padding: 18px 20px; display: grid; gap: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px 48px; font-size: .88rem; color: var(--muted); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ───────── Motion ─────────
   Static styles first (the drawn crests, the demo pill, petals), then animated states that apply only
   under html.motion, which motion.js adds unless the visitor prefers reduced motion. */

.site-header { transition: box-shadow .3s ease, background-color .3s ease; }
.site-header.scrolled { box-shadow: 0 8px 24px -18px rgba(23, 20, 35, .35); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }

h1.split .line { display: block; }

/* Drawn crest */
.crest-draw { display: block; overflow: visible; }
.crest-draw .stroke { fill: none; stroke: var(--crest, var(--shikon-ink)); stroke-linecap: round; stroke-linejoin: round; }
.crest-draw .ring { stroke-width: 5.5; }
.crest-draw .eave, .crest-draw .roof { stroke-width: 5; }
.crest-draw .hearth { fill: var(--sakura); transform-box: fill-box; transform-origin: center; }

.hero-art { position: relative; display: grid; place-items: center; }
.hero-crest { position: absolute; width: min(560px, 120%); opacity: .09; z-index: 0; --crest: var(--shikon-ink); }
.hero-crest .hearth { fill: var(--shikon-ink); }
.hero-art .phone { position: relative; z-index: 1; }

.future-crest { width: clamp(96px, 12vw, 150px); --crest: var(--on-shikon); }
.future-crest .hearth { fill: #e9a3ad; }

/* Steps progress line */
.steps { position: relative; }
.steps-line { display: none; }

/* Search typing demo */
.shot-wrap { position: relative; display: grid; justify-items: center; }
/* Sits exactly over the search field in the screenshot, so the field appears to type. */
.search-demo { position: absolute; z-index: 2; top: calc(21.5% - 21px); left: 50%; translate: -50% 0; width: 80%; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px 10px 14px; min-width: 190px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; font: 500 1rem/1 var(--sans);
  box-shadow: 0 18px 40px -20px rgba(23, 20, 35, .45); }
.search-demo svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-demo .typed::before { content: ""; }
.no-js .search-demo .typed::before, html:not(.motion) .search-demo .typed:empty::before { content: "garden"; }
.search-demo .caret { width: 2px; height: 1.1em; background: var(--sakura); margin-left: -4px; }
.search-demo.done { border-color: var(--sakura); }


/* Petals in the aubergine band */
.future { position: relative; overflow: hidden; }
.future .container { position: relative; z-index: 1; }
.petals { position: absolute; inset: 0; pointer-events: none; display: none; }
.petals i { position: absolute; top: -24px; width: 12px; height: 9px; background: #e9a3ad; opacity: .55; border-radius: 100% 0 100% 0; }

@media (prefers-reduced-motion: no-preference) {
  html.motion [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 110ms); }
  html.motion [data-reveal].in { opacity: 1; transform: none; }
  html.motion h1.split .line[data-reveal] { transform: translateY(0.6em); }
  html.motion h1.split .line[data-reveal].in { transform: none; }

  html.motion .crest-draw .stroke { stroke-dasharray: 1; stroke-dashoffset: 1; }
  html.motion .crest-draw.in .stroke { animation: draw 1.6s cubic-bezier(.65, 0, .35, 1) forwards; }
  html.motion .crest-draw.in .eave { animation-delay: .55s; }
  html.motion .crest-draw.in .roof { animation-delay: .9s; }
  html.motion .crest-draw .hearth { transform: scale(0); }
  html.motion .crest-draw.in .hearth { animation: bloom .7s cubic-bezier(.3, 1.6, .5, 1) 1.5s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes bloom { to { transform: scale(1); } }

  /* Hero phone starts leaning back and straightens as you scroll. */
  html.motion .phone.tilt { transform: perspective(1400px) rotateX(calc(var(--tilt, 1) * 10deg)) rotateY(calc(var(--tilt, 1) * -14deg)) translateY(calc(var(--tilt, 1) * -6px)); transition: opacity .9s ease, transform .2s linear; }
  html.motion .phone.tilt:not(.in) { opacity: 0; }

  html.motion .phone.parallax.in { transform: translateY(var(--shift, 0)); transition: opacity .8s ease, transform .15s linear; }

  html.motion .steps-line { display: block; position: absolute; left: 6%; right: 6%; top: -18px; height: 2px; background: var(--line); border-radius: 2px; }
  html.motion .steps-line span { display: block; height: 100%; width: calc(var(--progress, 0) * 100%); background: var(--sakura); border-radius: 2px; }
  @media (max-width: 760px) { html.motion .steps-line { display: none; } }

  html.motion .step { transition: opacity .8s, transform .8s, border-color .4s, box-shadow .4s; }
  html.motion .step:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -28px rgba(61, 49, 91, .55); border-color: color-mix(in srgb, var(--shikon-ink) 35%, var(--line)); }

  html.motion .pledge-row > div { border-top-color: transparent; position: relative; }
  html.motion .pledge-row > div::before { content: ""; position: absolute; top: -2px; left: 0; height: 2px; width: 0; background: var(--sakura); transition: width 1s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 160ms + .2s); }
  html.motion .pledge-row > div.in::before { width: 100%; }

  html.motion .search-demo .caret { animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  html.motion .search-demo.done { animation: settle .6s ease; }
  @keyframes settle { 40% { transform: scale(1.04); } }

  html.motion .button { transition: transform .25s ease, filter .25s ease, box-shadow .25s ease; }
  html.motion .button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(61, 49, 91, .7); }
  html.motion .button span { display: inline-block; transition: transform .25s ease; }
  html.motion .button:hover span { transform: translateX(4px); }

  html.motion .petals { display: block; }
  html.motion .petals i { animation: fall var(--d, 14s) linear var(--delay, 0s) infinite; }
  html.motion .petals i:nth-child(1) { left: 8%;  --d: 15s; --delay: -2s; }
  html.motion .petals i:nth-child(2) { left: 22%; --d: 19s; --delay: -9s; transform: scale(.7); }
  html.motion .petals i:nth-child(3) { left: 41%; --d: 13s; --delay: -5s; }
  html.motion .petals i:nth-child(4) { left: 57%; --d: 21s; --delay: -14s; transform: scale(.8); }
  html.motion .petals i:nth-child(5) { left: 70%; --d: 16s; --delay: -1s; }
  html.motion .petals i:nth-child(6) { left: 84%; --d: 18s; --delay: -11s; transform: scale(.6); }
  html.motion .petals i:nth-child(7) { left: 94%; --d: 14s; --delay: -6s; }
  @keyframes fall {
    0%   { transform: translate(0, -20px) rotate(0deg); }
    50%  { transform: translate(-40px, 260px) rotate(170deg); }
    100% { transform: translate(20px, 560px) rotate(360deg); }
  }
}
