/* Mahil Labs. One stylesheet for every page. */

/* Geist and Geist Mono, served from this site (SIL Open Font License, see /assets/fonts/OFL.txt) */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 600; font-display: swap; src: url(/assets/fonts/geist-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 600; font-display: swap; src: url(/assets/fonts/geist-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/assets/fonts/geist-mono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/assets/fonts/geist-mono-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #F1F2F0;
  --ink: #121416;
  --mute: #5A6068;
  --rule: #D6D9DB;
  --panel: #E3E5E2;
  --row: #E8EAE7;
  --head: rgba(241, 242, 240, 0.7);
  --accent: #0B3D91;
  --royal: #0B3D91; /* Deep Royal in both themes: the logo, status squares and feature markers */
  --bezel-edge: #121416;
  --shadow: 18, 20, 22;
  --hi: rgba(255, 255, 255, 0.6);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 80px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1113;
    --ink: #ECEDEB;
    --mute: #9AA0A7;
    --rule: #2A2E33;
    --panel: #181B1E;
    --row: #181B1E;
    --head: rgba(15, 17, 19, 0.7);
    --accent: #6F8FE8;
    --bezel-edge: #2A2E33;
    --shadow: 0, 0, 0;
    --hi: rgba(255, 255, 255, 0.04);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 112px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { opacity: 0.7; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
ul { padding: 0; list-style: none; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.muted { color: var(--mute); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 20; }
.skip:focus { left: 8px; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 10; background: var(--head); -webkit-backdrop-filter: saturate(1.8) blur(32px); backdrop-filter: saturate(1.8) blur(32px); border-bottom: 1px solid transparent; transition: border-color 250ms ease; }
.site-head.scrolled { border-bottom-color: var(--rule); }
.site-head .wrap { height: 96px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; font-size: 28px; font-weight: 500; letter-spacing: -0.035em; }
.brand svg { width: 64px; height: 64px; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 5px; line-height: 1.1; }
.brand-sub { font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.nav { display: flex; gap: 4px 20px; font-size: 15px; }
.nav a { text-decoration: none; padding: 12px 4px; }
.nav { align-items: center; }
.nav .contact { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--ink); padding: 0 14px; margin-left: 4px; line-height: 1; }
.nav .contact:hover { background: var(--ink); color: var(--bg); opacity: 1; }
/* The smallest phones (under 360px) keep the earlier, smaller brand so the header fits */
@media (max-width: 359px) {
  .site-head .wrap .brand { font-size: 20px; gap: 10px; }
  .site-head .wrap .brand svg { width: 42px; height: 42px; }
  .site-head .wrap .brand-sub { font-size: 11px; }
}
@media (max-width: 640px) {
  .site-head .wrap { height: 76px; }
  .brand { font-size: 22px; gap: 12px; white-space: nowrap; }
  .nav { font-size: 15px; }
  .nav .contact { padding: 0 12px; }
  .brand svg { width: 50px; height: 50px; }
  /* On phones the subtitle wraps under the name: AN INDEPENDENT / APP STUDIO */
  .brand-sub { font-size: 11.5px; white-space: normal; max-width: 17ch; line-height: 1.25; }
  .nav { gap: 4px 12px; }
}
/* Phones: the links fold into a Menu button that drops a full-width panel under the header.
   Without JavaScript the links stay in the header as before. */
.menu-btn { display: none; align-items: center; height: 38px; padding: 0 14px; font: inherit; font-size: 15px; line-height: 1; color: var(--ink); background: none; border: 1px solid var(--ink); cursor: pointer; }
.menu-btn:hover, .site-head.open .menu-btn { background: var(--ink); color: var(--bg); }
@media (max-width: 640px) {
  .js .menu-btn { display: inline-flex; }
  .js .site-head .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 4px var(--gutter) 12px; background: var(--bg); border-bottom: 1px solid var(--ink); font-size: 22px; letter-spacing: -0.02em; }
  .js .site-head.open .nav { display: flex; }
  .js .site-head.open { border-bottom-color: var(--rule); }
  .js .site-head .nav a, .js .site-head .nav .contact { display: block; height: auto; margin: 0; padding: 16px 0; border: 0; border-bottom: 1px solid var(--rule); line-height: 1.3; }
  .js .site-head .nav a:last-child { border-bottom: 0; }
  .js .site-head .nav .contact:hover { background: none; color: inherit; }
}


/* Mark gradient stops */
/* The M and L fade from ink to Deep Royal. On dark they fade from white and reach Deep Royal sooner, so the L is solid blue,
   matching the brand's social images. The two gradients live in each page's SVG with fixed colors; CSS only picks one,
   which keeps Safari from showing a stale gradient after the light/dark switch. */
.mark-ml { fill: var(--mk-light); }
@media (prefers-color-scheme: dark) { .mark-ml { fill: var(--mk-dark); } }
.mark-frame { stroke: var(--ink); }
.mark-num { fill: var(--ink); }

/* Status squares */
.sq { width: 10px; height: 10px; background: var(--royal); flex: none; }
.sq.planned { width: 9px; height: 9px; background: none; border: 1px dashed var(--ink); }

/* Device frames */
.device { background: #000; outline: 1px solid var(--bezel-edge); padding: 9px; border-radius: 46px; box-shadow: 0 1px 2px rgba(var(--shadow), 0.12), 0 30px 60px -18px rgba(var(--shadow), 0.30), 0 80px 160px -40px rgba(var(--shadow), 0.36); }
.device { overflow: hidden; }
.device img, .device .screens { border-radius: 37px; }
.device.cut { border-radius: 40px 40px 0 0; padding-bottom: 0; }
.device.cut img { border-radius: 33px 33px 0 0; }
.screens { position: relative; overflow: hidden; aspect-ratio: 599 / 1304; }
.screens > img, .screens > picture { position: absolute; inset: 0; opacity: 0; transition: opacity 500ms ease; }
.screens img { width: 100%; }
.screens > .on { opacity: 1; }

/* Load-in and scroll reveal */
.js .in { opacity: 0; transform: translateY(24px); transition: opacity 800ms var(--ease), transform 1000ms var(--ease); }
.js .in.d1 { transition-delay: 120ms; }
.js .in.d2 { transition-delay: 260ms; }
.js .in.d3 { transition-delay: 380ms; }
.js .in.d4 { transition-delay: 520ms; }
.js .ready .in { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 900ms var(--ease); }
.js .reveal.seen { opacity: 1; transform: none; }
.parallax { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .in, .js .reveal { opacity: 1; transform: none; }
}

/* Section heads */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.sec-head h2 { font: inherit; }

/* Home: hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 40px; padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); min-height: 640px; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; }
.hero h1 { font-size: clamp(40px, 4.8vw, 68px); font-weight: 300; letter-spacing: -0.04em; line-height: 1.03; }
.hero p { max-width: 600px; font-size: 19px; line-height: 1.55; color: var(--mute); }
.hero-phones { position: relative; height: 600px; }
.hero-phones > div { position: absolute; }
.hero-phones .back { left: calc(100% - 250px); top: 24px; width: 250px; z-index: 1; cursor: pointer; }
.hero-phones .front { left: 8%; top: 120px; width: 270px; z-index: 2; }
@media (hover: hover) { .js .ready .hero-phones .back:not(.settling):hover .device { transform: translateY(-8px); transition: transform 300ms var(--ease); } }
.hero-phones .front .device { padding: 10px; border-radius: 50px; }
.hero-phones .front img { border-radius: 40px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-bottom: 24px; }
  .hero h1 { font-size: clamp(36px, 9vw, 52px); }
  .hero p { font-size: 17px; }
  .hero-phones { height: 440px; margin: 0 calc(var(--gutter) * -1); background: var(--panel); overflow: hidden; box-shadow: inset 0 1px 0 var(--hi), inset 0 -50px 80px -50px rgba(var(--shadow), 0.14); }
  .hero-phones .back { width: 170px; left: calc(100% - 184px); top: 64px; }
  .hero-phones .back .device { padding: 6px; border-radius: 30px; }
  .hero-phones .back img { border-radius: 25px; }
  .hero-phones .front { width: 210px; left: 24px; top: 34px; }
  .hero-phones .front .device { padding: 8px; border-radius: 38px; }
  .hero-phones .front img { border-radius: 31px; }
}

/* Home: work list */
.work { padding-top: 40px; }
button.entry { width: calc(100% + 32px); font: inherit; color: inherit; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.entry { display: grid; grid-template-columns: 2fr 6fr 2fr 2fr; column-gap: 24px; row-gap: 10px; padding: 28px 16px; margin: 0 -16px; border-bottom: 1px solid var(--rule); text-decoration: none; transition: background 250ms ease; }
.entry:hover { background: var(--row); opacity: 1; }
.entry .num { font-family: var(--mono); font-size: 14px; font-weight: 500; padding-top: 10px; }
.entry .title { font-size: 36px; font-weight: 500; letter-spacing: -0.03em; display: flex; align-items: center; gap: 14px; }
.entry .main { display: flex; flex-direction: column; gap: 8px; }
.entry .toggle { width: 22px; height: 22px; flex: none; transition: transform 400ms var(--ease); }
.entry[aria-expanded="true"] .toggle { transform: rotate(45deg); }
.entry[aria-expanded="true"] { background: var(--row); }
.entry-panel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 600ms var(--ease); }
.entry-panel.closed { grid-template-rows: 0fr; }
/* The open panel ends with a rule as wide as the rows, separating it from the next entry */
.entry-inner { min-height: 0; overflow: hidden; margin: 0 -16px; padding: 0 16px; }
.entry-inner::after { content: ""; display: block; margin: 40px -16px 0; border-bottom: 1px solid var(--rule); }
.steps .step:last-child { border-bottom: 0; }
.entry-panel.settled .entry-inner { overflow: visible; }
.entry-panel.closed .entry-inner { visibility: hidden; transition: visibility 0s 600ms; }
.entry-inner > * { opacity: 1; transform: none; transition: opacity 500ms ease 120ms, transform 700ms var(--ease) 120ms; }
.entry-panel.closed .entry-inner > * { opacity: 0; transform: translateY(-12px); transition-delay: 0ms; }
.entry-details { display: grid; grid-template-columns: 6fr 6fr; gap: 24px 48px; padding: 32px 0 8px; align-items: start; }
.entry-lede { font-size: clamp(20px, 1.8vw, 24px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.4; grid-column: 1; grid-row: 1; max-width: 560px; }
.entry-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 32px; grid-column: 1; }
.badge { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.badge img { width: 150px; height: 50px; }
.badge .mono { font-size: 11px; }
.store-soon { display: inline-flex; align-items: center; height: 50px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; height: 50px; text-decoration: underline; text-decoration-color: var(--rule); }
.text-link svg { width: 14px; height: 14px; }
.entry-details .facts { grid-column: 2; grid-row: 1 / span 2; }
.entry .desc { font-size: 17px; color: var(--mute); }
.entry .plat { font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--mute); padding-top: 10px; }
.entry .status { display: flex; align-items: center; gap: 10px; align-self: start; padding-top: 10px; font-size: 15px; }
.entry.planned { color: var(--mute); }
.entry.planned:hover { background: none; }
@media (max-width: 860px) {
  .entry, button.entry { grid-template-columns: 1fr auto; margin: 0; padding: 22px 0; width: 100%; }
  .entry[aria-expanded="true"] { background: none; }
  .entry-inner { margin: 0; padding: 0; }
  .entry-inner::after { margin: 32px 0 0; }
  .entry-details { grid-template-columns: 1fr; padding-top: 20px; }
  .entry-details .facts, .entry-links { grid-column: 1; grid-row: auto; }
  .entry-lede { grid-row: auto; }
  .entry .num { padding-top: 0; }
  .entry .status { padding-top: 0; justify-self: end; grid-column: 2; grid-row: 1; }
  .entry > .main, .entry .plat { grid-column: 1 / -1; }
  .entry .plat { padding-top: 0; }
  .entry .title { font-size: 30px; }
}

/* Home: pinned showcase */
.show { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; margin-top: 48px; align-items: stretch; }
.steps-col { display: flex; flex-direction: column; }
.steps { flex: 1; display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.steps .step { flex: 1; align-items: flex-start; }
/* Features not on screen are dimmed by color, not opacity, so every line stays readable (AA). */
.step { display: flex; gap: 20px; width: 100%; padding: 22px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.step .tick { width: 8px; height: 8px; margin-top: 8px; background: var(--rule); flex: none; transition: background 300ms ease; }
.step.on .tick { background: var(--royal); }
.step b { display: block; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 6px; color: var(--mute); transition: color 300ms ease; }
.step:hover b, .step:focus-visible b, .step.on b { color: var(--ink); }
.step b + span { font-size: 16px; color: var(--mute); }
.stage-col { display: flex; flex-direction: column; }
.stage-col .stage { flex: 1; }
.stage { position: relative; background: var(--panel); display: flex; justify-content: center; padding: 64px 24px; box-shadow: inset 0 1px 0 var(--hi), inset 0 -40px 80px -40px rgba(var(--shadow), 0.10); }
.cycle-pause { display: none; position: absolute; right: 8px; bottom: 8px; min-width: 44px; min-height: 44px; padding: 0 12px; background: none; border: 0; color: var(--mute); cursor: pointer; font-size: 12px; }
.cycle-pause:hover { color: var(--ink); }
.stage { align-items: center; padding: 32px 24px; }
.stage .device { width: 260px; padding: 9px; border-radius: 48px; }
.stage .screens { border-radius: 39px; }
.caption { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--mute); }
@media (max-width: 860px) {
  .show { grid-template-columns: 1fr; min-height: 0; gap: 0; }
  .steps-col { order: 2; }
  .steps { position: static; }

  .stage-col { order: 1; }
  .stage-col .caption { margin-bottom: 28px; }
  .stage { margin: 0 calc(var(--gutter) * -1); padding: 40px 24px; }
  .stage .device { position: static; width: 240px; }
  .cycle-pause:not([hidden]) { display: block; }
}

/* Principles */
.principles { padding-top: clamp(80px, 10vw, 140px); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 40px; }
.col { padding: 28px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; }
.col h3 { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; }
.col p { color: var(--mute); }

/* About */
.about { padding: clamp(80px, 10vw, 140px) 0; display: grid; grid-template-columns: 4fr 8fr; gap: 24px; }
.about p { font-size: clamp(24px, 2.6vw, 34px); font-weight: 300; letter-spacing: -0.025em; line-height: 1.3; }
.about .button { margin-top: 28px; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* Footer */
.site-foot { border-top: 1px solid var(--ink); padding: 24px 0 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.site-foot a { text-decoration: none; padding: 12px 0; margin: -12px 0; }
.foot-end { display: flex; align-items: center; gap: 28px; }
.socials { display: flex; align-items: center; gap: 4px; margin-left: -11px; }
.site-foot .socials a, .foot-contact { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; margin: -12px 0; color: var(--mute); background: none; border: 0; cursor: pointer; transition: color 200ms ease; }
.site-foot .socials a:hover, .site-foot .socials a:focus-visible, .foot-contact:hover, .foot-contact:focus-visible { color: var(--ink); }

.socials svg { width: 17px; height: 17px; }

/* Project page */
.p-hero { padding: clamp(48px, 8vw, 112px) 0 56px; display: grid; grid-template-columns: 8fr 4fr; gap: 40px 24px; align-items: end; }
.p-hero .copy { display: flex; flex-direction: column; gap: 24px; }
.p-hero h1 { font-size: clamp(52px, 8vw, 120px); font-weight: 300; letter-spacing: -0.05em; line-height: 0.95; }
.p-hero .lede { max-width: 620px; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.45; }
.button { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); text-decoration: none; font-size: 16px; padding: 15px 22px; min-height: 48px; }
.button svg { width: 14px; height: 14px; }
.facts { display: grid; grid-template-columns: 1fr 1.6fr; border-top: 1px solid var(--ink); }
.facts dt, .facts dd { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.facts dd { font-size: 15px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 860px) { .p-hero { grid-template-columns: 1fr; } }

.strip { background: var(--panel); padding: clamp(32px, 5vw, 80px) clamp(12px, 3vw, 56px) 0; display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 2vw, 28px); overflow: hidden; box-shadow: inset 0 1px 0 var(--hi), inset 0 -60px 100px -60px rgba(var(--shadow), 0.14); }
.strip .device { width: 230px; flex: 0 1 230px; padding: 8px 8px 0; }
@media (max-width: 640px) {
  .strip { margin: 0 calc(var(--gutter) * -1); gap: 10px; }
  .strip .device:nth-child(1), .strip .device:nth-child(4) { display: none; }
  .strip .device { flex-basis: 46%; }
}

.chapter { padding-top: clamp(64px, 8vw, 112px); display: grid; grid-template-columns: 4fr 8fr; gap: 16px 24px; }
.chapter > .label { border-top: 1px solid var(--ink); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.chapter > .label span { font-family: var(--mono); font-size: 13px; color: var(--mute); }
.chapter h2 { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.chapter > .body { border-top: 1px solid var(--rule); padding-top: 14px; }
.chapter .big { font-size: clamp(22px, 2.2vw, 28px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.4; }
.chapter li { padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 18px; }
.chapter li b { font-weight: 500; }
.chapter li span { color: var(--mute); }
.chapter .body.flush { padding-top: 0; }
.decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 32px; }
.decisions div { padding: 2px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.decisions h3 { font-size: 19px; font-weight: 500; }
.decisions p { font-size: 16px; line-height: 1.55; color: var(--mute); }
.roadmap div { display: flex; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 18px; }
.roadmap div:first-child { padding-top: 2px; }
.roadmap span:first-child { font-family: var(--mono); font-size: 13px; width: 96px; flex: none; padding-top: 4px; }
.roadmap .later { color: var(--mute); }
.roadmap .later span:first-child { color: var(--ink); }
@media (max-width: 860px) { .chapter { grid-template-columns: 1fr; } .chapter > .body { border-top: 0; padding-top: 0; } }

.modes { padding-top: clamp(64px, 8vw, 112px); }
.modes .sec-head { border-bottom: 0; border-top: 1px solid var(--ink); padding: 14px 0 0; margin-bottom: 32px; justify-content: flex-start; gap: 24px; }
.modes .sec-head span { font-family: var(--mono); font-size: 13px; color: var(--mute); }
.modes .sec-head h2 { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.mode-grid > div { background: var(--panel); padding: 40px 24px; display: flex; justify-content: center; }
.mode-grid > div.night { background: #0B0C0E; }
.mode-grid .device { width: 240px; padding: 8px; border-radius: 40px; }
.mode-grid .device img { border-radius: 33px; }
.mode-grid .night .device { background: #2A2D31; outline: 0; box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 30px 60px -18px rgba(0,0,0,0.5), 0 80px 160px -40px rgba(0,0,0,0.6); }
.entries-nav { margin-top: clamp(80px, 10vw, 140px); border-top: 1px solid var(--ink); padding: 24px 0 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 15px; }
.entries-nav a { text-decoration: none; padding: 8px 0; }

/* 404 */
.lost { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.lost h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 300; letter-spacing: -0.04em; line-height: 1.05; }

/* Contact menu: copies the email address, on every device */

/* An idea that isn't in development yet: listed, not expandable */
.entry.idea { cursor: default; }
.entry.idea:hover { background: none; }
.entry.idea .title { color: var(--ink); }

/* Contact form: a dialog over the page. Full screen on phones. */
.contact-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 28px 32px 32px; border: 1px solid var(--ink); background: var(--bg); color: var(--ink); box-shadow: 0 40px 80px -24px rgba(var(--shadow), 0.45); overscroll-behavior: contain; }
.contact-dialog::backdrop { background: rgba(18, 20, 22, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-open, .modal-open body { overflow: hidden; }
.cd-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.cd-head h2 { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.cd-close { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -12px; padding: 0; background: none; border: 0; color: var(--mute); cursor: pointer; }
.cd-close:hover { color: var(--ink); }
.cd-close svg { width: 20px; height: 20px; }
.cd-form, .cd-done { display: flex; flex-direction: column; gap: 20px; }
.cd-form[hidden], .cd-done[hidden] { display: none; }
.cd-lede { color: var(--mute); font-size: 16px; }
.cd-done:focus { outline: none; }
.cd-done-title { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.cd-done [data-email] { color: var(--ink); overflow-wrap: anywhere; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.field input, .field textarea { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 0; padding: 12px 14px; -webkit-appearance: none; appearance: none; transition: border-color 150ms ease; }
.field textarea { min-height: 148px; resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover { border-color: var(--mute); }
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.field-error { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.field-error[hidden], .cd-status[hidden] { display: none; }
.field-error::before { content: ""; width: 6px; height: 6px; background: var(--royal); flex: none; }
.cd-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cd-turnstile:empty { display: none; }
.cd-status { font-size: 15px; padding: 12px 14px; border: 1px solid var(--ink); }
.cd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.contact-dialog .button { border: 0; cursor: pointer; font: inherit; font-size: 16px; }
.contact-dialog .button:disabled { opacity: 0.6; cursor: progress; }
.cd-copy { padding: 12px 0; background: none; border: 0; font: inherit; font-size: 15px; color: var(--mute); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; cursor: pointer; }
.cd-copy:hover { color: var(--ink); }
.cd-note { font-family: var(--mono); font-size: 12px; color: var(--mute); }
@media (max-width: 640px) {
  .contact-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; box-shadow: none; padding: calc(12px + env(safe-area-inset-top, 0px)) var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px)); }
  .cd-head h2 { font-size: 24px; }
}
