/* ---------- Design tokens ---------- */
:root {
  --navy: #14284b;
  --navy-deep: #0e1d38;
  --teal: #2a7f9e;
  --teal-dark: #1f6683;
  --ice: #bfe3f0;
  --mist: #eef4f8;
  --line: #d5e0e8;
  --ink: #1b2430;
  --ink-soft: #4a5666;
  --paper: #ffffff;
  --radius: 10px;
  --font: "Segoe UI", Calibri, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0 0 1rem; max-width: 68ch; }
a { color: var(--teal-dark); }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .6rem 1rem; z-index: 20; }
.skip:focus { left: 0; }

/* ---------- Icons ---------- */
.ic { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-lg { width: 2.4rem; height: 2.4rem; stroke-width: 1.5; color: var(--teal); }

/* ---------- Top navigation ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.nav { width: min(1080px, 100% - 2.5rem); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.brand { font-weight: 700; color: var(--navy); text-decoration: none; }
.nav ul { display: flex; gap: 1.4rem; }
.nav li a { text-decoration: none; color: var(--ink-soft); padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav li a:hover, .nav li a.is-current { color: var(--navy); border-bottom-color: var(--teal); }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: #fff; padding: clamp(3rem, 8vw, 5.5rem) 0 0; }
.hero-role { color: var(--ice); font-size: 1.2rem; margin-bottom: .4rem; }
.hero h1 { font-size: clamp(2.8rem, 9vw, 5.2rem); font-weight: 800; letter-spacing: .02em; }
.hero-lead { color: #dbe7f1; font-size: 1.2rem; margin: 1.2rem 0 1.8rem; max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.btn { display: inline-flex; align-items: center; gap: .55rem; padding: .75rem 1.2rem; border-radius: 8px; font-weight: 600; text-decoration: none; border: 2px solid transparent; transition: background-color .15s, color .15s, border-color .15s; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { border-color: var(--ice); color: #fff; }
.btn-ghost:hover { background: rgba(191,227,240,.14); }
.contact .btn-primary { background: var(--navy); }
.contact .btn-primary:hover { background: var(--navy-deep); }

.hero-icons { display: grid; grid-template-columns: repeat(6, 1fr); margin-top: clamp(2.5rem, 6vw, 4rem); border-top: 1px solid rgba(191,227,240,.3); }
.hero-icons li { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.3rem .4rem; color: var(--ice); font-size: .95rem; text-align: center; }
.hero-icons li + li { border-left: 1px solid rgba(191,227,240,.18); }
.hero-icons .ic { width: 1.8rem; height: 1.8rem; }

/* ---------- Sections ---------- */
section { padding-block: clamp(2.6rem, 6vw, 4.2rem); }
section h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); color: var(--navy); margin-bottom: 1.4rem; }
.about { padding-bottom: 1rem; }
.about p { font-size: 1.12rem; }

/* Skills */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.6rem; }
.chip { font: inherit; font-size: .95rem; padding: .45rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--teal); color: var(--navy); }
.chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.card { background: var(--mist); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.2rem; border-top: 3px solid var(--teal); }
.card h3 { font-size: 1.12rem; color: var(--navy); margin: .8rem 0 .4rem; }
.card p { font-size: .98rem; color: var(--ink-soft); margin: 0; }
.card[hidden] { display: none; }
.empty { color: var(--ink-soft); }

/* Timeline (experience is a real sequence, so the line and dates carry information) */
.timeline { border-left: 3px solid var(--teal); margin-left: .4rem; }
.timeline > li { position: relative; display: grid; grid-template-columns: 11.5rem 1fr; gap: 1.5rem; padding: 0 0 2.2rem 1.8rem; }
.timeline > li::before { content: ""; position: absolute; left: -.62rem; top: .35rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--paper); border: 3px solid var(--teal); }
.when { color: var(--teal-dark); font-weight: 700; padding-top: .1rem; }
.what h3 { font-size: 1.25rem; color: var(--navy); }
.org { color: var(--ink-soft); font-style: italic; margin: .15rem 0 .8rem; }
.what ul { display: grid; gap: .45rem; }
.what li { position: relative; padding-left: 1.2rem; }
.what li::before { content: ""; position: absolute; left: 0; top: .72em; width: .5rem; height: .5rem; background: var(--teal); border-radius: 2px; }

/* Education */
.education { background: var(--mist); }
.education.wrap { width: 100%; padding-inline: max(1.25rem, calc((100% - 1080px) / 2)); }
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.edu { background: var(--paper); border-radius: var(--radius); padding: 1.2rem; border-left: 4px solid var(--navy); }
.edu h3 { font-size: 1.08rem; color: var(--navy); margin-bottom: .3rem; }
.edu p { margin: 0; font-size: .98rem; color: var(--ink-soft); }
.edu .meta { color: var(--teal-dark); font-weight: 600; margin-top: .3rem; }

/* Contact + footer */
.contact { background: var(--navy); color: #fff; }
.contact h2 { color: #fff; }
.contact p { color: #dbe7f1; }
.contact .btn-primary { background: var(--teal); }
.contact .btn-primary:hover { background: var(--teal-dark); }
.foot { padding: 1.4rem 0; background: var(--navy-deep); color: #9fb4c8; font-size: .92rem; }
.foot p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav ul { gap: .9rem; font-size: .95rem; }
  .brand { display: none; }
  .nav { justify-content: center; }
  .hero-icons { grid-template-columns: repeat(3, 1fr); }
  .hero-icons li:nth-child(4) { border-left: 0; }
  .hero-icons li:nth-child(n+4) { border-top: 1px solid rgba(191,227,240,.18); }
  .timeline > li { grid-template-columns: 1fr; gap: .3rem; }
}

/* One quiet entrance on load only; respects reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-icons li { animation: rise .6s ease both; }
  .hero-icons li:nth-child(2) { animation-delay: .06s; }
  .hero-icons li:nth-child(3) { animation-delay: .12s; }
  .hero-icons li:nth-child(4) { animation-delay: .18s; }
  .hero-icons li:nth-child(5) { animation-delay: .24s; }
  .hero-icons li:nth-child(6) { animation-delay: .3s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* =====================================================
   Animations (all switched off for visitors who prefer reduced motion)
   ===================================================== */

/* Card hover works for everyone: lift, soft shadow, icon tilt */
.card { transition: translate .2s ease, box-shadow .2s ease; }
.card:hover { translate: 0 -5px; box-shadow: 0 12px 26px rgba(20, 40, 75, .14); }
.card .ic-lg { transition: transform .25s ease; }
.card:hover .ic-lg { transform: scale(1.14) rotate(-5deg); }
.edu { transition: translate .2s ease, box-shadow .2s ease; }
.edu:hover { translate: 0 -3px; box-shadow: 0 8px 20px rgba(20, 40, 75, .12); }

/* Scroll progress bar */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; background: var(--teal); transform: scaleX(0); transform-origin: left; z-index: 30; }

@media (prefers-reduced-motion: no-preference) {

  /* Hero text rises in one after another on load */
  .js .hero-role, .js .hero h1, .js .hero-lead, .js .hero-actions { animation: rise .7s ease both; }
  .js .hero h1 { animation-delay: .08s; }
  .js .hero-lead { animation-delay: .16s; }
  .js .hero-actions { animation-delay: .24s; }

  /* Sections and cards fade up as you scroll to them */
  .js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s ease, transform .7s ease, translate .2s ease, box-shadow .2s ease;
    transition-delay: var(--delay, 0s), var(--delay, 0s), 0s, 0s;
  }
  .js .reveal.in { opacity: 1; transform: none; }

  /* Experience line draws itself downward */
  .js .timeline { border-left-color: transparent; position: relative; }
  .js .timeline::before {
    content: ""; position: absolute; left: -3px; top: 0; bottom: 0; width: 3px;
    background: var(--teal); transform: scaleY(0); transform-origin: top;
    transition: transform 1.4s ease;
  }
  .js .timeline.in::before { transform: scaleY(1); }

  /* Cards pop back in when a skill filter is chosen */
  .card.pop { animation: pop .45s ease both; animation-delay: var(--delay, 0s); }
  @keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }

  /* Nav shadow once you start scrolling */
  .top { transition: box-shadow .25s ease; }
  .top.scrolled { box-shadow: 0 4px 16px rgba(20, 40, 75, .1); }
}
