/* ==========================================================================
   Yannis Thomas — Portfolio
   Shared styles (Swiss minimal grid + warm accent)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Light theme (default) */
  --bg: #f4f1ec;
  --bg-elev: #ffffff;
  --bg-soft: #ece8e1;
  --ink: #1a1a1a;
  --ink-soft: #5b5b58;
  --ink-mute: #8a8a85;
  --line: rgba(26, 26, 26, 0.12);
  --line-strong: rgba(26, 26, 26, 0.22);
  --accent: #ff5b1f;       /* cyclone orange */
  --accent-2: #ffb84d;     /* sunshine */
  --accent-3: #2a6bff;     /* electric blue */
  --noise-opacity: 0.035;

  /* Static */
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 24px;

  --max: 1440px;
  --pad: clamp(20px, 4vw, 56px);
}

[data-theme="dark"] {
  --bg: #0e0e10;
  --bg-elev: #161618;
  --bg-soft: #1d1d20;
  --ink: #f4f1ec;
  --ink-soft: #b9b9b3;
  --ink-mute: #7a7a75;
  --line: rgba(244, 241, 236, 0.12);
  --line-strong: rgba(244, 241, 236, 0.22);
  --accent: #ff7a3d;
  --accent-2: #ffc672;
  --accent-3: #6e9bff;
  --noise-opacity: 0.05;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  transition: background 320ms ease, color 320ms ease;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/></svg>");
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ==========================================================================
   Layout helpers
   ========================================================================== */

.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--ink-mute);
  display: inline-block;
}

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  font-style: italic;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-brand .mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.nav-brand .mark::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1.5px solid var(--bg);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: spin 6s linear infinite;
}
.nav-brand .mark::after {
  content: '';
  position: absolute;
  inset: 11px;
  background: var(--bg);
  border-radius: 50%;
}
.nav-brand .name { font-size: 15px; }
.nav-brand .handle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  border-radius: 999px;
  position: relative;
  transition: background 200ms ease, color 200ms ease;
  color: var(--ink-soft);
}
.nav-links a:hover { color: var(--ink); background: var(--bg-soft); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.nav-links a .num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
}

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 200ms ease, transform 200ms ease;
}
.theme-toggle:hover { border-color: var(--line-strong); transform: rotate(20deg); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.nav-burger { display: none; }

@media (max-width: 820px) {
  html:not([data-theme="dark"]) .nav {
    background: white;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-links {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--pad) 24px;
    gap: 0;
    transform: translateY(calc(-100% - 64px));
    transition: transform 320ms ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a {
    padding: 14px 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }
  .nav-burger {
    display: inline-flex;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
  }
  .nav-burger span {
    width: 14px; height: 1.5px; background: var(--ink);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  margin-top: 120px;
  border-top: 1px solid var(--line);
  padding: 56px var(--pad) 40px;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-mark {
  font-family: var(--serif);
  font-size: 56px;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.footer-mark span { color: var(--accent); }
.footer h5 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 16px;
  font-weight: 500;
}
.footer ul { list-style: none; }
.footer ul li { padding: 6px 0; font-size: 14px; color: var(--ink-soft); }
.footer ul a:hover { color: var(--accent); }
.footer-bottom {
  max-width: var(--max);
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}
.footer-bottom .pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-bottom .pulse::before {
  content: '';
  width: 8px; height: 8px;
  background: #2dd478;
  border-radius: 50%;
  box-shadow: 0 0 0 0 #2dd478;
  animation: pulse 2s ease-out infinite;
}

@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-mark { grid-column: 1 / -1; font-size: 44px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ==========================================================================
   Page intro (used on inner pages)
   ========================================================================== */

.page-intro {
  padding: 80px var(--pad) 56px;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}
.page-intro h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.page-intro h1 em { color: var(--accent); }
.page-intro .meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}
.page-intro .meta .row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 10px;
}
.page-intro .meta .row span:last-child { color: var(--ink); }

@media (max-width: 820px) {
  .page-intro { grid-template-columns: 1fr; gap: 28px; padding: 48px var(--pad) 36px; }
}

/* ==========================================================================
   Section header
   ========================================================================== */

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  gap: 24px;
}
.sec-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.sec-head .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  white-space: nowrap;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn .arrow {
  display: inline-block;
  transition: transform 200ms ease;
}
.btn:hover .arrow { transform: translate(3px, -3px); }

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 120, 0.6); }
  100% { box-shadow: 0 0 0 12px rgba(45, 212, 120, 0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 700ms ease both; }
.rise-2 { animation: rise 700ms ease 100ms both; }
.rise-3 { animation: rise 700ms ease 200ms both; }
.rise-4 { animation: rise 700ms ease 300ms both; }

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms ease, transform 700ms ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }
