/* ==========================================================================
   samuelbauer.at — "Keynote", second iteration (2026-11-09)
   Same structure and content as the first version, less Apple-like:
   Bricolage Grotesque headings + Hanken Grotesk text, left-aligned hero,
   flat bordered tiles. Colours stay neutral; the racing green
   is a subtle accent only. All tokens and rules: DESIGN.md.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ---------- Tokens (DESIGN.md §5) ----------
   Neutral greys everywhere. The racing green (Audi São Paulo livery, ~#1c2c24)
   is a subtle accent only: primary button, "Live" status, logo mark, focus ring.
   No other colour competes with it (markers and "in progress" are neutral). */
:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --chip: #f2f2f4;
  --line: #e5e5ea;
  --line-strong: #c7c7cc;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --green: #1c2c24;          /* accent: primary button, logo mark */
  --green-hover: #2b3f35;
  --gold: #c7c7cc;           /* (name kept) neutral marker colour for bullets */
  --link: #1d1d1f;
  --live: #2e6b50;           /* accent: "Live" / "In Betrieb" */
  --wip: #6e6e73;            /* neutral: "In Arbeit" / "Laufend" */
  --on-green: #f5f5f7;
  --inverse: #1d1d1f;        /* near-black tile (Spawn Elytra) */
  --on-inverse: #f5f5f7;
  --on-inverse-2: #a1a1a6;
  --accent-on-inverse: #8fcfae;
  --scrim: rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.07);

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --page: 1200px;
  --gutter: 24px;
  --gap: 16px;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #161617; --chip: #232325; --line: #2c2c2e; --line-strong: #48484a;
    --ink: #f5f5f7; --ink-2: #d2d2d7; --ink-3: #a1a1a6;
    --green: #2c4a3c; --green-hover: #36594a; --gold: #48484a; --inverse: #232325;
    --link: #f5f5f7; --live: #8fcfae; --wip: #a1a1a6;
    --scrim: rgba(0, 0, 0, 0.6); --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #161617; --chip: #232325; --line: #2c2c2e; --line-strong: #48484a;
  --ink: #f5f5f7; --ink-2: #d2d2d7; --ink-3: #a1a1a6;
  --green: #2c4a3c; --green-hover: #36594a; --gold: #48484a; --inverse: #232325;
  --link: #f5f5f7; --live: #8fcfae; --wip: #a1a1a6;
  --scrim: rgba(0, 0, 0, 0.6); --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sheet-links a, .legal a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; }
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green); color: var(--on-green);
  padding: 13px 20px; border-radius: 10px; border: 1px solid var(--green);
  font: 600 16px/1.1 var(--font); transition: background-color .2s, border-color .2s;
}
.btn:hover { background: var(--green-hover); border-color: var(--green-hover); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface); border-color: var(--ink-3); }
.more { font-size: 16px; font-weight: 600; }

/* ---------- Navigation (solid, sticky) ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-in { max-width: var(--page); margin: 0 auto; height: 64px; padding: 0 var(--gutter); display: flex; align-items: center; gap: 24px; font-size: 15px; }
.nav-name { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 700 18px/1 var(--display); letter-spacing: -0.02em; white-space: nowrap; }
.nav-name:hover { text-decoration: none; }
.nav-links { margin-left: auto; display: flex; gap: 28px; }
.nav-links a { color: var(--ink-2); font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-tools { display: flex; gap: 6px; align-items: center; }
.icon { width: 18px; height: 18px; fill: currentColor; flex: none; }
.nav-icon { height: 34px; width: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); }
.nav-icon:hover { color: var(--ink); background: var(--chip); }
.nav-icon .icon { width: 17px; height: 17px; }
@media (max-width: 520px) { .nav-icon { display: none; } }
.nav-lang, .nav-theme {
  height: 34px; min-width: 34px; padding: 0 9px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--ink-2);
  font: 600 12px/1 var(--font); cursor: pointer;
}
.nav-lang:hover, .nav-theme:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.nav-theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-theme .i-sun { display: none; }
:root[data-theme="dark"] .nav-theme .i-sun { display: block; }
:root[data-theme="dark"] .nav-theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav-theme .i-sun { display: block; }
  :root:not([data-theme="light"]) .nav-theme .i-moon { display: none; }
}
@media (max-width: 600px) { .nav-links { gap: 14px; font-size: 14px; } .nav-in { gap: 12px; } .nav-name { font-size: 16px; } }
@media (max-width: 480px) { .nav-links a:first-child { display: none; } }
@media (max-width: 400px) { .nav-links { display: none; } .nav-tools { margin-left: auto; } }

/* ---------- Hero: name left-aligned ---------- */
.hero { padding: clamp(64px, 10vw, 120px) 0 clamp(56px, 8vw, 96px); }
.hero-in { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }
.hero-name { font: 700 clamp(60px, 10vw, 128px)/0.92 var(--display); letter-spacing: -0.045em; }
.hero-facts { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: clamp(18px, 2vw, 22px); font-weight: 500; color: var(--ink-3); }
.hero-facts span:not(:last-child)::after { content: "/"; margin: 0 .55em; color: var(--line-strong); }
.hero-actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-sep { width: 1px; height: 28px; background: var(--line); margin: 0 6px; }
.icon-btn { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.icon-btn:hover { border-color: var(--line-strong); text-decoration: none; }
.icon-btn .icon { width: 19px; height: 19px; }

/* ---------- Sections ---------- */
.section { padding-top: clamp(72px, 9vw, 112px); }
.section-title { display: flex; align-items: baseline; gap: 14px; font: 700 clamp(36px, 5vw, 56px)/1.02 var(--display); letter-spacing: -0.035em; margin-bottom: 28px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); transform: translateY(-0.3em); }

/* ---------- CV ---------- */
.cv-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) { .cv-grid { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 32px; }
@media (max-width: 640px) { .card { padding: 24px; } }
.card-title { font: 700 24px/1.15 var(--display); letter-spacing: -0.02em; margin-bottom: 20px; }
.cv-list { display: grid; gap: 0; }
.cv-list li { padding: 16px 0; border-top: 1px solid var(--line); }
.cv-list li:first-child { border-top: 0; padding-top: 0; }
.cv-when { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); }
.cv-what { margin-top: 3px; font-size: 18px; line-height: 1.3; font-weight: 700; }
.cv-detail { margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }

/* ---------- Project tiles ---------- */
.tiles { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
.tile {
  /* the whole tile is a button that opens the project sheet */
  appearance: none; margin: 0; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 30px;
  min-height: 290px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.tile:active { transform: translateY(0); }
@media (max-width: 640px) { .tile { padding: 24px; min-height: 0; } }
.tile--large { grid-column: span 2; min-height: 360px; }
@media (max-width: 640px) { .tile--large { grid-column: auto; } .tile--large, .tile--inverse { min-height: 0; } }
.tile--inverse { background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse); min-height: 360px; }
.tile-top { display: flex; flex-direction: column; gap: 10px; }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tile-kind { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.tile--inverse .tile-kind { color: var(--on-inverse-2); }
.pill { flex: none; font-size: 12px; font-weight: 700; line-height: 1; padding: 6px 10px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.pill--live { background: color-mix(in srgb, var(--live) 12%, var(--surface)); color: var(--live); }
.tile--inverse .pill { background: rgba(255, 255, 255, 0.1); color: var(--on-inverse); }
.tile--inverse .pill--live { background: rgba(143, 207, 174, 0.16); color: var(--accent-on-inverse); }
.tile-name { font: 700 26px/1.1 var(--display); letter-spacing: -0.025em; }
.tile--large .tile-name, .tile--inverse .tile-name { font-size: 34px; }
.tile-line { font-size: 16px; line-height: 1.5; color: var(--ink-3); max-width: 600px; }
.tile--inverse .tile-line { color: var(--on-inverse-2); }
.tile-highlights { margin-top: 8px; display: grid; gap: 8px; max-width: 760px; }
.tile-highlights span { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.tile-highlights span::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.tile-stat { margin-top: 18px; display: flex; flex-direction: column; }
.tile-stat span:first-child { font: 700 clamp(52px, 6vw, 72px)/1 var(--display); letter-spacing: -0.05em; color: var(--on-inverse); }
.tile-stat-label { margin-top: 6px; font-size: 15px; color: var(--on-inverse-2); }
.tile-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.tile-stack { font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.tile--inverse .tile-stack { color: var(--on-inverse-2); }
.tile-arrow { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 16px; transition: background-color .25s, border-color .25s, color .25s; }
.tile--inverse .tile-arrow { border-color: #48484a; }
.tile:hover .tile-arrow { background: var(--green); border-color: var(--green); color: var(--on-green); }
.sheet-highlights { margin-top: 18px; display: grid; gap: 10px; }
.sheet-highlights li { position: relative; padding-left: 18px; color: var(--ink-2); line-height: 1.5; }
.sheet-highlights li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }

.status { font-weight: 700; }
.status--live { color: var(--live); }
.status--wip { color: var(--wip); }
.status--muted { color: var(--ink-3); }

/* ---------- Project sheet (native <dialog>) ---------- */
.sheet {
  width: min(720px, calc(100vw - 32px)); max-height: min(86vh, 900px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}
.sheet::backdrop { background: var(--scrim); }
.sheet-in { position: relative; padding: 44px 44px 40px; }
@media (max-width: 640px) { .sheet-in { padding: 34px 22px 30px; } }
.sheet-close-form { position: absolute; top: 14px; right: 14px; }
.sheet-close {
  width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.sheet-close:hover { border-color: var(--line-strong); }
.sheet-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet-kicker { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; font-weight: 600; color: var(--ink-3); padding-right: 44px; }
.sheet-title { margin-top: 10px; font: 700 clamp(32px, 5vw, 44px)/1.05 var(--display); letter-spacing: -0.035em; }
.sheet-line { margin-top: 10px; font-size: 20px; line-height: 1.4; font-weight: 500; }
.sheet-stat { margin-top: 18px; font-size: 16px; color: var(--ink-3); }
.sheet-stat span { font: 700 40px/1 var(--display); letter-spacing: -0.04em; color: var(--ink); }
.sheet-body { margin-top: 18px; color: var(--ink-2); line-height: 1.6; }
.sheet-facts { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.sheet-facts dt { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 14px; padding: 5px 11px; border-radius: 6px; background: var(--chip); }
.sheet-links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px 24px; }

@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: sheet-in .28s var(--ease); }
  .sheet[open]::backdrop { animation: fade-in .28s var(--ease); }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}

/* ---------- Contact (heading left, icon rows right) ---------- */
.contact { padding-bottom: clamp(72px, 9vw, 112px); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; border-top: 1px solid var(--ink); padding-top: 32px; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.contact-title { font: 700 clamp(48px, 6vw, 72px)/1 var(--display); letter-spacing: -0.045em; }
.contact-line { margin-top: 12px; font-size: 19px; color: var(--ink-3); }
.contact-list { display: flex; flex-direction: column; }
.contact-row { display: flex; align-items: center; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
.contact-row:hover { text-decoration: none; }
.contact-row .icon { width: 20px; height: 20px; }
.contact-arrow { margin-left: auto; color: var(--ink-3); transition: transform .25s var(--ease); }
.contact-row:hover .contact-arrow { transform: translateX(4px); color: var(--ink); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.foot-in { max-width: var(--page); margin: 0 auto; padding: 22px var(--gutter) 36px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--ink-2); }
.foot-sites { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-sites a { color: var(--ink-3); }
.foot-sites a:hover { color: var(--ink); }

/* ---------- Legal page ---------- */
.legal { max-width: 780px; margin: 0 auto; padding: clamp(56px, 9vw, 104px) var(--gutter) 96px; }
.legal h1 { font: 700 clamp(40px, 6vw, 56px)/1.05 var(--display); letter-spacing: -0.035em; }
.legal-card { margin-top: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 32px; display: grid; gap: 14px; }
.legal-card dt { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.legal-card dd { font-size: 18px; font-weight: 600; }
.legal h2 { margin: 40px 0 10px; font: 700 24px/1.2 var(--display); letter-spacing: -0.02em; }
.legal p { color: var(--ink-2); }
.legal p + p { margin-top: 10px; }
.legal .small { margin-top: 40px; font-size: 12px; color: var(--ink-3); }

/* ---------- Motion (DESIGN.md §8). JS adds .motion to <html>; without it nothing is hidden. ---------- */
@media (prefers-reduced-motion: no-preference) {
  .motion [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0ms); }
  .motion [data-reveal].is-in { opacity: 1; transform: none; }
  .motion .tile[data-reveal].is-in { transition: opacity .6s var(--ease) var(--d, 0ms), transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease); }
  .motion .tile[data-reveal].is-in:hover { transition-delay: 0ms; }
  [data-intro] { animation: intro .8s var(--ease) both; }
  [data-intro="1"] { animation-delay: .1s; }
  [data-intro="2"] { animation-delay: .2s; }
  @keyframes intro { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
