/* Mailie homepage — PROVISIONAL.
   A static sibling of wappie.thehappie.co: the same layout, rhythm, type
   (Inter + IBM Plex Mono, self-hosted) and components, re-tokenised in the
   provisional Mailie terracotta (#B24B1E, web/src/brand/mark.ts). No build
   step and no JavaScript needed; the theme follows prefers-color-scheme. */

@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/inter-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 800; src: url(/fonts/inter-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;
  --brand: #B24B1E;         /* provisional Mailie colour, 5.36:1 with white */
  --gold: #F0C24B;          /* the family's warm spark (thehappie.co --joy) */
  --peach: #f5a37e;         /* the console's dark accent */

  --ink: #3b2218;           /* 13.9:1 on paper */
  --ink-soft: #664a3e;      /* 7.6:1 */
  --paper: #fbf8f6;
  --surface: #ffffff;
  --line: #ecdfd7;
  --muted: #7a5e52;         /* 5.6:1 */
  --joy: #a8441a;           /* accent text: eyebrows, numbers, 5.7:1 */
  --fill: #b24b1e;
  --fill-hover: #9c4119;
  --on-fill: #ffffff;
  --nav-bg: rgba(251, 248, 246, .86);
  --code: #2e1810;
  --code-text: #f6e5db;
  --code-dim: #c9a898;
  --code-comment: #f5a37e;
  --code-rule: rgba(255, 255, 255, .12);
  --code-shadow: 0 20px 65px rgba(74, 30, 10, .16);
  --shadow-rest: 0 1px 2px rgba(74, 30, 10, .06);
  --blob-opacity: .22;
  --blob-a: var(--gold);
  --blob-b: var(--brand);
  --blob-c: var(--peach);

  /* lockup + mark: outline on light (brand frame, white interior) */
  --lk-color: var(--brand);
  --bm-frame: var(--brand);
  --bm-interior: #ffffff;
  --bm-symbol: var(--brand);

  --r-sm: 12px; --r-md: 18px; --r-lg: 24px; --pill: 999px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --pop: cubic-bezier(.34, 1.56, .64, 1);
  --maxw: 1120px;
  --pad-inline: clamp(1.25rem, 4vw, 2.5rem);
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5ebe5;         /* 15.6:1 */
    --ink-soft: #d2beb3;    /* 10.3:1 */
    --paper: #1a1310;
    --surface: #231a16;
    --line: #3a2b24;
    --muted: #b09a8f;       /* 6.9:1 */
    --joy: #f5a37e;         /* 9.1:1 */
    --fill: #f08a5d;
    --fill-hover: #f5a37e;
    --on-fill: #2a0f04;     /* 7.3:1 on fill */
    --nav-bg: rgba(26, 19, 16, .86);
    --code: #2a1a13;
    --code-rule: rgba(255, 255, 255, .09);
    --code-shadow: 0 0 0 1px #3a2b24, 0 24px 60px rgba(0, 0, 0, .45);
    --shadow-rest: 0 1px 2px rgba(0, 0, 0, .35);
    --blob-opacity: .14;
    /* gold turns olive on a dark warm page: the dark blobs stay in the terracotta family */
    --blob-a: var(--peach);
    --blob-c: #A33960;
    /* tile on dark (white frame, brand interior), like the kits */
    --lk-color: #ffffff;
    --bm-frame: #ffffff;
    --bm-interior: var(--brand);
    --bm-symbol: #ffffff;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-width: 320px;
  background: var(--paper); color: var(--ink);
  font-family: var(--font-sans); font-size: 17px; line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-synthesis: none;
}
::selection { background: var(--gold); color: #242B5E; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad-inline); }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--surface); color: var(--ink); padding: .8rem 1rem; border-radius: 0 0 var(--r-sm) 0; }
.skip:focus { left: 0; }

.eyebrow {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: .55rem; margin: 0 0 1.4rem;
}
.eyebrow::before { content: ""; width: 18px; height: 9px; flex: 0 0 auto; border: 1.6px solid var(--joy); border-top: none; border-radius: 0 0 18px 18px; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; font-size: .98rem; line-height: 1.3;
  padding: .78rem 1.35rem; border-radius: var(--pill); border: 1px solid transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn .arr, .text-link .arr { display: inline-block; transition: transform .25s var(--ease); }
.btn:hover .arr, .text-link:hover .arr { transform: translateX(3px); }
.btn-primary { background: var(--fill); color: var(--on-fill); }
.btn-primary:hover { background: var(--fill-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.text-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; border-bottom: 2px solid var(--joy); padding-bottom: .1rem; }

.tag {
  font-family: var(--font-mono); font-size: .66rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4;
  color: var(--joy); border: 1px solid color-mix(in oklab, var(--joy) 45%, transparent); border-radius: var(--pill);
  padding: .3rem .65rem; white-space: nowrap;
}
.tag-soon { color: var(--muted); border-color: var(--line); }

/* ---------- brand mark (web/src/brand/mark.css, theme by media query) ---------- */
.bm { display: block; overflow: visible; }
.bm-frame    { fill: var(--bm-frame); }
.bm-interior { fill: var(--bm-interior); }
.bm-fill     { fill: var(--bm-symbol); }
.bm-cut      { fill: none; stroke: var(--bm-interior); } /* the kits stroke "cut" parts in the interior colour */
.bm--play { transform-origin: 50% 50%; animation: bm-pop .65s var(--ease) both; }
.bm--play .bm-part { transform-box: fill-box; transform-origin: 50% 50%; }
.bm--play .bm-body { animation: bm-body .45s var(--pop) .25s both; }
.bm--play .bm-flap { animation: bm-draw .45s ease-out .6s both; }
@keyframes bm-pop  { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes bm-body { from { transform: scale(.6); } to { transform: scale(1); } }
@keyframes bm-draw { to { stroke-dashoffset: 0; } }

/* ---------- lockup (web/src/components/BrandLockup.vue) ---------- */
.lockup { --lk: 34px; display: inline-flex; align-items: center; color: var(--lk-color); }
.lockup[data-size="30"] { --lk: 30px; }
.lockup-mark { display: block; flex: 0 0 auto; }
.lockup-text { display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; margin-left: calc(var(--lk) * .2); animation: lockup-reveal .45s var(--ease) .25s both; }
.lockup-name { font-weight: 800; letter-spacing: -.03em; font-size: calc(var(--lk) * .6); line-height: 1; margin-top: calc(var(--lk) * -.085); white-space: nowrap; }
.lockup-by { font-family: var(--font-mono); font-size: calc(var(--lk) * .28); line-height: 1; letter-spacing: .01em; word-spacing: -.12em; color: var(--muted); white-space: nowrap; }
@keyframes lockup-reveal { from { clip-path: inset(-30% 100% -30% -10%); } to { clip-path: inset(-30% -20% -30% -10%); } }

/* ---------- header ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(140%) blur(12px); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: .9rem; }
.brand { display: flex; align-items: center; border-radius: 10px; }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { font-size: .95rem; color: var(--ink-soft); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); padding: 3px; font-family: var(--font-mono); }
.lang a { color: var(--muted); font-size: .72rem; letter-spacing: .06em; line-height: 1.4; padding: .32rem .6rem; border-radius: var(--pill); transition: background .2s var(--ease), color .2s var(--ease); }
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3rem, 7vw, 5.5rem); }
.hero > .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2.5rem, 6vw, 4rem); align-items: center; }
.hero-copy { min-width: 0; }
.hero-top { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.8rem; }
.hero-mark { width: 160px; height: 160px; flex: 0 0 auto; }
.hero-copy .eyebrow { color: var(--joy); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); font-weight: 700; line-height: 1.05; letter-spacing: -.045em; margin: 0 0 1.2rem; max-width: 16ch; }
.hero .lead { color: var(--muted); font-size: clamp(1.08rem, 1.7vw, 1.32rem); line-height: 1.55; max-width: 520px; margin: 0; }
.hero-cta { display: flex; gap: .85rem; align-items: center; flex-wrap: wrap; margin-top: 1.9rem; }
.fine { font-size: .88rem; color: var(--muted); margin: 1.4rem 0 0; }

/* Backdrop: three soft radial blobs, transform-only drift. */
.backdrop { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%;
  background: radial-gradient(circle at center, var(--blob-color) 0%, transparent 62%);
  opacity: var(--blob-opacity); will-change: transform;
  animation: blob-drift 26s ease-in-out infinite alternate;
}
.blob-1 { --blob-color: var(--blob-a); top: -28vmax; left: -14vmax; }
.blob-2 { --blob-color: var(--blob-b); top: -18vmax; right: -20vmax; animation-delay: -9s; animation-duration: 31s; }
.blob-3 { --blob-color: var(--blob-c); bottom: -34vmax; left: 30%; animation-delay: -17s; animation-duration: 36s; }
@keyframes blob-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.08); }
  to { transform: translate3d(-4vw, 7vh, 0) scale(.96); }
}

/* Code sample */
.code { margin: 0; background: var(--code); color: var(--code-text); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--code-shadow); min-width: 0; }
.code-title { padding: 1rem 1.5rem; border-bottom: 1px solid var(--code-rule); font-family: var(--font-mono); font-size: .82rem; color: var(--code-dim); }
.code pre { margin: 0; padding: 1rem 1.6rem 1.5rem; overflow-x: auto; font-family: var(--font-mono); font-size: .9rem; line-height: 1.9; }
.code em { color: var(--code-comment); font-style: normal; }
.code b { color: #ffffff; font-weight: 500; }
.code .dim { color: var(--code-dim); }

/* ---------- sections ---------- */
.section { padding-block: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line); scroll-margin-top: 64px; }
.section h2 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 1rem; }
.section .intro { color: var(--ink-soft); max-width: 60ch; margin: 0 0 2.4rem; }
.columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.columns article { min-width: 0; }
.columns h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: .8rem 0 .5rem; }
.columns p { color: var(--ink-soft); margin: 0; }
.number { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; color: var(--joy); }

/* "Coming soon": four quieter cards, each tagged. */
.soon-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.soon {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-rest);
  padding: clamp(1.4rem, 2.5vw, 1.9rem); min-width: 0;
}
.soon-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.soon-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--joy); background: color-mix(in oklab, var(--joy) 12%, transparent); }
.soon-icon svg { width: 22px; height: 22px; }
.soon h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: 1.1rem 0 .45rem; }
.soon p { color: var(--ink-soft); font-size: .98rem; line-height: 1.55; margin: 0; }

/* Closing invitation */
.invite { text-align: center; }
.invite .eyebrow { justify-content: center; }
.invite h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); letter-spacing: -.035em; margin: 0 auto; max-width: 22ch; }
.invite-body { color: var(--muted); font-size: 1.05rem; max-width: 46ch; margin: 1.1rem auto 0; }
.invite .hero-cta { justify-content: center; margin-top: 2rem; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 2.8rem 3.2rem; }
.foot-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.foot-brand { display: flex; flex-direction: column; gap: .5rem; }
.foot-name { font-weight: 700; margin: 0; }
.foot-name a { border-bottom: 1px solid transparent; transition: border-color .2s; }
.foot-name a:hover { border-bottom-color: currentColor; }
.foot-brand .muted { color: var(--muted); font-size: .85rem; margin: 0; }
.foot-brand .muted a { color: var(--ink); font-weight: 500; }
.foot-brand .muted a:hover { text-decoration: underline; text-underline-offset: 2px; }
.foot-meta { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); line-height: 1.9; text-align: right; }
.foot-meta a { color: var(--muted); transition: color .2s; }
.foot-meta a:hover { color: var(--ink); }
.foot-links { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .2rem 1rem; margin-top: .4rem; }

/* ---------- 404 ---------- */
.neutral { padding-block: clamp(4rem, 10vw, 7rem); }
.neutral h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; max-width: 30ch; margin: 0; }
.neutral h1 .alt { display: block; color: var(--muted); }
.page-404 { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.page-404 main { flex: 1; }
.neutral-links { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.neutral-links a { font-weight: 600; border-bottom: 2px solid var(--joy); }

/* ---------- entrance motion (CSS only; the final state is the static one) ---------- */
.rise-in { animation: rise-in .7s var(--ease) both; }
.d1 { animation-delay: .12s; } .d2 { animation-delay: .24s; } .d3 { animation-delay: .36s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .columns { grid-template-columns: 1fr; gap: 2.2rem; }
}
@media (max-width: 680px) {
  .soon-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .hero-mark { width: 112px; height: 112px; }
  .hero-top { margin-bottom: 1.5rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; }
  .code-title { padding: .85rem 1rem; font-size: .74rem; }
  .code pre { font-size: .78rem; padding: .9rem 1rem 1.2rem; line-height: 1.8; }
  .foot-inner { flex-direction: column; }
  .foot-meta { text-align: left; }
  .foot-links { justify-content: flex-start; }
}
@media (max-width: 380px) {
  .code pre { font-size: .72rem; }
  .lang a { padding: .32rem .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .bm [stroke-dasharray] { stroke-dasharray: none !important; }
  .backdrop { display: none; }
}
