/* ---------------------------------------------
   Gustav Krag-Hansen — portfolio
   Design system
--------------------------------------------- */

:root {
  --bg: #0b0e16;
  --bg-elevated: #121726;
  --surface: #171d2e;
  --surface-hover: #1d2438;
  --border: #272f45;
  --text: #eef1f8;
  --text-muted: #9aa3bd;
  --text-faint: #6b7493;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-soft: rgba(94, 234, 212, 0.12);
  --accent-2: #a78bfa;
  --danger: #f87171;
  --success: #4ade80;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --container: 1080px;
  --shadow-soft: 0 20px 50px -25px rgba(0, 0, 0, 0.6);

  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(94, 234, 212, 0.10), transparent 60%),
    radial-gradient(50rem 35rem at -10% 10%, rgba(167, 139, 250, 0.10), transparent 60%);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 14, 22, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  color: #0b0e16;
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-links a.is-active {
  color: var(--bg);
  background: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px 18px;
    display: none;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 14px;
    border-radius: 10px;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #06201c;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin-bottom: 0.4em;
}

.hero .lede {
  font-size: 1.1rem;
  max-width: 48ch;
}

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

.hero-photo-wrap {
  position: relative;
  justify-self: center;
}

.hero-photo {
  width: 260px;
  height: 260px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hero-photo-glow {
  position: absolute;
  inset: -20px;
  z-index: -1;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.35), rgba(167, 139, 250, 0.3));
  filter: blur(40px);
  border-radius: 40px;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero .lede {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-photo-wrap {
    order: -1;
  }

  .hero-photo {
    width: 180px;
    height: 180px;
  }
}

/* ---------- Sections ---------- */

section {
  padding: 64px 0;
}

.section-head {
  max-width: 60ch;
  margin-bottom: 40px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

/* ---------- Page header (inner pages) ---------- */

.page-header {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}

.page-header h1 {
  font-size: clamp(2rem, 3.4vw, 2.6rem);
}

.page-header .lede {
  max-width: 60ch;
}

/* ---------- Cards / grid ---------- */

.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  background: var(--surface-hover);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5em;
}

.card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.card-icon svg {
  width: 20px;
  height: 20px;
}

/* ---------- Badges / tags ---------- */

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge.accent {
  border-color: rgba(94, 234, 212, 0.4);
  color: var(--accent);
  background: var(--accent-soft);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-live {
  color: var(--success);
  background: rgba(74, 222, 128, 0.12);
}
.status-live::before { background: var(--success); }

.status-progress {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}
.status-progress::before { background: #fbbf24; }

.status-closed {
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
}
.status-closed::before { background: var(--text-faint); }

/* ---------- Project cards ---------- */

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease;
}

.project-card:hover {
  border-color: var(--accent);
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.project-head h3 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-link {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.project-link:hover {
  text-decoration: underline;
}

/* ---------- Timeline (education) ---------- */

.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 42px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-item.is-current::before {
  background: var(--accent);
}

.timeline-year {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.timeline-item h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.timeline-item p {
  margin: 0;
}

/* ---------- About traits ---------- */

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cert-item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.cert-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.cert-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.cert-meta {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 2px;
}

.subject-group {
  margin-bottom: 28px;
}

.subject-group:last-child {
  margin-bottom: 0;
}

.subject-group h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.trait-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.about-photo {
  width: 150px;
  height: 150px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.about-grid {
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
}

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-top {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

/* ---------- Contact page ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.contact-tile .label {
  font-size: 0.82rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.contact-tile .value {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 600;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
}

form.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.field input,
.field textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.form-note.success {
  background: rgba(74, 222, 128, 0.12);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.form-note.error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ---------- CTA band ---------- */

.cta-band {
  background: linear-gradient(135deg, var(--bg-elevated), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
}

.cta-band h2 {
  margin-bottom: 0.3em;
}

.cta-band .btn {
  margin-top: 18px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 40px;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--accent);
}
