/* ==========================================================================
   Eirik AI — site styles
   Tokens at the top make it easy to re-theme the whole site.
   ========================================================================== */

:root {
  --bg: #07090d;
  --bg-elev: #0d1118;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eaeef6;
  --muted: #8d97ab;
  --accent-a: #5eead4; /* teal */
  --accent-b: #818cf8; /* indigo */
  --gradient: linear-gradient(110deg, var(--accent-a), var(--accent-b));
  --radius: 16px;
  --maxw: 1120px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background: soft glows + faint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(94, 234, 212, 0.13), transparent 60%),
    radial-gradient(800px 500px at 90% 0%, rgba(129, 140, 248, 0.14), transparent 60%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 600;
}

p { margin: 0; }

.container { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }

.grad-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { top: 16px; }

:focus-visible { outline: 2px solid var(--accent-a); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 9, 13, 0.65);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  display: inline-flex; align-items: center; gap: 10px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--gradient);
  display: grid; place-items: center;
  color: #06080c; font-size: 0.95rem; font-weight: 700;
}

.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-size: 0.95rem; font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-hover); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-hover); }
.nav-links a.nav-cta { color: #06080c; background: var(--gradient); font-weight: 600; margin-left: 6px; }
.nav-links a.nav-cta:hover { filter: brightness(1.1); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--text); width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  margin: auto; position: relative; transition: transform .25s, top .25s, background .25s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px 24px 20px;
    background: rgba(7, 9, 13, 0.97);
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-open .nav-links { display: flex; }
  .nav-links a { padding: 14px 16px; font-size: 1.05rem; }
  .nav-links a.nav-cta { margin: 6px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s, filter .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gradient); color: #06080c; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--surface-hover); border-color: rgba(255,255,255,.3); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Shared bits ---------- */
main { flex: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-a);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gradient); }

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-top: 16px; }
.section-head p { color: var(--muted); margin-top: 16px; }

.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 640px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: background .25s, border-color .25s, transform .25s;
}
.card:hover { background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-3px); }
.card h3 { font-size: 1.25rem; margin: 18px 0 10px; }
.card p { color: var(--muted); font-size: 0.98rem; }

.icon-box {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: var(--accent-a);
}
.icon-box svg { width: 22px; height: 22px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Home hero ---------- */
.hero { padding: clamp(80px, 14vw, 170px) 0 clamp(70px, 10vw, 120px); text-align: left; }
.hero h1 {
  font-size: clamp(3.4rem, 11vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  margin: 26px 0 0;
  line-height: 0.95;
}
.hero .tagline {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  color: var(--text);
  margin-top: 28px;
  letter-spacing: -0.01em;
  max-width: 760px;
  line-height: 1.3;
}
.hero .tagline em { font-style: normal; color: var(--muted); }

.meaning {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px;
}
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.92rem; color: var(--muted);
}
.pill strong { color: var(--text); font-weight: 600; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gradient); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 44px; }

.rotator { display: inline-block; position: relative; transition: opacity .35s, transform .35s; }
.rotator.swap { opacity: 0; transform: translateY(8px); }

/* ---------- Page header (inner pages) ---------- */
.page-hero { padding: clamp(64px, 10vw, 120px) 0 clamp(24px, 4vw, 48px); }
.page-hero h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin-top: 20px; letter-spacing: -0.04em; }
.page-hero .lead { margin-top: 24px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { padding: 28px 30px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.stat .num { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.stat .label { color: var(--muted); font-size: 0.95rem; margin-top: 10px; }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.prose p { color: var(--muted); }
.prose p + p { margin-top: 18px; }
.prose strong { color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 9px 16px; border-radius: 999px; font-size: 0.92rem; font-weight: 500;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}

/* Team grid — add more .person cards here later */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.person { text-align: left; }
.avatar {
  width: 72px; height: 72px; border-radius: 20px; background: var(--gradient);
  display: grid; place-items: center; font-family: var(--font-display);
  font-size: 1.7rem; font-weight: 700; color: #06080c;
}
.person .role { color: var(--accent-a); font-size: 0.88rem; font-weight: 600; letter-spacing: .04em; margin-top: 4px; }
.person.placeholder { border-style: dashed; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; color: var(--muted); }
.person.placeholder:hover { transform: none; }

/* ---------- Projects ---------- */
.project-card { display: flex; flex-direction: column; min-height: 280px; }
.project-card .tag-row { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-card h3 { font-size: 1.5rem; margin-top: 24px; }
.project-card .full-name { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
.project-card p.desc { margin-top: 16px; }
.project-card .footer { margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.4); color: #b4bbff; background: rgba(129, 140, 248, 0.1);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.project-card.more { border-style: dashed; }
.project-card.more .tag-row { align-items: flex-start; }
.project-card.more:hover { transform: none; background: var(--surface); border-color: var(--border); }

/* ---------- Contact ---------- */
.contact-box {
  margin-top: 16px;
  padding: clamp(32px, 6vw, 64px);
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    radial-gradient(500px 220px at 0% 0%, rgba(94,234,212,.10), transparent 70%),
    radial-gradient(500px 220px at 100% 100%, rgba(129,140,248,.12), transparent 70%),
    var(--surface);
}
.contact-box p.msg { color: var(--muted); font-size: 1.15rem; max-width: 560px; }
.email-link {
  display: inline-block; margin-top: 28px;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 3rem); letter-spacing: -0.03em;
  word-break: break-word;
  transition: filter .2s;
}
.email-link:hover { filter: brightness(1.2); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center; padding: clamp(40px, 7vw, 72px) 24px; border-radius: 24px;
  border: 1px solid var(--border); background: var(--surface);
}
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cta-band p { color: var(--muted); margin: 14px auto 28px; max-width: 480px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 40px; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.footer-links a:hover { color: var(--text); }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
