/* ==========================================================================
   Sahan Karunarathne — Portfolio
   Main page (everything) + Videos page. Light, fully rounded.
   Tokens up top; shared parts next; then main-page sections; then videos.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #FFFDF7;
  --surface: #FFFFFF;
  --heading: #111111;
  --text: #3A3A3A;
  --muted: #6B6B6B;
  --line: #ECE9E1;
  --line-2: #DFDBD1;

  --accent: #157366;
  --accent-hover: #0F5D53;
  --accent-soft: #E6F1EE;

  /* Button gradient (lightest stop keeps white text at 4.5:1 contrast) */
  --grad: linear-gradient(120deg, #1A8574 0%, #157366 40%, #0E5F66 75%, #0B4F55 100%);
  --grad-edge: linear-gradient(120deg, #1A8574, #0E5F66);

  /* Image-slot tints */
  --tint-green: #EAF3F0;
  --tint-blue: #EDF1F6;
  --tint-lilac: #F2EFF6;
  --tint-sand: #F6F1E7;

  /* Rounding: pills & circles everywhere, soft corners on cards */
  --r-full: 999px;
  --r-card: 24px;
  --r-media: 18px;
  --r-field: 20px;

  --shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 12px 30px -16px rgba(17, 17, 17, 0.16);

  /* Body: Archivo, the grotesque named in the logo kit (stands in for Akzidenz-Grotesk) */
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Headings: Fraunces, a contemporary serif standing in for ABC Arizona Serif */
  --display: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --container: 1120px;
  --narrow: 800px;
  --bar-h: 72px; /* floating pill (60px) + its 12px top gap */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { flex: none; }

h1, h2, h3 { font-family: var(--display); color: var(--heading); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
/* Green accent words in headings: same Fraunces face as the rest of the heading,
   set apart by colour alone. */
h1 em, h2 em {
  font-style: normal;
  color: var(--accent);
}

::selection { background: var(--accent-soft); color: var(--heading); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 1rem; top: -100px; z-index: 200;
  padding: 0.6rem 1.1rem; border-radius: var(--r-full);
  background: var(--heading); color: #fff; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, var(--narrow)); margin-inline: auto; }

/* ---------- Shared: buttons, labels ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
/* Chunky "pressable key" style: a hard, unblurred lip sits under each button and
   the button sinks into it when pressed. --lip is the lip's depth, so a variant
   only has to set its own colour (and .btn--sm a shallower depth). */
.btn { --lip: 4px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(calc(var(--lip) - 1px)); }
.btn svg { width: 17px; height: 17px; }
/* Primary: gradient fill that slides toward the deeper end on hover */
.btn--primary {
  background-image: var(--grad);
  background-size: 200% 100%;
  background-position: 0% 50%;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 var(--lip) 0 #0B4F55;
  transition: background-position 0.5s var(--ease), box-shadow 0.2s var(--ease), transform 0.12s var(--ease);
}
.btn--primary:hover {
  background-position: 100% 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 calc(var(--lip) + 1px) 0 #0B4F55;
}
/* Pressed: the button drops onto its lip, leaving a 1px edge */
.btn--primary:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 0 #0B4F55; }
/* Secondary: white fill with a gradient border */
.btn--secondary {
  color: var(--heading);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad-edge) border-box;
}
.btn--secondary {
  box-shadow: 0 var(--lip) 0 #CFE3DE;
  transition: background 0.2s, box-shadow 0.2s var(--ease), transform 0.12s var(--ease);
}
.btn--secondary:hover {
  background:
    linear-gradient(#F2F8F6, #F2F8F6) padding-box,
    var(--grad-edge) border-box;
  box-shadow: 0 calc(var(--lip) + 1px) 0 #CFE3DE;
}
.btn--secondary:active { box-shadow: 0 1px 0 #CFE3DE; }
/* High-contrast mode drops backgrounds, so give buttons a visible edge */
@media (forced-colors: active) {
  .btn, .card__link { border-color: ButtonText; }
}
.btn--sm { --lip: 3px; height: 40px; padding: 0 1.05rem; font-size: 0.875rem; }
.btn--block { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active { transform: none; }
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.15rem;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent);
  /* Uppercase question at a lighter weight; smaller size + tracking keeps caps tidy */
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-wrap: balance;
}
/* On narrow screens, stack the label's parts instead of wrapping mid-phrase */
@media (max-width: 479px) {
  .label { flex-direction: column; gap: 0.15rem; padding-inline: 1.2rem; border-radius: var(--r-card); }
  .label__sep { display: none; }
}
.eyebrow { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- Shared: top bar (floating pill) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: 12px;
  pointer-events: none; /* only the pill itself is clickable */
}
.topbar__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 1.5rem, 980px);
  height: 60px;
  margin-inline: auto;
  padding: 0 1.75rem 0 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.03), 0 6px 20px -12px rgba(17, 17, 17, 0.12);
  transition: box-shadow 0.3s var(--ease);
}
.topbar.is-scrolled .topbar__inner {
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04), 0 14px 34px -14px rgba(17, 17, 17, 0.22);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
/* The logo SVG carries its own rounded tile and colour, so no background or
   border-radius here — styling it would fight the artwork. */
.brand__mark {
  flex: none; /* the nav row would otherwise squeeze it out of square on phones */
  width: 36px;
  height: 36px;
  display: block;
  transition: transform 0.3s var(--ease);
}
.brand:hover .brand__mark { transform: scale(1.06); }
.topnav { display: flex; align-items: center; gap: clamp(1rem, 3.2vw, 2.4rem); }
.topnav a {
  position: relative;
  padding: 0.35rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.topnav a:hover { color: var(--heading); }
.topnav a.is-active,
.topnav a[aria-current="page"] { color: var(--heading); }
/* Underline: grows out from the centre — a faint preview on hover, full teal when active.
   Transform-only, so switching the active link never shifts the layout. */
.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 3px;
  border-radius: var(--r-full);
  background: var(--line-2);
  transform: scaleX(0);
  transition: transform 0.35s var(--ease), background-color 0.25s;
}
.topnav a:hover::after { transform: scaleX(0.55); }
.topnav a.is-active::after,
.topnav a[aria-current="page"]::after { transform: scaleX(1); background: var(--accent); }
.topnav .hide-sm { display: none; }
.topnav__short { display: none; }
/* Below 900px the full six-link bar gets tight, so long labels use their short version */
@media (max-width: 899px) {
  .topnav__long { display: none; }
  .topnav__short { display: inline; }
}
@media (max-width: 479px) {
  .topbar__inner { height: 56px; padding: 0 1.15rem 0 0.65rem; }
  .topnav a { font-size: 0.9rem; }
}
@media (max-width: 380px) {
  .topnav { gap: 0.75rem; }
  .topnav a { font-size: 0.85rem; }
}
@media (max-width: 350px) {
  .topnav { gap: 0.6rem; }
  .topnav a { font-size: 0.8rem; }
}
@media (min-width: 640px) {
  .topnav .hide-sm { display: inline; }
}

/* ---------- Shared: section heads ---------- */
.section { padding-block: clamp(4rem, 9vw, 6rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 5vw, 2.75rem); }
.section-title { margin-top: 0.7rem; font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.08; letter-spacing: -0.04em; text-wrap: balance; }
.section-intro { margin-top: 0.9rem; color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.12rem); text-wrap: pretty; }

/* Two-column "title left, content right" sections */
.split { display: grid; gap: 1.5rem; }
.split__head h2 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); letter-spacing: -0.03em; }
.split__head p { margin-top: 0.5rem; color: var(--muted); font-size: 0.95rem; }
@media (min-width: 900px) {
  .split { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; }
}

/* ---------- Main page: hero ---------- */
/* Fills the first screen under the navbar and centres its content, so the space
   above the label matches the space below the status line (padding is equal too) */
.hero {
  min-height: calc(100svh - var(--bar-h));
  display: grid;
  place-items: center;
  padding-block: clamp(1.75rem, 5svh, 4.5rem);
  text-align: center;
}

/* Decorative line texture behind the hero. Sits in a ::before rather than on
   .hero itself so it can never tint the section's own background, and is
   pointer-events:none so it never intercepts a click on the buttons. */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("../assets/hero-lines.svg") center / cover no-repeat;
  /* fade the texture out before it reaches the content's baseline */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
}
@media (forced-colors: active) {
  .hero::before { display: none; }
}
.hero__inner { width: 100%; max-width: 820px; margin-inline: auto; padding-inline: 1.25rem; }
.js .hero [data-enter] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms + 0.1s);
}
.is-loaded .hero [data-enter] { opacity: 1; transform: none; }
.hero__title {
  margin-top: 1.5rem;
  /* Scales with width and height, so the hero still fits on short windows */
  font-size: clamp(2.6rem, min(8vw, 10.5svh), 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero__lead { max-width: 36rem; margin: 1.5rem auto 0; color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.15rem); text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2.25rem; }
.hero__note {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.2rem 0.45rem;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- Main page: about ---------- */
.about { display: grid; gap: 2.5rem; align-items: center; }
.about-lead { margin-top: 1.25rem; font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.55; color: var(--heading); text-wrap: pretty; }
.about-p { margin-top: 1rem; color: var(--muted); }
.about-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.portrait { width: 100%; max-width: 420px; }
.portrait__frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--tint-green);
}
/* object-position: the photo is a little taller than the 4:5 frame; anchoring to the
   bottom shifts it up (trims a little ceiling, shows more of the chair) */
.portrait__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.portrait__mono {
  width: clamp(7rem, 16vw, 9rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.portrait figcaption { margin-top: 0.75rem; text-align: center; font-size: 0.85rem; color: var(--muted); }
@media (min-width: 900px) {
  .about { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 4rem; }
  .portrait { justify-self: end; }
}

/* How I work */
.steps { display: grid; gap: 0.75rem; }
.step {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface);
}
.step__num {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.step h3 { font-size: 1.15rem; letter-spacing: -0.015em; line-height: 1.3; }
.step p { margin-top: 0.3rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.chip { padding: 0.2rem 0.7rem; border-radius: var(--r-full); background: var(--accent-soft); font-size: 0.78rem; font-weight: 600; color: var(--accent); }

/* ---------- Main page: work ---------- */
.work-grid { display: grid; gap: 1.25rem; }
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__media { position: relative; aspect-ratio: 16 / 10; background: var(--tint, var(--tint-green)); }
.card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; }
.ph__name { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 700; letter-spacing: -0.04em; color: var(--heading); opacity: 0.75; }
.ph__hint {
  position: absolute;
  left: 0.8rem;
  bottom: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.8);
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
}
.card__body { display: flex; flex-direction: column; flex: 1; padding: 1.3rem 1.4rem 1.45rem; }
/* wrap so a long link label (e.g. a company name) drops below the category
   on very narrow phones instead of squeezing it */
.card__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; }
/* Product link: small outlined pill (same gradient edge as the secondary buttons) */
.card__link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad-edge) border-box;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.2s;
}
.card__link:hover {
  background:
    linear-gradient(#F2F8F6, #F2F8F6) padding-box,
    var(--grad-edge) border-box;
}
.card__link svg { width: 13px; height: 13px; transition: transform 0.2s var(--ease); }
.card__link:hover svg { transform: translate(2px, -2px); }
.card h3 { margin-top: 0.4rem; font-size: 1.4rem; letter-spacing: -0.025em; }
.card__desc { margin-top: 0.4rem; font-size: 0.95rem; color: var(--muted); }
.card__role { margin-top: auto; padding-top: 1rem; }
.card__role p { padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.875rem; }
.card__role b { font-weight: 600; color: var(--heading); }
@media (min-width: 640px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Main page: experience (native details/summary) ---------- */
.timeline { display: grid; gap: 0.75rem; }
.role { border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); transition: border-color 0.2s, box-shadow 0.3s var(--ease); }
.role[open] { border-color: var(--line-2); box-shadow: var(--shadow); }
.role summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 1.15rem 1.35rem;
  border-radius: var(--r-card);
  cursor: pointer;
  list-style: none;
}
.role summary::-webkit-details-marker { display: none; }
.role__dates { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.role__dates small { font-size: inherit; }
.role__dates small::before { content: " · "; }
.role__main { grid-column: 1; display: grid; gap: 0.1rem; }
.role__title { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; color: var(--heading); transition: color 0.2s; }
.role__company { font-size: 0.95rem; color: var(--muted); }
.role summary:hover .role__title { color: var(--accent); }
.plus {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--heading);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.plus svg { transition: transform 0.3s var(--ease); }
details[open] > summary .plus { background: var(--heading); border-color: var(--heading); color: #fff; }
details[open] > summary .plus svg { transform: rotate(45deg); }
.role__body { padding: 0 1.35rem 1.4rem; animation: open 0.35s var(--ease); }
.bullets { display: grid; gap: 0.35rem; margin-top: 0.7rem; }
.bullets li { position: relative; padding-left: 1.2rem; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.66em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tags-sm { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.tags-sm li { padding: 0.2rem 0.7rem; border-radius: var(--r-full); border: 1px solid var(--line-2); font-size: 0.78rem; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.9rem; font-size: 0.9rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.text-link svg { width: 15px; height: 15px; }
@media (min-width: 640px) {
  .role summary { grid-template-columns: 9rem 1fr auto; column-gap: 1.25rem; }
  .role__dates { grid-row: 1 / span 2; align-self: start; padding-top: 0.2rem; }
  .role__dates small { display: block; }
  .role__dates small::before { content: none; }
  .role__main { grid-column: 2; grid-row: 1 / span 2; }
  .plus { grid-column: 3; }
  .role__body { padding-left: calc(1.35rem + 10.25rem); }
}

/* ---------- Main page: toolkit ---------- */
.skill-rows { border-top: 1px solid var(--line); }
.skill-row { display: grid; gap: 0.7rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.skill-row h3 { font-size: 0.9rem; font-weight: 700; letter-spacing: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  position: relative;
  padding: 0.35rem 0.85rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.tag[data-where] { cursor: help; }
.tag:hover, .tag:focus-visible { border-color: var(--accent); color: var(--accent); }
@media (hover: hover) {
  .tag[data-where]:hover::after,
  .tag[data-where]:focus-visible::after {
    content: attr(data-where);
    position: absolute;
    z-index: 5;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 240px;
    padding: 0.4rem 0.8rem;
    border-radius: var(--r-full);
    background: var(--heading);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    pointer-events: none;
    animation: pop 0.2s var(--ease);
  }
}
@media (min-width: 640px) {
  .skill-row { grid-template-columns: 11rem 1fr; align-items: baseline; }
}

/* ---------- Main page: education ---------- */
.edu-group + .edu-group { margin-top: 2rem; }
.edu-group h3 { margin-bottom: 0.4rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.rows { border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); }
.row__title { font-weight: 600; color: var(--heading); }
.row__sub { font-size: 0.9rem; color: var(--muted); }
.row__meta { flex: none; font-size: 0.8125rem; color: var(--muted); }

/* ---------- Main page: contact ---------- */
.contact-card {
  display: grid;
  gap: 2.5rem;
  padding: clamp(1.75rem, 5vw, 3rem);
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.contact-card .section-head { margin-bottom: 0; }
@media (min-width: 900px) {
  .contact-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; }
}
.form { display: grid; gap: 1.1rem; align-content: start; }
.field { display: grid; gap: 0.4rem; }
.field label { padding-left: 0.3rem; font-size: 0.875rem; font-weight: 600; color: var(--heading); }
.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--line-2);
  background: var(--bg);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.field input { height: 50px; border-radius: var(--r-full); }
.field textarea { min-height: 9rem; border-radius: var(--r-field); resize: vertical; }
.field input:focus,
.field textarea:focus { outline: 0; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.form .btn { margin-top: 0.25rem; }
.form__note { font-size: 0.8125rem; color: var(--muted); text-align: center; }

.clist { margin-top: 1.75rem; display: grid; gap: 0.6rem; }
.clist li { display: flex; align-items: center; gap: 0.85rem; padding: 0.6rem 0.8rem 0.6rem 0.6rem; border-radius: var(--r-full); background: var(--bg); border: 1px solid var(--line); }
.clist__icon { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.clist__text { flex: 1; min-width: 0; line-height: 1.35; }
.clist__text small { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.clist__text a,
.clist__text span { font-size: 0.95rem; font-weight: 500; color: var(--heading); text-decoration: none; overflow-wrap: anywhere; }
.clist__text a:hover { color: var(--accent); }
.contact-cv { margin-top: 1.25rem; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}
.copy-btn:hover { border-color: var(--heading); color: var(--heading); }
.copy-btn.is-copied { border-color: var(--accent); color: var(--accent); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn .i-check { display: none; }
.copy-btn.is-copied .i-check { display: block; }
.copy-btn.is-copied .i-copy { display: none; }

/* Phones: icon-only Copy button and slimmer card so the email stays on one line
   (the button keeps its "Copy email address" aria-label; the toast confirms the copy) */
@media (max-width: 479px) {
  .contact-card { padding: 1.5rem 1.1rem; }
  .clist li { gap: 0.7rem; }
  .copy-btn { padding: 0.55rem; }
  .copy-btn span { display: none; }
}

/* ---------- Videos page ---------- */
.page { padding-block: clamp(3rem, 7vw, 4.5rem) clamp(4.5rem, 10vw, 6.5rem); }
.page-head { margin-bottom: clamp(2rem, 5vw, 3rem); }
.page-title { font-size: clamp(2.4rem, 6vw, 3.5rem); line-height: 1.05; letter-spacing: -0.04em; }
.page-intro { max-width: 40rem; margin-top: 1rem; color: var(--muted); font-size: clamp(1.05rem, 1.7vw, 1.2rem); line-height: 1.6; text-wrap: pretty; }

.video-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter {
  padding: 0.45rem 1rem;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.filter:hover { border-color: var(--heading); }
.filter[aria-pressed="true"] { background: var(--heading); border-color: var(--heading); color: #fff; }

.player { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #111; }
.player__btn { position: absolute; inset: 0; width: 100%; height: 100%; }
.player__btn img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; transition: transform 0.6s var(--ease), opacity 0.3s; }
.player__btn:hover img { transform: scale(1.03); opacity: 1; }
.player__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background-image: var(--grad);
  background-size: 200% 100%;
  background-position: 0% 50%;
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  transition: background-position 0.5s var(--ease), transform 0.2s var(--ease);
}
.player__btn:hover .player__play { background-position: 100% 50%; transform: translate(-50%, -50%) scale(1.06); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.featured { margin-bottom: clamp(2.5rem, 6vw, 3.5rem); overflow: hidden; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); }
.featured__body { padding: 1.35rem 1.5rem 1.6rem; }
.featured__title { margin-top: 0.5rem; font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -0.025em; line-height: 1.2; }
.featured__body p { margin-top: 0.5rem; color: var(--muted); }

.list-title { margin-bottom: 1.25rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.video-grid { display: grid; gap: 1.25rem; }
.video { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); transition: box-shadow 0.3s var(--ease); }
.video:hover { box-shadow: var(--shadow); }
.video__body { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.2rem 1.25rem; }
.video__title { margin-top: 0.4rem; font-size: 1.05rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.video__desc { display: -webkit-box; margin-top: 0.35rem; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 0.9rem; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; font-size: 0.75rem; color: var(--muted); }
.meta__topic { font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.yt-link { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.8rem; font-size: 0.8125rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.video .yt-link { margin-top: auto; padding-top: 0.8rem; }
.yt-link:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.yt-link svg { width: 14px; height: 14px; }

.empty {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: clamp(2.5rem, 7vw, 4rem) 1.5rem;
  border-radius: var(--r-card);
  border: 1px dashed var(--line-2);
  background: var(--surface);
  text-align: center;
}
.empty__icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.empty__icon svg { width: 26px; height: 26px; }
.empty h2 { font-size: 1.35rem; letter-spacing: -0.02em; }
.empty p { max-width: 28rem; color: var(--muted); }
.empty .btn { margin-top: 0.5rem; }
@media (min-width: 640px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; font-size: 0.85rem; color: var(--muted); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.footer__nav a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.footer__nav a:hover { color: var(--accent); }
.footer__credit { width: 100%; font-size: 0.78rem; }

/* The floating WhatsApp/LinkedIn buttons are fixed bottom-right, so they can
   cover the footer two ways: vertically when the page is scrolled to the end,
   and horizontally on a short page (e.g. Videos) where the footer is already on
   screen at rest. Reserve room in both directions below 900px. */
@media (max-width: 899px) {
  .footer { padding-bottom: calc(2.5rem + 64px); }
  .footer__inner { padding-right: 76px; }
}

/* ---------- Display titles ----------
   Hero, section and page titles use the display serif: bold, tight
   letter-spacing, snug line-height. Set explicitly so the sizes below hold even
   when a title is not an h1/h2/h3. */
.hero__title,
.section-title,
.split__head h2,
.page-title {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.hero__title { font-size: clamp(2.2rem, min(6.4vw, 8.8svh), 4.4rem); }
.section-title { font-size: clamp(1.8rem, 4.4vw, 2.6rem); }
.split__head h2 { font-size: clamp(1.45rem, 3.2vw, 1.9rem); }
.page-title { font-size: clamp(2.1rem, 5.2vw, 3.1rem); }

/* ---------- Floating contact buttons (WhatsApp + LinkedIn) ----------
   Fixed bottom-right on both pages. Brand colours so they're recognisable at a
   glance; sits under the toast (z-index 100) so a copy confirmation still wins. */
.fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.fab__btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), filter 0.2s;
}
.fab__btn svg { width: 24px; height: 24px; }
.fab__btn--wa { background: #29A71A; }
.fab__btn--li { background: #0077B5; }
.fab__btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
@media (max-width: 479px) {
  .fab__btn { width: 46px; height: 46px; }
  .fab__btn svg { width: 21px; height: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .fab__btn { transition: none; }
  .fab__btn:hover { transform: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 100;
  padding: 0.7rem 1.2rem;
  border-radius: var(--r-full);
  background: var(--heading);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, calc(100% + 2rem));
  transition: transform 0.45s var(--ease), opacity 0.3s, visibility 0s 0.45s;
  pointer-events: none;
}
.toast.is-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes open { from { opacity: 0; transform: translateY(-4px); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 4px); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal, .js .hero [data-enter] { opacity: 1; transform: none; }
}
