/* ── Reset & box model ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
ul, ol    { list-style: none; }
img, svg  { display: block; max-width: 100%; }
a         { color: inherit; text-decoration: none; }
button    { font: inherit; border: none; background: none; }

/* ── Tokens ── */
:root {
  /* Colour */
  --bg:        #f5f3ef;
  --surf:      #edebe6;
  --surf-2:    #e1ddd5;
  --ink:       #1a1714;
  --ink-2:     #46423c;
  --ink-3:     #908c84;
  --red:       #bf3a2b;
  --red-bg:    #f0dbd8;
  --border:    #d5d0c7;
  --nav-bg:    rgba(245, 243, 239, 0.92);

  /* Type */
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --mono:  'DM Mono', 'Courier New', monospace;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* Scale */
  --nav-h:   4.5rem;
  --max-w:   1120px;
  --gap:     clamp(1.25rem, 5vw, 4rem);
  --sec-py:  clamp(4.5rem, 9vw, 8rem);

  /* Motion */
  --ease:    cubic-bezier(.4, 0, .2, 1);
  --ease-o:  cubic-bezier(0, 0, .2, 1);
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--sans);
  font-size:   1rem;
  font-weight: 400;
  line-height: 1.65;
  color:       var(--ink);
  background:  var(--bg);
  overflow-x:  hidden;
  cursor:      none;
  -webkit-font-smoothing: antialiased;
}

/* ── Cursor ── */
#js-cursor {
  position:       fixed;
  top: 0; left: 0;
  width:          9px;
  height:         9px;
  border-radius:  50%;
  background:     var(--red);
  pointer-events: none;
  z-index:        9999;
  transform:      translate(-50%, -50%);
  transition:     width .18s var(--ease), height .18s var(--ease),
                  background .18s var(--ease), border .18s var(--ease);
  will-change:    transform;
}
#js-cursor.is-hovered {
  width:      32px;
  height:     32px;
  background: transparent;
  border:     1.5px solid var(--red);
}

/* ── Layout helpers ── */
.wrap {
  width:          100%;
  max-width:      var(--max-w);
  margin-inline:  auto;
  padding-inline: var(--gap);
}
.section { padding-block: var(--sec-py); }
.rule .wrap hr { border: none; border-top: 1px solid var(--border); }

/* ── Typography atoms ── */
.kicker {
  display:        block;
  font-family:    var(--mono);
  font-size:      clamp(.6rem, 1.1vw, .68rem);
  letter-spacing: .24em;
  text-transform: uppercase;
  color:          var(--red);
  margin-bottom:  .85rem;
}

.h2 {
  font-family:    var(--serif);
  font-size:      clamp(1.85rem, 4.2vw, 3rem);
  font-weight:    500;
  line-height:    1.1;
  letter-spacing: -.025em;
}
.h2 em { font-style: italic; font-weight: 400; color: var(--red); }

.section-hd          { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-hd--row     { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display:        inline-flex;
  align-items:    center;
  justify-content:center;
  gap:            .45rem;
  font-family:    var(--mono);
  font-size:      .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding:        .8rem 1.8rem;
  border:         1.5px solid transparent;
  white-space:    nowrap;
  cursor:         none;
  transition:     background .22s var(--ease), color .22s var(--ease),
                  border-color .22s var(--ease);
}
.btn--fill  { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--fill:hover  { background: var(--red); border-color: var(--red); }
.btn--ghost { border-color: var(--border); color: var(--ink-3); }
.btn--ghost:hover { border-color: var(--red); color: var(--red); }
.btn--sm    { padding: .6rem 1.4rem; font-size: .66rem; }

/* ── Tags ── */
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; }
.tag {
  font-family:    var(--mono);
  font-size:      .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color:          var(--ink-3);
  background:     var(--surf);
  border:         1px solid var(--border);
  padding:        .28rem .7rem;
  transition:     color .18s, border-color .18s;
}
.tag:hover { color: var(--red); border-color: var(--red); }

/* ── Chips ── */
.chip-list { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1.4rem; }
.chip {
  font-family:    var(--mono);
  font-size:      .58rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color:          var(--ink-3);
  background:     var(--red-bg);
  padding:        .2rem .55rem;
}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.site-header {
  position:   fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height:     var(--nav-h);
  z-index:    800;
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.site-header.is-scrolled { border-color: var(--border); }

.site-header__bar {
  height:          100%;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             1.5rem;
}

/* Logo */
.logo {
  font-family:    var(--mono);
  font-size:      .82rem;
  letter-spacing: .12em;
  color:          var(--ink);
  flex-shrink:    0;
  white-space:    nowrap;
}
.logo__slash { color: var(--red); margin-right: .15em; }

/* Desktop nav */
.primary-nav ul {
  display:     flex;
  align-items: center;
  gap:         clamp(.8rem, 2.5vw, 2rem);
}
.primary-nav__link {
  font-family:    var(--mono);
  font-size:      .67rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color:          var(--ink-3);
  position:       relative;
  padding-bottom: 3px;
  transition:     color .18s var(--ease);
}
.primary-nav__link::after {
  content:    '';
  position:   absolute;
  bottom: 0; left: 0;
  width:      0; height: 1px;
  background: var(--red);
  transition: width .22s var(--ease);
}
.primary-nav__link:hover        { color: var(--ink); }
.primary-nav__link:hover::after { width: 100%; }

/* Burger */
.burger {
  display:        none;
  flex-direction: column;
  justify-content:center;
  gap:            5px;
  width:          2.4rem;
  height:         2.4rem;
  padding:        .4rem;
  cursor:         none;
  flex-shrink:    0;
}
.burger span {
  display:          block;
  width:            100%;
  height:           1.5px;
  background:       var(--ink);
  border-radius:    1px;
  transform-origin: center;
  transition:       transform .26s var(--ease), opacity .26s var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Drawer ── */
.drawer {
  position:       fixed;
  inset:          var(--nav-h) 0 0 0;
  z-index:        700;
  background:     var(--bg);
  display:        flex;
  flex-direction: column;
  justify-content:center;
  padding:        clamp(2rem, 8vw, 4rem) var(--gap);
  opacity:        0;
  visibility:     hidden;
  transform:      translateY(-10px);
  transition:     opacity .3s var(--ease-o), transform .3s var(--ease-o), visibility .3s;
}
.drawer.is-open { opacity: 1; visibility: visible; transform: translateY(0); }

.drawer__nav { display: flex; flex-direction: column; gap: clamp(.9rem, 2.5vw, 1.4rem); }
.drawer__link {
  font-family: var(--serif);
  font-size:   clamp(1.9rem, 7.5vw, 3rem);
  font-weight: 500;
  color:       var(--ink);
  line-height: 1.1;
  transition:  color .18s var(--ease);
}
.drawer__link:hover { color: var(--red); }

.drawer__foot {
  margin-top:     auto;
  padding-top:    2rem;
  font-family:    var(--mono);
  font-size:      .63rem;
  letter-spacing: .1em;
  color:          var(--ink-3);
}

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
  position:       relative;
  min-height:     100svh;
  display:        flex;
  flex-direction: column;
  justify-content:center;
  padding-top:    calc(var(--nav-h) + clamp(2rem, 5vw, 4rem));
  padding-bottom: clamp(4rem, 8vw, 7rem);
  overflow:       hidden;
}

.hero__inner { display: flex; flex-direction: column; }

.hero__label {
  font-family:    var(--mono);
  font-size:      clamp(.62rem, 1.2vw, .72rem);
  letter-spacing: .26em;
  text-transform: uppercase;
  color:          var(--red);
  display:        flex;
  align-items:    center;
  gap:            .9rem;
  margin-bottom:  1.6rem;
  opacity:        0;
  animation:      aFadeUp .7s .05s var(--ease-o) both;
}
.hero__label::before {
  content:    '';
  width:      34px;
  height:     1px;
  background: var(--red);
  flex-shrink:0;
}

.hero__title {
  font-family:    var(--serif);
  font-size:      clamp(3rem, 9vw, 7.5rem);
  font-weight:    700;
  line-height:    1.0;
  letter-spacing: -.03em;
  max-width:      14ch;
  opacity:        0;
  animation:      aFadeUp .8s .2s var(--ease-o) both;
}
.hero__title em { font-style: italic; font-weight: 400; color: var(--red); }

.hero__body {
  display:         flex;
  align-items:     flex-end;
  justify-content: space-between;
  gap:             2.5rem;
  margin-top:      clamp(2rem, 5vw, 3.5rem);
  opacity:         0;
  animation:       aFadeUp .8s .38s var(--ease-o) both;
}
.hero__sub {
  font-size:   clamp(.9rem, 1.7vw, 1.05rem);
  color:       var(--ink-2);
  max-width:   42ch;
  line-height: 1.82;
}
.hero__cta { display: flex; gap: .75rem; flex-shrink: 0; }

.hero__scroll {
  position:       absolute;
  bottom:         2.5rem;
  left:           var(--gap);
  display:        flex;
  align-items:    center;
  gap:            .85rem;
  font-family:    var(--mono);
  font-size:      .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color:          var(--ink-3);
  opacity:        0;
  animation:      aFadeUp .7s .7s var(--ease-o) both;
}
.hero__scroll span {
  display:    block;
  width:      38px;
  height:     1px;
  background: var(--border);
}

/* ══════════════════════════════════════
   ABOUT
══════════════════════════════════════ */
.about {
  display:     grid;
  grid-template-columns: 1fr 1.7fr;
  gap:         clamp(3rem, 7vw, 7rem);
  align-items: start;
}
.about__lead { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.about__copy p {
  font-size:     .975rem;
  color:         var(--ink-2);
  line-height:   1.92;
  margin-bottom: 1rem;
}
.about__copy p:last-of-type { margin-bottom: 0; }

/* ══════════════════════════════════════
   TIMELINE
══════════════════════════════════════ */
.timeline {
  position:    relative;
  padding-left:2.4rem;
  max-width:   680px;
}
.timeline::before {
  content:    '';
  position:   absolute;
  left: 0; top: 8px; bottom: 0;
  width:      1px;
  background: var(--border);
}

.timeline__item { position: relative; padding-bottom: 2.8rem; }
.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position:     absolute;
  left:         calc(-2.4rem);
  top:          6px;
  width:        10px; height: 10px;
  border-radius:50%;
  background:   var(--bg);
  border:       2px solid var(--border);
  transform:    translateX(-4px);
  transition:   background .22s var(--ease), border-color .22s var(--ease);
}
.timeline__item:hover .timeline__dot { background: var(--red); border-color: var(--red); }

.timeline__meta {
  display:    flex;
  flex-wrap:  wrap;
  align-items:center;
  gap:        .4rem .8rem;
  margin-bottom: .45rem;
}
.timeline__year {
  font-family:    var(--mono);
  font-size:      .63rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color:          var(--red);
}
.timeline__org {
  font-family:    var(--mono);
  font-size:      .63rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color:          var(--ink-3);
}
.timeline__org::before { content: '·'; margin-right: .5em; color: var(--border); }

.timeline__role {
  font-family:   var(--serif);
  font-size:     clamp(1.05rem, 2vw, 1.2rem);
  font-weight:   500;
  margin-bottom: .5rem;
  line-height:   1.3;
}
.timeline__desc {
  font-size:  .875rem;
  color:      var(--ink-2);
  line-height:1.85;
  max-width:  56ch;
}

/* ══════════════════════════════════════
   SKILLS
══════════════════════════════════════ */
.skills {
  display:     grid;
  grid-template-columns: 1fr 2fr;
  gap:         clamp(3rem, 7vw, 7rem);
  align-items: start;
}
.skills__lead { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
.skills__body { display: flex; flex-direction: column; gap: 2.4rem; }

.skill-group__title {
  font-family:    var(--mono);
  font-size:      .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color:          var(--ink-3);
  padding-bottom: .65rem;
  margin-bottom:  .9rem;
  border-bottom:  1px solid var(--border);
}
.skill-group__list { display: flex; flex-direction: column; gap: .45rem; }
.skill-group__list li {
  display:     flex;
  align-items: center;
  gap:         .9rem;
  font-size:   .88rem;
  color:       var(--ink-2);
  padding:     .18rem 0;
}
.skill-group__list li::before {
  content:       '';
  width:         5px; height: 5px;
  border-radius: 50%;
  background:    var(--red);
  flex-shrink:   0;
}

/* ══════════════════════════════════════
   CERTIFICATIONS
══════════════════════════════════════ */
.cert-list { border-top: 1px solid var(--border); max-width: 760px; }

.cert-row {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             2rem;
  padding:         1.35rem 0;
  border-bottom:   1px solid var(--border);
  transition:      padding-left .22s var(--ease);
}
.cert-row:hover { padding-left: 1rem; }

.cert-row__info  { display: flex; flex-direction: column; gap: .2rem; }
.cert-row__name  { font-family: var(--serif); font-size: clamp(.98rem, 1.9vw, 1.08rem); font-weight: 500; }
.cert-row__issuer { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.cert-row__year  { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; color: var(--red); flex-shrink: 0; }

/* ══════════════════════════════════════
   CONTACT
══════════════════════════════════════ */
.contact {
  display:     grid;
  grid-template-columns: 1fr 1fr;
  gap:         clamp(3rem, 7vw, 7rem);
  align-items: start;
}

.contact__desc {
  font-size:     .975rem;
  color:         var(--ink-2);
  line-height:   1.88;
  max-width:     42ch;
  margin-top:    .6rem;
  margin-bottom: 2rem;
}

.contact__email {
  display:        inline-flex;
  align-items:    center;
  font-family:    var(--mono);
  font-size:      clamp(.7rem, 1.4vw, .8rem);
  letter-spacing: .04em;
  color:          var(--ink);
  border-bottom:  1.5px solid var(--ink);
  padding-bottom: 2px;
  transition:     color .18s var(--ease), border-color .18s var(--ease);
}
.contact__email:hover { color: var(--red); border-color: var(--red); }

.contact__social-label {
  font-family:    var(--mono);
  font-size:      .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color:          var(--ink-3);
  margin-bottom:  1.4rem;
}

.social-list { display: flex; flex-direction: column; gap: .8rem; }
.social-link {
  font-family:    var(--mono);
  font-size:      .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color:          var(--ink-2);
  display:        inline-flex;
  align-items:    center;
  gap:            .7rem;
  transition:     color .18s var(--ease);
}
.social-link::before {
  content:       '';
  width:         5px; height: 5px;
  border-radius: 50%;
  background:    var(--border);
  flex-shrink:   0;
  transition:    background .18s var(--ease);
}
.social-link:hover        { color: var(--ink); }
.social-link:hover::before { background: var(--red); }

.avail {
  display:     flex;
  align-items: center;
  gap:         .6rem;
  margin-top:  2.4rem;
  padding-top: 2rem;
  border-top:  1px solid var(--border);
}
.avail__dot {
  width:         7px; height: 7px;
  border-radius: 50%;
  background:    #22c55e;
  flex-shrink:   0;
  box-shadow:    0 0 0 3px rgba(34,197,94,.18);
  animation:     aPulse 2s ease infinite;
}
.avail__text {
  font-family:    var(--mono);
  font-size:      .63rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color:          var(--ink-3);
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer { border-top: 1px solid var(--border); padding-block: 1.75rem; }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.site-footer__copy, .site-footer__note {
  font-family:    var(--mono);
  font-size:      .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color:          var(--ink-3);
}
.site-footer__copy span { color: var(--red); }

/* ══════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════ */
@keyframes aFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes aPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
  50%       { box-shadow: 0 0 0 7px rgba(34,197,94,.06); }
}

.fade-up {
  opacity:    0;
  transform:  translateY(22px);
  transition: opacity .6s var(--ease-o), transform .6s var(--ease-o);
}
.fade-up.is-visible { opacity: 1; transform: none; }

/* ── Focus ── */
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ══════════════════════════════════════
   RESPONSIVE  ≤ 1280px
══════════════════════════════════════ */
@media (max-width: 1280px) {
  :root { --max-w: 1020px; }
}

/* ══════════════════════════════════════
   RESPONSIVE  ≤ 1024px  (tablet land.)
══════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sec-py: clamp(3.5rem, 7vw, 6rem); }

  /* About: single col */
  .about         { grid-template-columns: 1fr; gap: 2.5rem; }
  .about__lead   { position: static; }

  /* Skills: single col */
  .skills        { grid-template-columns: 1fr; gap: 2.5rem; }
  .skills__lead  { position: static; }

  /* Hero body stacks */
  .hero__body    { flex-direction: column; align-items: flex-start; gap: 2rem; }

  /* Contact grid stays 2col but tighter */
  .contact       { gap: 3rem; }
}

/* ══════════════════════════════════════
   RESPONSIVE  ≤ 768px  (tablet / mobile)
══════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sec-py: clamp(3rem, 8vw, 5rem); --gap: 1.25rem; }

  body   { cursor: auto; }
  #js-cursor { display: none; }

  /* Nav */
  .primary-nav { display: none; }
  .burger      { display: flex; }

  /* Hero */
  .hero__title  { font-size: clamp(2.75rem, 12vw, 4.5rem); }
  .hero__cta    { flex-direction: column; width: 100%; }
  .hero__cta .btn { width: 100%; }
  .hero__scroll { display: none; }

  /* Section header row: stack */
  .section-hd--row { flex-direction: column; align-items: flex-start; }

  /* Cert rows: stack */
  .cert-row      { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .cert-row:hover { padding-left: 0; }

  /* Contact: 1 col */
  .contact       { grid-template-columns: 1fr; gap: 3rem; }

  /* Footer: centre */
  .site-footer__inner { flex-direction: column; text-align: center; gap: .35rem; }
}

/* ══════════════════════════════════════
   RESPONSIVE  ≤ 480px  (small phones)
══════════════════════════════════════ */
@media (max-width: 480px) {
  :root { --gap: 1rem; }
  .hero__title   { font-size: clamp(2.4rem, 13vw, 3.2rem); }
  .drawer__link  { font-size: clamp(1.8rem, 9vw, 2.5rem); }
  .tag           { font-size: .57rem; }
}

/* ══════════════════════════════════════
   RESPONSIVE  ≤ 360px  (very small)
══════════════════════════════════════ */
@media (max-width: 360px) {
  .hero__title        { font-size: 2.1rem; }
  .btn                { padding: .72rem 1.3rem; font-size: .64rem; }
}
