/* Mahina Labs. Dark-first "night sky" studio page (pattern: Bending Spoons / Linear hero, Atomic-style numbered sections).
   Type: Instrument Serif for display, Geist for text, Geist Mono for small labels. All self-hosted (no trackers). */
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* dark (default): Miami at night */
  --bg: #080b1c;
  --surface: #10142c;
  --surface-2: #161b3a;
  --fg: #eef0f8;
  --muted: #9aa1c2;
  --faint: #7f87ad;
  --line: rgba(238, 240, 248, .12);
  --field-line: rgba(238, 240, 248, .38);
  --accent: #e9d9a6;
  --on-accent: #0d1024;
  --sky: #10163d;
  --sky-glow: #2a3680;
  --star: rgba(255, 255, 255, .7);
  --moon: #efe3bf;
  --mark: #e9d9a6;
  --moon-shade: #161c48;
  --focus: #a9b8ff;
  --ok: #86d9ac;
  --err: #ff9e95;
  --shadow: rgba(0, 0, 0, .45);

  --display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.6rem, 3vw, 2rem);
  --step-3: clamp(2.2rem, 5vw, 3.5rem);
  --step-4: clamp(3.1rem, 9vw, 7.25rem);
  --radius: 20px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f2ec; --surface: #ffffff; --surface-2: #ece9e0; --fg: #12152b; --muted: #4f5570; --faint: #5f6380;
    --line: rgba(18, 21, 43, .12); --field-line: rgba(18, 21, 43, .34); --accent: #7a5c1b; --on-accent: #ffffff;
    --sky: #121a4a; --sky-glow: #34439a; --star: rgba(255, 255, 255, .75); --moon: #efe3bf; --mark: #b08a2e; --moon-shade: #1b2257;
    --focus: #3550d0; --ok: #1d6b45; --err: #a1302a; --shadow: rgba(18, 21, 43, .22);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f2ec; --surface: #ffffff; --surface-2: #ece9e0; --fg: #12152b; --muted: #4f5570; --faint: #5f6380;
  --line: rgba(18, 21, 43, .12); --field-line: rgba(18, 21, 43, .34); --accent: #7a5c1b; --on-accent: #ffffff;
  --sky: #121a4a; --sky-glow: #34439a; --star: rgba(255, 255, 255, .75); --moon: #efe3bf; --mark: #b08a2e; --moon-shade: #1b2257;
  --focus: #3550d0; --ok: #1d6b45; --err: #a1302a; --shadow: rgba(18, 21, 43, .22);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: .5rem .8rem; border-radius: 8px; z-index: 5; }

.wrap { max-width: 76rem; margin: 0 auto; }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

/* header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font: 500 1.05rem/1 var(--body); letter-spacing: -.01em; }
.brand b { font-weight: 400; color: var(--muted); }
.logo { width: 26px; height: 26px; color: var(--mark); flex: none; }
.top nav { display: flex; align-items: center; gap: clamp(.9rem, 2.5vw, 2rem); font-size: var(--step--1); }
.top nav a { text-decoration: none; color: var(--muted); padding-block: .6rem; }
.top nav a:hover { color: var(--fg); }
.top nav a.pill { color: var(--fg); border: 1px solid var(--field-line); border-radius: 999px; padding: .55rem 1rem; }
.top nav a.pill:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* hero */
.hero { display: grid; justify-items: center; text-align: center; padding-block: clamp(3.5rem, 10vw, 8rem) clamp(3rem, 8vw, 6rem); }
.eyebrow { font: 400 .78rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.75rem; }
.hero h1 { font-family: var(--display); font-size: var(--step-4); line-height: .98; letter-spacing: -.025em; max-width: 12ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 34rem; margin-top: 1.75rem; }

.sky { margin: clamp(3rem, 8vw, 5.5rem) 0 0; width: min(100%, 26rem); }
.sky figcaption span { white-space: nowrap; }
@media (min-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 4rem; justify-items: start; text-align: left; align-items: start; padding-block: clamp(2.5rem, 6vw, 5rem); }
  .hero > :not(.sky) { grid-column: 1; }
  .hero .eyebrow { margin-top: 3rem; }
  .sky { grid-column: 2; grid-row: 1 / span 3; margin: 0; width: min(100%, 30rem); justify-self: end; }
}
.sky .window {
  position: relative; aspect-ratio: 1; max-width: 100%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(1.2px 1.2px at 18% 26%, var(--star), transparent 60%),
    radial-gradient(1px 1px at 72% 18%, var(--star), transparent 60%),
    radial-gradient(1.4px 1.4px at 84% 62%, var(--star), transparent 60%),
    radial-gradient(1px 1px at 30% 78%, var(--star), transparent 60%),
    radial-gradient(1px 1px at 58% 88%, var(--star), transparent 60%),
    radial-gradient(1.1px 1.1px at 12% 56%, var(--star), transparent 60%),
    radial-gradient(1px 1px at 46% 12%, var(--star), transparent 60%),
    radial-gradient(circle at 50% 42%, var(--sky-glow) 0%, var(--sky) 70%);
  box-shadow: 0 0 0 1px var(--line), 0 40px 120px -40px var(--shadow);
}
.sky canvas { width: 56%; height: 56%; display: block; }
.moon-fallback { width: 32%; aspect-ratio: 1; max-width: 100%; border-radius: 50%; box-shadow: inset -1.8rem -.4rem 0 0 var(--moon); }
.sky figcaption { margin-top: 1.25rem; font: 400 .78rem/1.6 var(--mono); color: var(--muted); letter-spacing: .03em; font-variant-numeric: tabular-nums; text-wrap: balance; }
.sky figcaption b { font-weight: 400; color: var(--fg); }

/* numbered sections */
.block { border-top: 1px solid var(--line); padding-block: clamp(3.5rem, 8vw, 6.5rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2.5rem clamp(2rem, 6vw, 5rem); }
.head { display: grid; gap: .75rem; align-content: start; }
.num { font: 400 .78rem/1 var(--mono); color: var(--faint); letter-spacing: .1em; }
.head h2 { font-family: var(--display); font-size: var(--step-3); line-height: 1; letter-spacing: -.015em; }
.sub { color: var(--muted); max-width: 22rem; }
.alt { color: var(--muted); font-size: var(--step--1); margin-top: .5rem; }
.alt a { color: var(--fg); }

/* work cards */
.cards { display: grid; gap: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.art { min-height: 22rem; display: grid; place-items: end center; padding-top: 2.5rem; overflow: hidden; }
.art-night { background: radial-gradient(circle at 50% 20%, #3a49a6, #0e1440 70%); }
.phone {
  width: 13.5rem; max-width: 80%; aspect-ratio: 9 / 15; margin-bottom: -2.5rem; border-radius: 2rem 2rem 0 0;
  background: linear-gradient(180deg, #0f1436, #0a0d24); border: 6px solid #22284f; border-bottom: 0;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); display: grid; align-content: start; gap: .5rem; padding: 1.4rem 1.1rem; text-align: left; color: #eef0f8;
}
.ph-time { font: 500 .65rem/1 var(--body); color: #9aa1c2; text-align: center; margin-bottom: .6rem; }
.ph-label { font: 400 .6rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #e9d9a6; }
.ph-verse { font: italic 400 1.25rem/1.15 var(--display); }
.ph-ref { font: 400 .7rem/1 var(--body); color: #9aa1c2; }
.ph-btn { justify-self: start; margin-top: .8rem; font: 500 .72rem/1 var(--body); color: #0d1024; background: #e9d9a6; border-radius: 999px; padding: .55rem .95rem; }
.card .body { padding: clamp(1.5rem, 4vw, 2.5rem); display: grid; gap: .75rem; align-content: center; }
.next { color: var(--muted); display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding-inline: .25rem; }
.status { display: inline-flex; align-items: center; gap: .5rem; font: 400 .75rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
.status-muted { color: var(--faint); }
.status-muted i { background: transparent; border: 1px solid currentColor; box-shadow: none; }
.card h3 { font-family: var(--display); font-size: var(--step-2); line-height: 1.1; }
.card p:not(.status) { color: var(--muted); }

/* principles */
.principles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.principles li { display: grid; gap: .5rem; align-content: start; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.principles .n { font: italic 400 1.1rem/1 var(--display); color: var(--accent); }
.principles h3 { font-family: var(--display); font-size: var(--step-2); line-height: 1.1; }
.principles p { color: var(--muted); }

/* statement */
.statement { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
.statement p { font-family: var(--display); font-size: var(--step-3); line-height: 1.12; letter-spacing: -.01em; max-width: 24ch; }
.statement em { color: var(--accent); }

/* form */
form { display: grid; gap: 1.1rem; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
label { display: grid; gap: .45rem; font-size: var(--step--1); color: var(--muted); }
input, textarea {
  font: inherit; font-size: var(--step-0); color: var(--fg); background: var(--surface);
  border: 1px solid var(--field-line); border-radius: 12px; padding: .85rem 1rem; width: 100%;
}
textarea { min-height: 10rem; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.send { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; }
button {
  font: 500 var(--step-0)/1 var(--body); color: var(--on-accent); background: var(--accent);
  border: 0; border-radius: 999px; padding: 1rem 1.75rem; cursor: pointer;
}
button:hover { background: var(--fg); color: var(--bg); }
button[disabled] { opacity: .55; cursor: progress; }
.status-line { font-size: var(--step--1); }
.status-line.ok { color: var(--ok); }
.status-line.err { color: var(--err); }

/* legal pages */
.doc { max-width: 42rem; padding-block: clamp(2.5rem, 7vw, 5rem) 4rem; }
.doc h1 { font-family: var(--display); font-size: var(--step-3); line-height: 1; letter-spacing: -.015em; margin-bottom: .75rem; }
.doc .updated { font: 400 .78rem/1.4 var(--mono); color: var(--muted); margin-bottom: 2.5rem; }
.doc h2 { font-family: var(--display); font-size: var(--step-2); margin: 2.5rem 0 .5rem; }
.doc p { margin-bottom: 1rem; color: var(--muted); }
.doc p a, .doc .mono a { color: var(--fg); }
.mono { font-family: var(--mono); font-size: .92em; }

/* footer */
footer { border-top: 1px solid var(--line); padding-block: 2rem 3rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; font-size: var(--step--1); color: var(--muted); }
footer .brand { color: var(--fg); }
footer nav { display: flex; gap: 1.5rem; }
footer nav a { text-decoration: none; padding-block: .5rem; }
footer nav a:hover { color: var(--fg); }

@media (max-width: 820px) {
  .block { grid-template-columns: minmax(0, 1fr); }
  .card, .principles { grid-template-columns: minmax(0, 1fr); }
  .art { min-height: 17rem; }
}
@media (max-width: 560px) {
  .top nav a:not(.pill) { display: none; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .sky { width: min(100%, 18rem); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 1.1s cubic-bezier(.2, .7, .2, 1); }
  .hero > :nth-child(2) { animation-delay: .06s; }
  .hero > :nth-child(3) { animation-delay: .12s; }
  .hero > :nth-child(4) { animation-delay: .2s; animation-duration: 1.6s; }
  @keyframes rise { from { transform: translateY(14px); } to { transform: none; } }
}
