/* ============================================================
   David Strömbom — CV / Portfolio
   Design system: deep midnight blue · developer feel
   ============================================================ */

:root {
  --bg-900: #060a18;
  --bg-850: #0a1024;
  --bg-800: #0d1430;
  --bg-750: #101840;
  --bg-700: #131c44;
  --card: rgba(18, 27, 64, 0.55);
  --card-solid: #0e1635;
  --line: rgba(120, 150, 255, 0.14);
  --line-soft: rgba(120, 150, 255, 0.08);
  --line-strong: rgba(120, 150, 255, 0.28);

  --blue: #3b6ef5;
  --blue-bright: #5b8bff;
  --blue-soft: #8fb0ff;
  --cyan: #57c7ff;
  --green: #34d399;

  --text: #eaeefb;
  --text-2: #c6cdec;
  --muted: #97a3c8;
  --muted-2: #6b769b;

  --display: 'Space Grotesk', sans-serif;
  --body: 'Manrope', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 64px);
  --r: 16px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

::selection { background: rgba(59, 110, 245, 0.4); color: #fff; }

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

/* ---------- layout helpers ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); width: 100%; }
.section { position: relative; padding-block: clamp(80px, 12vh, 140px); }
.section--tight { padding-block: clamp(60px, 9vh, 100px); }

.eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--cyan);
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px;
}
.eyebrow::before { content: ''; width: 30px; height: 1px; background: var(--cyan); opacity: 0.7; }

.section-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(30px, 4.6vw, 50px); line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.section-title em { font-style: normal; color: var(--blue-bright); }
.section-lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 60ch; margin: 0; }

.section-bg-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 78% 70% at 50% 42%, #000 38%, transparent 96%);
}
.glow {
  position: absolute; border-radius: 50%; filter: blur(90px);
  pointer-events: none; z-index: 0;
}

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }
.reveal[data-d="5"] { transition-delay: .40s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
@media print {
  .reveal, .tl-item { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background .4s var(--ease), border-color .4s var(--ease), padding .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 10, 24, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
  padding-block: 13px;
}
.nav-brand {
  font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 11px; white-space: nowrap;
}
.nav-brand .mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), #1e3a8a);
  font-family: var(--mono); font-weight: 600; font-size: 14px; color: #fff;
  box-shadow: 0 6px 18px -6px rgba(59, 110, 245, 0.7);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 14.5px; font-weight: 600; color: var(--muted);
  padding: 9px 14px; border-radius: 9px; transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--text); background: rgba(120, 150, 255, 0.08); }
.nav-cta {
  font-family: var(--body); font-weight: 700; font-size: 14.5px;
  background: var(--blue); color: #fff !important; padding: 10px 18px !important;
  border-radius: 9px; box-shadow: 0 8px 22px -8px rgba(59, 110, 245, 0.7);
  display: inline-flex; align-items: center; gap: 8px; transition: transform .25s, box-shadow .25s;
}
.nav-cta:hover { transform: translateY(-2px); background: var(--blue) !important; box-shadow: 0 14px 30px -8px rgba(59, 110, 245, 0.8); }
.nav-burger { display: none; background: none; border: 1px solid var(--line); border-radius: 9px; width: 42px; height: 42px; cursor: pointer; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav-burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

@media (max-width: 880px) {
  .nav-links { position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw); flex-direction: column; align-items: stretch;
    background: rgba(10, 16, 36, 0.96); backdrop-filter: blur(18px); border-left: 1px solid var(--line);
    padding: 96px 22px 22px; transform: translateX(110%); transition: transform .45s var(--ease); gap: 4px; }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 14px 16px; font-size: 16px; }
  .nav-cta { justify-content: center; margin-top: 8px; }
  .nav-burger { display: flex; z-index: 101; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { font-family: var(--body); font-weight: 700; font-size: 15.5px; border-radius: 11px; white-space: nowrap;
  padding: 15px 26px; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 10px;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s, border-color .25s; }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 12px 32px -10px rgba(59, 110, 245, 0.7); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 20px 42px -12px rgba(59, 110, 245, 0.85); }
.btn-ghost { background: rgba(120, 150, 255, 0.05); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--line-strong); background: rgba(120, 150, 255, 0.1); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; padding-block: 104px 56px; }
.hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 75% at 55% 35%, #000 35%, transparent 100%);
  will-change: transform;
}
.grid-pulse {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 75% at 55% 35%, #000 30%, transparent 96%);
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 55% 35%, #000 30%, transparent 96%);
  will-change: transform;
}
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; width: 100%; }
.hero-name { font-family: var(--display); font-weight: 700; font-size: clamp(48px, 8vw, 88px); line-height: 0.98; letter-spacing: -0.025em; margin: 16px 0 0; }
.hero-name em { font-style: normal; color: var(--blue-bright); }
.hero-role { font-size: clamp(17px, 2vw, 21px); color: var(--muted); margin: 18px 0 0; max-width: 30ch; line-height: 1.55; }
.hero-role strong { color: var(--text-2); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 32px; max-width: 520px; }
.chip {
  font-family: var(--mono); font-size: 12.5px; color: var(--blue-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
  background: rgba(59, 110, 245, 0.06); white-space: nowrap; transition: border-color .25s, color .25s, transform .25s;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-2px); }

.hero-visual { position: relative; display: flex; align-items: center; justify-content: center; min-height: 480px; }
.orbit { position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.orbit.dashed { border-style: dashed; }
@media (prefers-reduced-motion: no-preference) {
  .orbit.spin { animation: spin 50s linear infinite; }
  .orbit.spin-rev { animation: spin 70s linear infinite reverse; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-photo {
  width: clamp(280px, 32vw, 380px); aspect-ratio: 360 / 450; border-radius: 20px;
  border: 1px solid var(--line-strong); overflow: hidden; position: relative; z-index: 3;
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(91, 139, 255, 0.08);
  background:
    repeating-linear-gradient(135deg, rgba(91,139,255,0.10) 0 11px, rgba(91,139,255,0.025) 11px 22px),
    var(--bg-800);
}
.hero-photo image-slot { width: 100%; height: 100%; }
.hero-badge {
  position: absolute; z-index: 4; font-family: var(--mono); font-size: 12.5px; color: var(--text);
  background: rgba(10, 16, 36, 0.82); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 11px 15px; backdrop-filter: blur(6px); display: flex; align-items: center; gap: 9px;
  box-shadow: 0 16px 36px -16px rgba(0,0,0,0.8);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.hero-badge.tl { top: 12%; left: -4%; }
.hero-badge.br { bottom: 10%; right: -2%; }
@media (prefers-reduced-motion: no-preference) {
  .hero-badge.tl { animation: float 7s ease-in-out infinite; }
  .hero-badge.br { animation: float 8s ease-in-out infinite .5s; }
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.hero-stats { display: flex; gap: clamp(26px, 4vw, 52px); margin-top: 34px; flex-wrap: wrap; }
.stat .n { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4vw, 40px); line-height: 1; color: var(--text); }
.stat .n em { font-style: normal; color: var(--blue-bright); }
.stat .l { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 9px; }

.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 3;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2);
  display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-hint .line { width: 1px; height: 40px; background: linear-gradient(var(--cyan), transparent); }
@media (prefers-reduced-motion: no-preference) { .scroll-hint .line { animation: drop 2s ease-in-out infinite; transform-origin: top; } }
@keyframes drop { 0% { transform: scaleY(0); opacity: 0; } 40% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { min-height: 420px; order: -1; }
  .hero-role { max-width: 100%; }
  .scroll-hint { display: none; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.about-body p { font-size: clamp(16px, 1.7vw, 19px); color: var(--text-2); margin: 0 0 22px; }
.about-body p:last-child { margin-bottom: 0; }
.about-body strong { color: #fff; font-weight: 700; }
.pull-quote {
  font-family: var(--display); font-weight: 500; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.4;
  color: var(--text); border-left: 2px solid var(--blue); padding-left: 24px; margin: 0 0 32px;
}
.about-facts { display: grid; gap: 14px; }
.fact { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: border-color .3s, transform .3s; }
.fact:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.fact .ic { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: rgba(59, 110, 245, 0.12); color: var(--blue-soft); }
.fact .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.fact .v { font-weight: 700; color: var(--text); margin-top: 3px; font-size: 15.5px; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; gap: 44px; } }

/* ============================================================
   EXPERIENCE TIMELINE
   ============================================================ */
.timeline { position: relative; margin-top: 56px; padding-left: 38px; }
.timeline-rail { position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); overflow: hidden; }
.timeline-rail::after { content: ''; position: absolute; inset: 0; background: linear-gradient(var(--cyan), var(--blue)); transform: scaleY(var(--progress, 0)); transform-origin: top; transition: transform .1s linear; }
.tl-item { position: relative; padding-bottom: 52px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -38px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-900); border: 2px solid var(--line-strong); transition: border-color .4s, box-shadow .4s, background .4s; }
.tl-item.in .tl-dot { border-color: var(--cyan); background: var(--blue); box-shadow: 0 0 0 5px rgba(59, 110, 245, 0.16), 0 0 18px rgba(87, 199, 255, 0.5); }
.tl-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 26px 28px; transition: border-color .35s, transform .35s, background .35s; }
.tl-card:hover { border-color: var(--line-strong); transform: translateX(5px); background: rgba(20, 30, 70, 0.6); }
.tl-head { display: block; }
.tl-role { font-family: var(--display); font-weight: 700; font-size: clamp(19px, 2.3vw, 24px); line-height: 1.25; color: var(--text); }
.tl-company { color: var(--blue-bright); }
.tl-meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted-2); display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 9px; }
.tl-meta span { white-space: nowrap; }
.tl-meta .now { color: var(--green); }
.tl-desc { color: var(--muted); margin: 16px 0 0; font-size: 15.5px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tl-tags .chip { font-size: 11.5px; padding: 5px 11px; }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 52px; }
.skill-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 28px; transition: border-color .35s, transform .35s; position: relative; overflow: hidden; }
.skill-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--blue), transparent); opacity: 0; transition: opacity .4s; }
.skill-card:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.skill-card:hover::before { opacity: 1; }
.skill-card h3 { font-family: var(--display); font-weight: 600; font-size: 19px; margin: 0 0 6px; display: flex; align-items: center; gap: 12px; }
.skill-card h3 .num { font-family: var(--mono); font-size: 12px; color: var(--cyan); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; }
.skill-card .cat { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); letter-spacing: 0.06em; margin-bottom: 20px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { .skills-grid { grid-template-columns: 1fr; } }

.lang-row { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.lang { display: flex; align-items: center; gap: 14px; }
.lang .name { font-weight: 700; font-size: 16px; }
.lang .lvl { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }
.lang .bars { display: flex; gap: 4px; }
.lang .bars i { width: 8px; height: 18px; border-radius: 2px; background: var(--line); }
.lang .bars i.on { background: var(--blue-bright); }

/* ============================================================
   HIGHLIGHTS
   ============================================================ */
.hl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 54px; }
.hl-card { position: relative; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(160deg, rgba(20, 30, 70, 0.55), rgba(10, 16, 36, 0.5)); padding: 34px; overflow: hidden; transition: border-color .35s, transform .35s; }
.hl-card:hover { border-color: var(--line-strong); transform: translateY(-5px); }
.hl-card .hl-glow { position: absolute; width: 220px; height: 220px; border-radius: 50%; filter: blur(70px); background: var(--blue); opacity: 0.16; top: -60px; right: -60px; }
.hl-num { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 5.5vw, 60px); line-height: 1; color: var(--blue-bright); position: relative; }
.hl-num .unit { font-size: 0.5em; color: var(--cyan); margin-left: 4px; }
.hl-card h3 { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 18px 0 10px; position: relative; }
.hl-card p { color: var(--muted); margin: 0; font-size: 15.5px; position: relative; }
@media (max-width: 760px) { .hl-grid { grid-template-columns: 1fr; } }

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-list { display: grid; gap: 16px; margin-top: 52px; }
.edu { display: grid; grid-template-columns: 150px 1fr; gap: 28px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); align-items: center; transition: border-color .3s, transform .3s; }
.edu:hover { border-color: var(--line-strong); transform: translateX(5px); }
.edu .yr { font-family: var(--mono); font-size: 13px; color: var(--cyan); letter-spacing: 0.05em; }
.edu .deg { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--text); }
.edu .inst { color: var(--muted); font-size: 14.5px; margin-top: 3px; }
@media (max-width: 620px) { .edu { grid-template-columns: 1fr; gap: 8px; } }

/* ============================================================
   PERSONAL
   ============================================================ */
.personal { position: relative; }
.personal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 50px; }
.p-card { border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px; background: var(--card); transition: border-color .3s, transform .3s; }
.p-card:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.p-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(59, 110, 245, 0.12); color: var(--blue-soft); margin-bottom: 16px; }
.p-card h4 { font-family: var(--display); font-weight: 600; font-size: 17px; margin: 0 0 6px; }
.p-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact { position: relative; overflow: hidden; }
.contact-card {
  position: relative; border: 1px solid var(--line-strong); border-radius: 26px; overflow: hidden;
  background: linear-gradient(155deg, rgba(20, 32, 78, 0.7), rgba(8, 12, 28, 0.7));
  padding: clamp(40px, 6vw, 72px); text-align: center;
}
.contact-card .glow { width: 420px; height: 420px; background: var(--blue); opacity: 0.22; top: -160px; left: 50%; transform: translateX(-50%); }
.contact h2 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 52px); letter-spacing: -0.02em; margin: 0 0 18px; position: relative; }
.contact p { font-size: clamp(16px, 1.8vw, 19px); color: var(--muted); max-width: 50ch; margin: 0 auto 36px; position: relative; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; position: relative; }
.contact-meta { display: flex; flex-wrap: wrap; gap: 14px 36px; justify-content: center; margin-top: 40px; position: relative; }
.contact-meta a, .contact-meta span { font-family: var(--mono); font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 9px; transition: color .25s; }
.contact-meta a:hover { color: var(--cyan); }
.contact-meta .ic { color: var(--blue-soft); }

.footer { border-top: 1px solid var(--line); padding: 32px var(--pad); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer .brand { font-family: var(--display); font-weight: 700; }
.footer .copy { font-family: var(--mono); font-size: 12.5px; color: var(--muted-2); }
.footer .top { font-family: var(--mono); font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; transition: color .25s; }
.footer .top:hover { color: var(--cyan); }

/* svg icon sizing */
.ic svg, .contact-meta svg, .tl svg { width: 20px; height: 20px; }
svg { stroke-width: 1.7; }
