/* Byte Foundry. Light by default; dark when the visitor's system asks for it (the logo is used as supplied in both).
   Layout: a single centred column of sections; cards in grids that fold to one column on phones. */
:root {
  --paper: #f6f7f9;      /* page */
  --surface: #ffffff;    /* cards */
  --ink: #0f2236;        /* text, deep navy */
  --ink-2: #4c5a6b;      /* secondary text */
  --line: #e1e6ed;
  --navy: #164a6e;       /* the logo's "Byte" */
  --navy-deep: #0d3350;
  --orange: #c9560a;     /* the logo's "Foundry", dark end: readable on white */
  --orange-bright: #ef8c10; /* the logo's light end: accents only, never text */
  --header-bg: rgba(246, 247, 249, 0.92);
  --code-bg: #1e1f21;    /* the spec card: neutral charcoal, coloured with the logo's own blue and orange */
  --code-edge: transparent; --code-key: #6fa3cb; --code-str: #ef8c10; --code-val: #f3f3f3; --code-com: #8b9096; --code-dot: #3a3b3e;
  --tag-bg: #fff3e6;     /* the small icon tiles */
  --text: #2b3a4b;       /* long text on legal pages */
  --btn: var(--navy); --btn-hover: var(--navy-deep);
  --plate: #0d3350;      /* the contact panel */
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191919; --surface: #222222; --ink: #f2f2f2; --ink-2: #b0b0b0; --line: #2e2e2e;
    --navy: #9cc4e4; --navy-deep: #c6dcee;
    --orange: #f29a2e; --orange-bright: #ef8c10;
    --header-bg: rgba(25, 25, 25, 0.94); --code-bg: #222222; --code-edge: #2e2e2e; --tag-bg: #33251a; --text: #d6d6d6;
    --btn: #c9560a; --btn-hover: #e06a14; --plate: #222222;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--orange); }
:focus-visible { outline: 3px solid var(--orange-bright); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); color: var(--ink); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.06; letter-spacing: -0.025em; font-weight: 700; }
h2 { font-size: clamp(27px, 3.6vw, 38px); line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
.eyebrow { font: 600 12.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 60ch; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 72px; }
.brand img { width: 200px; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 15.5px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--orange); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 10px; cursor: pointer; font: 600 15.5px/1 var(--body); text-decoration: none; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.btn-primary { background: var(--btn); color: #fff; }
.btn-primary:hover { background: var(--btn-hover); color: #fff; }
.btn-ghost { border: 1.5px solid var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.nav .btn { padding: 10px 16px; color: #fff; }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } .brand img { width: 160px; } }

/* hero */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(56px, 8vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 .cast { color: var(--orange); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.spec { background: var(--code-bg); color: var(--code-val); border: 1px solid var(--code-edge); border-radius: 16px; padding: 22px 24px; font: 14.5px/1.75 var(--mono); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.4); overflow-x: auto; min-width: 0; }
.spec .bar { display: flex; gap: 7px; margin-bottom: 14px; }
.spec .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--code-dot); }
.spec .bar i:first-child { background: var(--orange-bright); }
.spec .k { color: var(--code-key); }
.spec .v { color: var(--code-val); }
.spec .c { color: var(--code-com); }
.spec .s { color: var(--code-str); }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 36px; } }

/* sections */
section.band { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 12px; margin-bottom: 40px; max-width: 760px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px; display: grid; gap: 12px; align-content: start; }
.card p { color: var(--ink-2); font-size: 16px; }
.card ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); font-size: 15.5px; display: grid; gap: 4px; }
.card .tag { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--tag-bg); color: var(--orange); font: 700 15px/1 var(--mono); }

/* the stack */
.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.stack div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; min-width: 0; }
.stack h3 { font: 600 12.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--navy); margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { font: 500 14px/1 var(--body); padding: 8px 11px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); }

/* how we work: a real sequence */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 10px; align-content: start; }
.steps li::before { content: "0" counter(step); font: 700 14px/1 var(--mono); color: var(--orange); }
.steps p { color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .steps { grid-template-columns: 1fr; } }

/* principles */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.points { display: grid; gap: 22px; }
.points div { display: grid; gap: 6px; padding-left: 18px; border-left: 3px solid var(--orange-bright); }
.points p { color: var(--ink-2); font-size: 16px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 32px; } }

/* contact */
.contact { background: var(--plate); color: #e6eef6; border-radius: 20px; padding: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.contact h2 { color: #fff; }
.contact p { color: #c4d3e2; }
.contact .eyebrow { color: #ffb466; }
.contact .mail { font: 600 clamp(19px, 2.4vw, 24px)/1.3 var(--display); color: #fff; text-decoration: none; overflow-wrap: anywhere; }
.contact .mail:hover { color: #ffb466; }
.contact .btn-primary { background: #c9560a; color: #fff; }
.contact .btn-primary:hover { background: #e06a14; color: #fff; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* footer */
footer { padding: 40px 0 56px; color: var(--ink-2); font-size: 14.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
footer img { width: 150px; }

/* legal pages */
.legal { padding: 56px 0 80px; }
.legal .wrap { max-width: 780px; display: grid; gap: 18px; }
.legal h1 { font-size: clamp(32px, 4.6vw, 44px); }
.legal h2 { font-size: 22px; margin-top: 18px; }
.legal p, .legal li { color: var(--text); }
.legal ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.legal .updated { color: var(--ink-2); font: 500 14px/1 var(--mono); }

/* motion: things come into view as the page loads and as it is scrolled (motion.js marks the page first; without it,
   or with reduced motion asked for, nothing is hidden). One long, soft ease-out, the way Apple's pages move. */
:root { --ease: cubic-bezier(0.22, 1, 0.36, 1); }
/* the timing applies throughout; the starting state only while an element waits (:not(.in)), so the finish always wins */
.motion [data-reveal] { transition: opacity 0.9s var(--ease), transform 1.15s var(--ease), filter 1s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.motion [data-reveal]:not(.in) { opacity: 0; transform: translate3d(0, 28px, 0) scale(0.985); }
/* the hero, on load: a short pause, then each line in turn; the headline sharpens as it rises; the card lifts */
.motion .hero [data-reveal] { transition-delay: calc(120ms + var(--i, 0) * 110ms); }
.motion .hero [data-reveal]:not(.in) { transform: translate3d(0, 18px, 0); }
.motion .hero h1[data-reveal]:not(.in) { filter: blur(8px); }
.motion .hero .spec[data-reveal] { transition-delay: 420ms; transition-duration: 1s, 1.4s, 1s; }
.motion .hero .spec[data-reveal]:not(.in) { transform: translate3d(0, 44px, 0) scale(0.95); }
@media (prefers-reduced-motion: reduce) {
  .motion [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
}
/* cards lift a little under the pointer */
.card, .steps li, .stack > div, .spec { transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease), border-color 0.3s; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card:hover, .steps li:hover, .stack > div:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.35); }
}
/* the header gains a soft shadow once the page has moved */
.top { transition: box-shadow 0.4s var(--ease); }
.top.scrolled { box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.35); }

/* the contact form, on the contact panel */
.form { display: grid; gap: 14px; width: 100%; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 6px; font: 600 14px/1.3 var(--body); color: #e6eef6; }
.form .opt { font-weight: 400; color: #9fb0c1; }
.form input, .form textarea { width: 100%; font: 400 16px/1.5 var(--body); color: #f2f2f2; background: rgba(255, 255, 255, 0.06); border: 1.5px solid rgba(255, 255, 255, 0.16); border-radius: 10px; padding: 11px 13px; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.form input:hover, .form textarea:hover { border-color: rgba(255, 255, 255, 0.28); }
/* browsers paint autofilled fields light: keep them on the panel's dark */
.form input:-webkit-autofill { -webkit-text-fill-color: #f2f2f2; box-shadow: 0 0 0 40px #2a2f35 inset; caret-color: #f2f2f2; }
.form textarea { resize: vertical; min-height: 120px; }
.form input:focus, .form textarea:focus { outline: none; background: rgba(255, 255, 255, 0.09); border-color: var(--orange-bright); box-shadow: 0 0 0 3px rgba(239, 140, 16, 0.28); }
.form [aria-invalid="true"] { border-color: #ff8a7a; }
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .send { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form .status { margin: 0; font-size: 15px; color: #c4d3e2; min-height: 1.4em; }
.form .status.good { color: #8fe0a8; }
.form .status.bad { color: #ffb4a8; }
.form button[disabled] { opacity: 0.6; cursor: progress; }
.contact { align-items: start; }
