/* ---------- Colours and basics ---------- */
:root {
  --navy: #1f2a44;      /* main brand colour */
  --navy-2: #2d3b5e;
  --gold: #b8935a;      /* accent: use on navy backgrounds */
  --gold-dark: #8a6a3a; /* darker accent: readable on white/grey backgrounds */
  --ink: #1c1f26;       /* body text */
  --muted: #5d6475;     /* secondary text */
  --line: #e3e6ec;      /* borders */
  --bg-alt: #f6f7f9;    /* light grey section background */
  --radius: 10px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background: #fff;
}

h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; color: var(--navy); line-height: 1.25; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.15rem; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1100px, 92%); margin: 0 auto; }
.narrow { width: min(820px, 92%); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { font-family: "Source Serif 4", serif; font-weight: 700; font-size: 1.2rem; color: var(--navy); }
.nav nav a { margin-left: 1.5rem; font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.nav nav a:hover { color: var(--navy); }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: #fff; padding: 5rem 0; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 3rem; }
.hero h1 { color: #fff; font-size: 3.2rem; margin: 0.3rem 0 1rem; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.85rem; font-weight: 600; }
.lead { font-size: 1.15rem; color: #d7dbe6; max-width: 34rem; }
.hero-photo {
  width: 280px; height: 340px; object-fit: cover; flex-shrink: 0;
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  border: 4px solid rgba(255,255,255,0.12);
}

/* ---------- Buttons ---------- */
.buttons { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.btn {
  display: inline-block; padding: 0.75rem 1.4rem; border-radius: 8px;
  font-weight: 600; font-size: 0.95rem;
  border: 1.5px solid currentColor; transition: transform 0.2s, background 0.2s;
}
/* Navy text on gold keeps the look and is easy to read */
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.primary:hover { background: #c6a46d; border-color: #c6a46d; }
.btn:hover { transform: translateY(-2px); }
.hero .btn:not(.primary) { color: #fff; }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section.alt { background: var(--bg-alt); }
.section p { margin-bottom: 1rem; }
.when { color: var(--gold-dark); font-weight: 600; font-size: 0.9rem; margin-bottom: 0.2rem; }
h3 span { color: var(--muted); font-weight: 600; }
h3 span.company { color: var(--navy); }

/* ---------- Research ---------- */
.research { padding-top: 0; }
.research-card {
  background: var(--navy); color: #d7dbe6;
  border-radius: var(--radius); padding: 2rem 2.2rem;
  border-left: 5px solid var(--gold);
}
.research-label { color: var(--gold); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.5rem !important; }
.research-card h3 { color: #fff; font-size: 1.5rem; margin-bottom: 0.5rem; }
.research-sub { font-size: 1.05rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.tags li {
  font-size: 0.85rem; font-weight: 500; color: #fff;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; padding: 0.25rem 0.8rem;
}

/* ---------- Experience timeline ---------- */
.timeline { list-style: none; border-left: 2px solid var(--line); margin-left: 0.5rem; }
.timeline > li { position: relative; padding: 0 0 2.5rem 2rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -8px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--navy);
}
.timeline > li:first-child::before { background: var(--gold); border-color: var(--gold); }
.timeline ul { margin: 0.6rem 0 0 1.1rem; color: var(--muted); }
.timeline ul li { margin-bottom: 0.3rem; }

/* Several roles at one company (e.g. Wolt) */
.role { margin-top: 1rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; }
.role-head strong { color: var(--navy); }
.role-when { color: var(--muted); font-size: 0.88rem; }
.role ul { margin-top: 0.3rem; }

/* ---------- Education ---------- */
.edu { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.edu-item { border-top: 3px solid var(--navy); padding-top: 0.8rem; }
.edu-item p { color: var(--muted); font-size: 0.95rem; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.card h3 { margin-bottom: 0.5rem; }
.sub { margin: 2.2rem 0 1rem; }

.modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.module { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.module strong { display: block; color: var(--navy); }
.module span { color: var(--muted); font-size: 0.92rem; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; align-items: start; }
.plain { list-style: none; color: var(--muted); }
.plain li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: none; }
.plain li.small { font-size: 0.88rem; }

/* ---------- Contact and footer ---------- */
.contact { text-align: center; }
.contact .buttons { justify-content: center; }
.contact .btn:not(.primary) { color: var(--navy); }
.footer { background: var(--navy); color: #aab2c5; text-align: center; padding: 1.5rem 0; font-size: 0.9rem; }

/* =====================================================
   JOURNEY VERSION: dropdown, animation, company pages
   ===================================================== */

/* ---------- Page fade-in and scroll progress ---------- */
body { animation: pagein 0.5s ease both; }
@keyframes pagein { from { opacity: 0; } to { opacity: 1; } }

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 20;
  background: linear-gradient(90deg, var(--gold), #e0c28f);
  transform: scaleX(0); transform-origin: left;
}

/* ---------- Experience dropdown in the menu ---------- */
.nav nav { display: flex; align-items: center; }
.nav nav .dd { position: relative; margin-left: 1.5rem; }
.nav nav .dd-toggle { margin-left: 0; display: inline-flex; align-items: center; }
.dd-toggle::after {
  content: ""; width: 0.42em; height: 0.42em; margin-left: 0.55em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform 0.25s;
}
.dd.open .dd-toggle { color: var(--navy); }
.dd.open .dd-toggle::after { transform: rotate(225deg) translateY(-2px); }
.dd-menu {
  list-style: none; position: absolute; right: -10px; top: calc(100% + 14px);
  min-width: 270px; padding: 0.5rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(31, 42, 68, 0.18);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: none; }
.nav nav .dd-menu a {
  margin-left: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.65rem 0.85rem; border-radius: 8px; color: var(--navy); font-weight: 600;
  transition: background 0.15s, padding-left 0.2s;
}
.nav nav .dd-menu a small { color: var(--gold-dark); font-weight: 500; font-size: 0.8rem; }
.nav nav .dd-menu a:hover { background: var(--bg-alt); padding-left: 1.1rem; }

/* ---------- Hero animation ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -35%;
  background:
    radial-gradient(circle at 18% 30%, rgba(184, 147, 90, 0.30), transparent 38%),
    radial-gradient(circle at 82% 72%, rgba(96, 124, 196, 0.32), transparent 42%);
  animation: drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.08); }
}
.hero-inner { position: relative; }
.hero-text > * { animation: rise 0.8s cubic-bezier(.2, .7, .2, 1) both; }
.hero-text > :nth-child(2) { animation-delay: 0.1s; }
.hero-text > :nth-child(3) { animation-delay: 0.2s; }
.hero-text > :nth-child(4) { animation-delay: 0.3s; }
.hero-photo { animation: rise 0.9s 0.25s cubic-bezier(.2, .7, .2, 1) both, float 6s 1.2s ease-in-out infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Scroll reveal (added by script.js) ---------- */
html.js .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i, 0) * 90ms);
}
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Company cards on the home page ---------- */
.section-intro { color: var(--muted); margin-top: -0.8rem; }
.exp-grid { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.exp-card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy);
  border-radius: var(--radius); padding: 1.3rem 1.5rem;
  transition: transform 0.25s, box-shadow 0.25s, border-left-color 0.25s;
}
.exp-card.current { border-left-color: var(--gold); }
.exp-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(31, 42, 68, 0.12); border-left-color: var(--gold); }
.exp-card h3 { margin-bottom: 0.2rem; }
.exp-card p { color: var(--muted); margin: 0; font-size: 0.95rem; }
.exp-card .arrow { font-size: 1.5rem; color: var(--gold-dark); transition: transform 0.25s; }
.exp-card:hover .arrow { transform: translateX(8px); }

/* ---------- Company (journey) pages ---------- */
.journey-hero { background: var(--navy); color: #fff; padding: 4rem 0 3.5rem; position: relative; overflow: hidden; }
.journey-hero::before {
  content: ""; position: absolute; inset: -40%;
  background:
    radial-gradient(circle at 15% 40%, rgba(184, 147, 90, 0.28), transparent 38%),
    radial-gradient(circle at 85% 60%, rgba(96, 124, 196, 0.28), transparent 42%);
  animation: drift 16s ease-in-out infinite alternate; pointer-events: none;
}
.journey-hero .container { position: relative; }
.journey-hero > .container > * { animation: rise 0.8s cubic-bezier(.2, .7, .2, 1) both; }
.journey-hero > .container > :nth-child(2) { animation-delay: 0.08s; }
.journey-hero > .container > :nth-child(3) { animation-delay: 0.16s; }
.journey-hero > .container > :nth-child(4) { animation-delay: 0.24s; }
.journey-hero h1 { color: #fff; font-size: 2.8rem; margin: 0.3rem 0 0.6rem; }
.journey-hero .role-line { color: #d7dbe6; font-size: 1.1rem; }
.back { display: inline-block; color: var(--gold); font-weight: 600; font-size: 0.9rem; margin-bottom: 1.2rem; transition: transform 0.2s; }
.back:hover { transform: translateX(-4px); }

.journey { padding: 4rem 0 3rem; }
.jsection { margin-bottom: 3rem; }
.jsection h2 { font-size: 1.6rem; margin-bottom: 1rem; }
.jsection h2::after { content: ""; display: block; width: 48px; height: 3px; background: var(--gold); margin-top: 0.5rem; border-radius: 2px; }
.glance { list-style: none; }
.glance li { position: relative; padding: 0.5rem 0 0.5rem 1.6rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.glance li:last-child { border-bottom: none; }
.glance li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.glance .role-name { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 1rem; margin: 1.4rem 0 0.2rem; color: var(--navy); font-weight: 600; }
.glance .role-name span { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.glance .role-name::before { display: none; }
.glance .role-name { padding-left: 0; border-bottom: none; }
.story p { font-size: 1.05rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gallery figure { overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; transition: transform 0.5s; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption { padding: 0.6rem 0.8rem; font-size: 0.88rem; color: var(--muted); }
.video { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: 0 14px 30px rgba(31, 42, 68, 0.15); }
.video iframe, .video video { width: 100%; height: 100%; border: 0; display: block; }

.lightbox {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 14, 26, 0.9); padding: 2rem; cursor: zoom-out; animation: pagein 0.25s ease both;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }

.hop { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.hop a {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; background: #fff;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.hop a:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(31, 42, 68, 0.12); border-color: var(--gold); }
.hop small { display: block; color: var(--gold-dark); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.hop strong { color: var(--navy); font-family: "Source Serif 4", Georgia, serif; }
.hop .next { text-align: right; }
.hop-all { text-align: center; margin-top: 1.2rem; }
.hop-all a { color: var(--gold-dark); font-weight: 600; }

/* ---------- Placeholders: visible only when previewing on your own computer ---------- */
.todo { display: none !important; }
.is-local .todo {
  display: block !important; position: relative;
  border: 2px dashed var(--gold); border-radius: var(--radius); padding: 1.5rem 1.2rem 1.2rem; background: #fffaf0;
}
.is-local .todo::before {
  content: "TO FILL IN · only you see this box · it stays hidden on the live site";
  position: absolute; top: -0.7rem; left: 1rem; background: var(--gold); color: var(--navy);
  font: 700 0.65rem/1 "Inter", sans-serif; letter-spacing: 0.06em; padding: 0.3rem 0.6rem; border-radius: 4px;
}
.ph { color: var(--muted); font-size: 0.95rem; }

/* ---------- Respect "reduce motion" settings ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
}

/* ---------- Phones and small screens ---------- */
@media (max-width: 800px) {
  html { scroll-padding-top: 100px; }
  /* Menu becomes a swipeable row under the name */
  .nav-inner { flex-direction: column; align-items: flex-start; height: auto; padding: 0.6rem 0 0; }
  .nav nav {
    display: flex; gap: 1.2rem; width: 100%;
    overflow-x: auto; scrollbar-width: none; padding: 0.4rem 0 0.6rem;
  }
  .nav nav::-webkit-scrollbar { display: none; }
  .nav nav a { margin-left: 0; font-size: 0.9rem; white-space: nowrap; }

  .hero { padding: 3rem 0; }
  .hero-inner { flex-direction: column-reverse; text-align: center; }
  .hero h1 { font-size: 2.4rem; }
  .buttons { justify-content: center; }
  .hero-photo { width: 200px; height: 245px; }
  .edu, .modules, .skills-grid { grid-template-columns: 1fr; }
  .research-card { padding: 1.5rem; }
  .research-card h3 { font-size: 1.3rem; }
  h2 { font-size: 1.7rem; }
  /* On phones the dropdown is hidden: "Experience" just scrolls to the company cards */
  .nav nav .dd { margin-left: 0; }
  .dd-menu, .dd-toggle::after { display: none; }
  .journey-hero { padding: 2.5rem 0; }
  .journey-hero h1 { font-size: 2.1rem; }
  .hop { grid-template-columns: 1fr; }
  .hop .next { text-align: left; }
  .exp-card { padding: 1.1rem 1.2rem; }
}
