/* ===== Design tokens: change colours and fonts here ===== */
:root {
  --bg: #f3f8fa;
  --surface: #ffffff;
  --text: #10222f;
  --muted: #4f6476;
  --primary: #0e7c86;       /* teal */
  --on-primary: #ffffff;
  --accent: #1d4ed8;        /* blue, used for links */
  --border: #d9e5ec;
  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #0c1a24;
  --surface: #132634;
  --text: #e6eef5;
  --muted: #9db2c3;
  --primary: #3ec6d0;
  --on-primary: #06222a;
  --accent: #8db4ff;
  --border: #223a4b;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.65 var(--font-body); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* ===== Navigation ===== */
.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .7rem clamp(1rem, 5vw, 3rem); background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { font: 700 1.15rem var(--font-head); color: var(--text); text-decoration: none; margin-right: auto; }
#menu { display: flex; gap: 1.25rem; }
#menu a { color: var(--muted); text-decoration: none; font-weight: 600; padding: .25rem 0; border-bottom: 2px solid transparent; }
#menu a:hover, #menu a.active { color: var(--text); border-color: var(--primary); }
.icon-btn { font: 600 .9rem var(--font-body); color: var(--text); background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: .35rem .9rem; cursor: pointer; }
.icon-btn:hover { border-color: var(--primary); }
.menu-btn { display: none; }

/* ===== Hero (the one expressive area) ===== */
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
  max-width: 1100px; margin: 0 auto; padding: clamp(2.5rem, 8vw, 6rem) clamp(1rem, 5vw, 3rem); }
.hello { margin: 0 0 .5rem; color: var(--primary); font-weight: 600; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.8rem); letter-spacing: -.02em; }
.headline { font: 600 1.3rem var(--font-head); margin: .8rem 0 1rem; }
.intro { color: var(--muted); max-width: 52ch; margin: 0 0 1.8rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn { display: inline-block; padding: .7rem 1.3rem; border-radius: 999px; border: 2px solid var(--primary);
  color: var(--primary); font-weight: 600; text-decoration: none; transition: background .2s, color .2s; }
.btn:hover { background: var(--primary); color: var(--on-primary); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { border-color: var(--border); color: var(--text); }
.hero-photo { justify-self: center; width: min(100%, 340px); padding: 10px; border: 2px solid var(--primary);
  border-radius: 999px 999px 24px 24px; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 20%;
  border-radius: 999px 999px 16px 16px; background: var(--border); }
/* One page-load entrance for the hero only */
.hero-text, .hero-photo { animation: rise .7s ease both; }
.hero-photo { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ===== Sections ===== */
.section { max-width: 1100px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 5vw, 3rem); border-top: 1px solid var(--border); }
.section h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 1.5rem; }
.lead { max-width: 68ch; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem;
  transition: transform .2s, border-color .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 10px 28px rgba(8, 40, 60, .14); }
.card h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.card p { margin: .4rem 0; color: var(--muted); }
.meta { font-size: .95rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .7rem 0 0; list-style: none; }
.tags li { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: .15rem .6rem; font-size: .95rem; }
.card .links { display: flex; gap: .9rem; margin-top: .9rem; font-weight: 600; }

/* Project banner (used when a project has no image) */
.thumb { height: 120px; margin: -1.25rem -1.25rem 1rem; border-radius: 12px 12px 0 0; background: var(--primary);
  color: var(--on-primary); display: grid; place-items: center; font: 700 1.1rem var(--font-head); }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px 12px 0 0; }

/* Timeline (education and training) */
.timeline { border-left: 2px solid var(--border); margin-left: .5rem; }
.timeline .item { position: relative; padding: 0 0 1.6rem 1.5rem; }
.timeline .item::before { content: ""; position: absolute; left: -7px; top: .5rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--primary); }
.timeline h3 { font-size: 1.2rem; }
.timeline p { margin: .2rem 0; }

/* Contact */
.contact { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .8rem; max-width: 560px; }
.contact li { display: grid; grid-template-columns: 90px 1fr; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.contact span { color: var(--muted); font-weight: 600; }
.contact a { overflow-wrap: anywhere; }

.footer { text-align: center; padding: 2rem 1rem; color: var(--muted); border-top: 1px solid var(--border); }

/* Gentle reveal for section content (added by script.js) */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; }
.reveal.show { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { order: -1; width: min(70%, 260px); }
  .menu-btn { display: inline-block; }
  #menu { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: .5rem clamp(1rem, 5vw, 3rem) 1rem; }
  #menu.open { display: flex; }
  #menu a { padding: .6rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
