/* Emanuel Păiuș, personal site. Plain CSS, no build step. */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f5f7f6;
  --surface: #fbfcfb;
  --surface-2: #eef2ef;
  --text: #171b19;
  --muted: #5d6764;
  --line: #d9dfdb;
  --accent: #1c7a4d;
  --accent-ink: #f4fbf7;
  --accent-soft: rgba(28, 122, 77, 0.10);
  --shadow: 0 1px 2px rgba(23, 27, 25, 0.06), 0 16px 40px -20px rgba(23, 27, 25, 0.25);
  --r: 12px;
  --nav-h: 64px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1211;
    --surface: #161a18;
    --surface-2: #1c221f;
    --text: #e6eae7;
    --muted: #98a39d;
    --line: #283029;
    --accent: #5ccb8e;
    --accent-ink: #0a1a11;
    --accent-soft: rgba(92, 203, 142, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 48px -24px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1211;
  --surface: #161a18;
  --surface-2: #1c221f;
  --text: #e6eae7;
  --muted: #98a39d;
  --line: #283029;
  --accent: #5ccb8e;
  --accent-ink: #0a1a11;
  --accent-soft: rgba(92, 203, 142, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 20px 48px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  font-feature-settings: "ss03", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.ic { width: 20px; height: 20px; fill: currentColor; flex: none; }
.ic-s { width: 14px; height: 14px; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: var(--r);
}
.skip:focus { top: 8px; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-row { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; font-size: 0.95rem; color: var(--muted); }
.nav-links a { padding: 6px 0; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--text);
  cursor: pointer; padding: 0; font: inherit;
}
.icon-btn:hover { border-color: var(--line); background: var(--surface); }
.icon-btn:active { transform: scale(0.96); }
.ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-sun { display: none; }
  :root:not([data-theme="light"]) .ic-moon { display: block; }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding-top: clamp(48px, 7vh, 88px);
  padding-bottom: clamp(56px, 8vh, 96px);
}
.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  max-width: 24ch;
}
.lede { margin-top: 22px; font-size: 1.125rem; color: var(--muted); max-width: 48ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 20px; border-radius: var(--r);
  font-weight: 500; white-space: nowrap; border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }

.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%; aspect-ratio: 40 / 21; object-fit: cover;
  border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.hero-figure figcaption { margin-top: 12px; font-size: 0.85rem; color: var(--muted); }

/* Numbers band */
.numbers-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-block: 22px; }
.num { display: flex; flex-direction: column; gap: 4px; }
.num .n { font-family: var(--mono); font-size: clamp(1.25rem, 1.8vw, 1.6rem); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.num .l { font-size: 0.85rem; color: var(--muted); max-width: 24ch; }

/* Sections */
.section { padding-block: clamp(64px, 9vh, 104px); }
.section-head { max-width: 62ch; margin-bottom: 36px; }
.section-head .sub, .footer .sub { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }
.section-head .sub a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.section-head .sub a:hover { text-decoration-color: var(--accent); }

/* Case studies */
.cases { display: flex; flex-direction: column; }
.case { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(20px, 4vw, 56px); padding: 34px 0; border-top: 1px solid var(--line); }
.case:first-child { border-top: 0; padding-top: 0; }
.case-head h3 { font-size: 1.3rem; letter-spacing: -0.02em; }
.case-meta { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.case-body { display: flex; flex-direction: column; gap: 12px; }
.case-body p { color: var(--muted); font-size: 1rem; max-width: 62ch; }
.case-body .links { margin-top: 2px; padding-top: 0; }

/* Bento */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 16px;
}
.cell {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.cell:hover { border-color: var(--muted); }
.cell-a { grid-column: span 7; grid-row: span 2; }
.cell-b, .cell-c { grid-column: span 5; }
.cell-d, .cell-e, .cell-f { grid-column: span 4; }
.cell-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.cell-a img { aspect-ratio: 16 / 11; object-position: top; }
.cell:hover img { transform: scale(1.02); }
.cell-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cell-body p { color: var(--muted); font-size: 0.95rem; }
.cell h3 a::after { content: ""; position: absolute; inset: 0; }
.cell h3 a:hover { color: var(--accent); }
.links { position: relative; z-index: 1; margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.875rem; font-weight: 500; }
.links a { display: inline-flex; align-items: center; gap: 3px; color: var(--text); }
.links a:hover { color: var(--accent); }
.cell-tint { background: linear-gradient(160deg, var(--accent-soft), transparent 65%), var(--surface); }
.cell-tint-2 { background: var(--surface-2); }
.cell-code pre {
  margin: 0; padding: 18px 22px 0; font-family: var(--mono); font-size: 0.78rem; line-height: 1.5;
  color: var(--muted); overflow: hidden; white-space: pre; border-bottom: 0;
}
.cell-code code { display: block; }

/* Mods */
.mods { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(28px, 5vw, 64px); }
.mod-col { display: flex; flex-direction: column; gap: 32px; }
.mod-group h3 { font-size: 0.95rem; color: var(--muted); font-weight: 500; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.mod {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px;
  padding: 9px 0; border-radius: 8px;
}
.mod img, .mod-ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.mod-ph { display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.mod-name { font-weight: 500; }
.mod:hover .mod-name { color: var(--accent); }
.mod-dl { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.foot-link { margin-top: 28px; font-weight: 500; }
.foot-link a { display: inline-flex; align-items: center; gap: 6px; }
.foot-link a:hover { color: var(--accent); }

/* About */
.about { display: grid; grid-template-columns: 6fr 5fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about-copy { display: flex; flex-direction: column; gap: 16px; }
.about-copy p { color: var(--muted); font-size: 1.02rem; max-width: 58ch; }
.about-copy h2 { margin-top: 6px; }
.avatar { width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--line); box-shadow: var(--shadow); }
.roles h3 { font-size: 0.95rem; color: var(--muted); font-weight: 500; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.role { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 10px 0; }
.role-when { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-top: 3px; white-space: nowrap; }
.role-what { display: flex; flex-direction: column; gap: 2px; }
.role-what strong { font-weight: 600; }
.role-what span { color: var(--muted); font-size: 0.92rem; }
.roles .foot-link { margin-top: 16px; }

/* Tools, horizontal scroll */
.tools {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 16px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
  margin-inline: -4px;
}
.tool {
  flex: 0 0 236px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.tool:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool h3 { font-size: 1rem; }
.tool p { font-size: 0.875rem; color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: clamp(64px, 9vh, 104px) 0 40px; background: var(--surface); }
.footer h2 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.03em; }
.footer .sub { max-width: 52ch; }
.footer .btn { margin-top: 26px; }
.social { list-style: none; margin: 40px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; }
.social a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.social a:hover { color: var(--text); }
.small { margin-top: 36px; font-size: 0.85rem; color: var(--muted); }
.small a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.small a:hover { text-decoration-color: var(--accent); }

/* Reveal on scroll, only when JS is present and motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
  html.js [data-reveal].in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { max-width: 18ch; }
  .numbers { grid-template-columns: repeat(2, 1fr); }
  .cell-a, .cell-b, .cell-c { grid-column: span 12; grid-row: auto; }
  .cell-d, .cell-e, .cell-f { grid-column: span 6; }
  .cell-a img { aspect-ratio: 16 / 9; }
  .mods { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .case { grid-template-columns: 1fr; gap: 14px; padding: 28px 0; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .cell-d, .cell-e, .cell-f { grid-column: span 12; }
  .bento { grid-auto-rows: auto; }
  .role { grid-template-columns: 96px 1fr; }
  .footer .btn { max-width: 100%; }
}
@media (max-width: 560px) {
  .numbers { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 420px) {
  .footer .btn { font-size: 0.92rem; padding-inline: 14px; }
}
