/* TimInTech projects page
   Theme: near-monochrome, one accent (amber). Light + dark via CSS variables.
   Shape scale: 4px (inputs/chips), 10px (panels), full (buttons/avatars).
   Type: Geist for text, numeral emphasis via weight, no serif. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin.woff2") format("woff2-variations"), url("/fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin.woff2") format("woff2-variations"), url("/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fbfbfa;
  --bg-elev: #ffffff;
  --bg-sunken: #f2f2ef;
  --line: #e3e3dd;
  --line-strong: #cfcfc7;
  --text: #1a1a18;
  --text-soft: #55554f;
  --text-faint: #86867d;
  --accent: #a4530f;
  --accent-soft: #f6ecdf;
  --accent-ring: rgba(164, 83, 15, 0.32);
  --focus: #1a1a18;
  --shadow: 0 1px 2px rgba(26, 26, 24, 0.05), 0 8px 24px -12px rgba(26, 26, 24, 0.18);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101110;
    --bg-elev: #17181a;
    --bg-sunken: #0b0c0b;
    --line: #26272a;
    --line-strong: #35373b;
    --text: #ecece7;
    --text-soft: #a3a39b;
    --text-faint: #74746d;
    --accent: #e2a066;
    --accent-soft: #2a2118;
    --accent-ring: rgba(226, 160, 102, 0.3);
    --focus: #ecece7;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

html[data-theme="light"] {
  --bg: #fbfbfa;
  --bg-elev: #ffffff;
  --bg-sunken: #f2f2ef;
  --line: #e3e3dd;
  --line-strong: #cfcfc7;
  --text: #1a1a18;
  --text-soft: #55554f;
  --text-faint: #86867d;
  --accent: #a4530f;
  --accent-soft: #f6ecdf;
  --accent-ring: rgba(164, 83, 15, 0.32);
  --focus: #1a1a18;
  --shadow: 0 1px 2px rgba(26, 26, 24, 0.05), 0 8px 24px -12px rgba(26, 26, 24, 0.18);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #101110;
  --bg-elev: #17181a;
  --bg-sunken: #0b0c0b;
  --line: #26272a;
  --line-strong: #35373b;
  --text: #ecece7;
  --text-soft: #a3a39b;
  --text-faint: #74746d;
  --accent: #e2a066;
  --accent-soft: #2a2118;
  --accent-ring: rgba(226, 160, 102, 0.3);
  --focus: #ecece7;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--bg-elev); color: var(--text);
  padding: 10px 16px; border: 1px solid var(--line-strong); z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-mark { width: 18px; height: 18px; color: var(--accent); flex: none; }

.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 28px); font-size: 14px; }
.site-nav a { color: var(--text-soft); transition: color .15s ease; }
.site-nav a:hover { color: var(--text); }

.theme-toggle {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  background: transparent; color: var(--text-soft);
  border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .icon-sun { display: none; }
  html:not([data-theme]) .icon-moon { display: block; }
}

/* ---------- layout ---------- */

main { display: block; }

section, .site-footer { padding-inline: clamp(16px, 4vw, 40px); }
.hero, .feature, .projects, .closing { max-width: 1160px; margin-inline: auto; }

h1, h2 { letter-spacing: -0.025em; line-height: 1.1; margin: 0; font-weight: 600; }

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(48px, 7vw, 84px);
  padding-bottom: clamp(48px, 7vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.75fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
}

.eyebrow {
  margin: 0 0 18px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.35rem);
  max-width: 19ch;
  text-wrap: balance;
}

.lede {
  margin: 22px 0 0;
  max-width: 52ch;
  font-size: clamp(1rem, 1.35vw, 1.09rem);
  color: var(--text-soft);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 999px;
  font-size: 14px; font-weight: 550; letter-spacing: -0.005em;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #fff; }
html[data-theme="dark"] .btn-primary:hover { color: #14100c; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .btn-primary:hover { color: #14100c; }
}
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--text); background: var(--bg-sunken); }

.hero-aside {
  border-top: 1px solid var(--line);
  display: grid;
}
.stat-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.stat-num {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 1.55rem; font-weight: 500; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--text-faint); text-align: right; }

/* ---------- feature / press ---------- */

.feature {
  padding-block: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
}

.feature-head h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.feature-sub { margin: 10px 0 0; color: var(--text-soft); font-size: 1rem; max-width: 52ch; }

.feature-body {
  margin-top: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.feature-text p { margin: 0 0 14px; color: var(--text-soft); max-width: 58ch; }
.feature-text p:last-child { margin-bottom: 0; }

.feature-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 22px !important; }
.feature-links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 550; color: var(--text);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color .15s ease, color .15s ease;
}
.feature-links a:hover { color: var(--accent); border-color: var(--accent); }
.arrow { font-size: 13px; transition: transform .18s ease; }
.feature-links a:hover .arrow { transform: translateX(3px); }

.press-list { list-style: none; margin: 0; padding: 0; display: grid; }
.press-item { border-top: 1px solid var(--line); }
.press-item:last-child { border-bottom: 1px solid var(--line); }
.press-item a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  padding: 15px 2px;
  transition: background-color .15s ease;
}
.press-item a:hover { background: var(--bg-sunken); }
.press-outlet { font-weight: 550; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.press-lang {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 4px;
}
.press-note { grid-column: 1 / -1; font-size: 13.5px; color: var(--text-soft); }
.press-item a:hover .press-outlet { color: var(--accent); }

/* ---------- projects ---------- */

.projects { padding-block: clamp(48px, 6vw, 76px); border-top: 1px solid var(--line); }

.projects-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}
.projects-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.95rem); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 13px;
  padding: 6px 13px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active {
  color: var(--text);
  border-color: var(--text);
  background: var(--bg-sunken);
  font-weight: 550;
}

/* Cards sit on the page background with hairline dividers instead of boxed
   panels, so a partially filled last row leaves no dead cell. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  column-gap: clamp(20px, 3vw, 36px);
  row-gap: 0;
  border-top: 1px solid var(--line);
}

.card {
  background: transparent;
  padding: clamp(20px, 2.4vw, 26px) 0;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column;
  gap: 12px;
  min-height: 100%;
}
.card h3 { transition: color .15s ease; }
.card:hover h3 { color: var(--accent); }
.card[hidden] { display: none; }

.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-tag {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint);
}
.card-stars {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px; color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.card-stars svg { width: 13px; height: 13px; color: var(--accent); }

.card h3 { margin: 0; font-size: 1.06rem; font-weight: 600; letter-spacing: -0.015em; }
.card .subtitle { margin: -6px 0 0; font-size: 13.5px; color: var(--text-faint); }
.card p.desc { margin: 0; font-size: 14.5px; color: var(--text-soft); flex: 1; }

.card-links {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 2px;
  font-size: 13.5px; font-weight: 550;
}
.card-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.card-links a:hover { color: var(--accent); }
.card-links a svg { width: 13px; height: 13px; opacity: .7; }

.empty-state { margin: 24px 0 0; color: var(--text-faint); font-size: 14px; }
.noscript { color: var(--text-soft); font-size: 14px; }

/* skeleton */
.card-skeleton { background: transparent; padding: 26px 0; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.skel-bar { height: 10px; border-radius: 3px; background: var(--line); animation: pulse 1.4s ease-in-out infinite; }
.skel-bar.w40 { width: 40%; }
.skel-bar.w80 { width: 80%; }
.skel-bar.w60 { width: 60%; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- closing + footer ---------- */

.closing {
  padding-block: clamp(52px, 6vw, 84px);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  justify-items: start;
}
.closing h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); max-width: 26ch; text-wrap: balance; }
.closing p { margin: 0; color: var(--text-soft); max-width: 56ch; }
.closing .btn { margin-top: 8px; }

.site-footer { border-top: 1px solid var(--line); padding-block: 26px; }
.footer-inner {
  max-width: 1160px; margin-inline: auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: 13.5px; color: var(--text-faint);
}
.footer-links { display: flex; gap: 18px; }
.footer-links a:hover { color: var(--text); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-aside { margin-top: 8px; }
  .feature-body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-nav a { display: none; }
  .site-nav a:last-of-type { display: inline; }
  h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); max-width: 100%; }
  .project-grid { grid-template-columns: 1fr; column-gap: 0; }
  .projects-head { align-items: flex-start; }
  .stat-num { font-size: 1.3rem; }
}

@media (max-width: 400px) {
  .stat-row { padding: 11px 0; }
  .btn { height: 42px; padding: 0 16px; font-size: 13.5px; }
}
