/* knuckly.app: Ember palette from mobile/src/theme/palettes.ts (dark first, light when the system asks for it).
   One accent (streetlight orange) for status and links; photos stay dark in both themes. No web fonts, no scripts. */
:root {
  --bg: #0E1116; --card: #181C23; --control: #222731; --line: #3A4250;
  --text: #F5F2ED; --text2: #B0B6C2; --muted: #98A0AE; --link: #FF9D63;
  --accent: #FF7A33; --accent-soft: rgba(255, 122, 51, 0.16);
  --hairline: rgba(255, 255, 255, 0.07);
  --shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.85);
  --bone: #F5F2ED; --bone2: #D9D4CC; --ink: #0E1116;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px; --s12: 96px;
  --r-lg: 28px; --r-md: 22px; --r-pill: 999px;
  --wrap: 1120px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F5F3EF; --card: #FFFFFF; --control: #EDE9E3; --line: #D5CEC5;
    --text: #17191E; --text2: #595E69; --muted: #666B76; --link: #B4460D;
    --accent: #E85D14; --accent-soft: rgba(232, 93, 20, 0.12);
    --hairline: rgba(23, 25, 30, 0.08);
    --shadow: 0 16px 40px -18px rgba(23, 25, 30, 0.28);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.025em; line-height: 1.08; }
p { margin: 0; }

/* Links: colour + underline on hover, dimmed while pressed, a clear ring on keyboard focus. */
a { color: var(--link); text-decoration: none; border-radius: 6px; transition: opacity 120ms var(--ease), color 120ms var(--ease); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:active { opacity: 0.7; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: var(--s2); top: -100px; z-index: 10; padding: 12px var(--s2); background: var(--accent); color: var(--ink); font-weight: 700; }
.skip:focus { top: var(--s2); }

/* Top bar: the wordmark and two quiet links. Targets are at least 44 px tall. */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  max-width: var(--wrap); margin: 0 auto; padding: var(--s2) max(var(--s2), env(safe-area-inset-left));
}
.bar--over { position: absolute; inset: 0 0 auto 0; z-index: 2; }
.brand { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 4px; }
.brand img { width: 108px; height: auto; }
.bar nav { display: flex; gap: var(--s1); }
.bar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text2); font-weight: 600; font-size: 16px; }
.bar nav a:hover { color: var(--text); }
.bar--over nav a { color: var(--bone2); }
.bar--over nav a:hover { color: var(--bone); }

/* Hero: the photo stays dark in both themes; the copy sits on its black lower edge. */
.hero { position: relative; background: var(--ink); color: var(--bone); overflow: hidden; }
.hero__media { position: relative; max-width: 1280px; margin: 0 auto; }
.hero__media img { width: 100%; aspect-ratio: 1100 / 730; object-fit: cover; object-position: 50% 30%; }
.hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(14, 17, 22, 0.55) 0%, rgba(14, 17, 22, 0) 22%),
    linear-gradient(to top, #0E1116 4%, rgba(14, 17, 22, 0) 48%),
    linear-gradient(to right, #0E1116 0%, rgba(14, 17, 22, 0) 9%, rgba(14, 17, 22, 0) 91%, #0E1116 100%);
}
.hero__copy {
  position: relative; z-index: 1; max-width: var(--wrap); margin: calc(var(--s12) * -1) auto 0;
  padding: 0 var(--s2) var(--s12);
}
.eyebrow { color: #FF9D63; font-size: 14px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.hero h1 { margin-top: var(--s2); font-size: clamp(42px, 8.4vw, 84px); max-width: 15ch; }
.hero .lead { margin-top: var(--s3); max-width: 34rem; color: var(--bone2); font-size: clamp(18px, 2.1vw, 21px); line-height: 1.5; }
.status {
  display: inline-flex; align-items: center; gap: 10px; margin-top: var(--s4);
  min-height: 44px; padding: 10px 18px; border-radius: var(--r-pill);
  background: rgba(255, 122, 51, 0.14); border: 1px solid rgba(255, 122, 51, 0.35);
  color: var(--bone); font-weight: 700; font-size: 16px;
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #FF7A33; box-shadow: 0 0 0 4px rgba(255, 122, 51, 0.22); }

/* Sections */
.section { max-width: var(--wrap); margin: 0 auto; padding: var(--s12) var(--s2) 0; }
.section > h2 { font-size: clamp(30px, 4.4vw, 46px); max-width: 18ch; }
.section > .intro { margin-top: var(--s2); max-width: 36rem; color: var(--text2); font-size: 19px; }

/* Three real screens */
.screens { display: grid; gap: var(--s4); margin-top: var(--s6); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.screen { margin: 0; }
.screen__frame {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background: #0E1116; border: 1px solid var(--hairline); box-shadow: var(--shadow);
  aspect-ratio: 640 / 985;
}
.screen__frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.screen__frame::after { content: ""; position: absolute; inset: auto 0 0 0; height: 28%; background: linear-gradient(to top, #0E1116, rgba(14, 17, 22, 0)); }
.screen figcaption { margin-top: var(--s3); }
.screen h3 { font-size: 22px; letter-spacing: -0.015em; }
.screen p { margin-top: var(--s1); color: var(--text2); }

/* What Knuckly won't do */
.promises { list-style: none; padding: 0; margin: var(--s6) 0 0; display: grid; gap: var(--s2); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.promise { padding: var(--s4); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--hairline); }
.promise svg { width: 28px; height: 28px; color: var(--accent); }
.promise h3 { margin-top: var(--s3); font-size: 21px; letter-spacing: -0.015em; }
.promise p { margin-top: var(--s1); color: var(--text2); }

/* Closing band */
.closing { margin-top: var(--s12); padding: var(--s8) var(--s4); border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--hairline); text-align: center; }
.closing h2 { font-size: clamp(28px, 4vw, 40px); }
.closing p { margin: var(--s2) auto 0; max-width: 30rem; color: var(--text2); }
.closing .status { color: var(--text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* Footer */
.foot { max-width: var(--wrap); margin: var(--s12) auto 0; padding: var(--s4) var(--s2) max(var(--s6), env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); color: var(--muted); font-size: 15px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 var(--s1); margin-left: -12px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text2); font-weight: 600; }
.foot nav a:hover { color: var(--text); }
.foot p { margin-top: var(--s1); }

/* Legal pages and the 404 */
.doc .bar { border-bottom: 1px solid var(--hairline); max-width: none; padding-left: max(var(--s2), calc((100% - var(--wrap)) / 2)); padding-right: max(var(--s2), calc((100% - var(--wrap)) / 2)); }
.legal { max-width: 44rem; margin: 0 auto; padding: var(--s8) var(--s2) 0; }
.legal h1 { font-size: clamp(34px, 6vw, 48px); }
.legal h2 { margin-top: var(--s6); font-size: 22px; letter-spacing: -0.015em; scroll-margin-top: var(--s3); }
.legal p, .legal ul { margin-top: var(--s2); color: var(--text2); }
.legal h1 + p { margin-top: var(--s2); color: var(--muted); font-size: 15px; }
.legal strong { color: var(--text); }
.legal ul { padding-left: 1.2em; }
.legal li + li { margin-top: var(--s1); }
.legal code { font-size: 0.92em; }
.lost { max-width: 44rem; margin: 0 auto; padding: var(--s12) var(--s2) 0; }
.lost h1 { font-size: clamp(38px, 7vw, 60px); }
.lost p { margin-top: var(--s2); color: var(--text2); font-size: 19px; }

/* Gentle entrance for the hero copy; none when the system asks for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * { animation: rise 600ms var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: 60ms; }
  .hero__copy > :nth-child(3) { animation-delay: 120ms; }
  .hero__copy > :nth-child(4) { animation-delay: 180ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Phones: one column; screens get narrower so the page doesn't turn into a scroll marathon. */
@media (max-width: 860px) {
  .screens, .promises { grid-template-columns: 1fr; }
  .screens { gap: var(--s8); }
  .screen__frame { max-width: 340px; }
  .bar--over { position: static; max-width: none; background: #0E1116; }
  .hero__media img { aspect-ratio: 1 / 1; object-position: 50% 40%; }
  .hero__copy { margin-top: calc(var(--s8) * -1); padding-bottom: var(--s8); }
  .section { padding-top: var(--s8); }
  .closing { margin-top: var(--s8); padding: var(--s6) var(--s3); }
}
@media (min-width: 1100px) {
  .hero__copy { margin-top: -220px; }
}
