/*
 * Folio One — personal portfolio template
 * Version 1.0.0 - https://shipweb.store
 *
 * Contents
 *   1. Theme settings (colours, fonts, sizes)   <- start here to re-theme
 *   2. Base & typography
 *   3. Layout helpers & buttons
 *   4. Header & navigation
 *   5. Hero
 *   6. About & skills
 *   7. Services
 *   8. Work grid, filters & project window
 *   9. Timeline
 *  10. Contact form
 *  11. Footer
 *  12. Motion (scroll reveal, reduced motion)
 */

/* ==========================================================================
   1. THEME SETTINGS
   Change these values to re-theme the whole template.
   ========================================================================== */
:root {
  /* Light theme colours */
  --color-bg: #EEF0F6;          /* page background */
  --color-bg-tint: #E5E8F2;     /* alternate section background */
  --color-surface: #FFFFFF;     /* cards, form, header */
  --color-ink: #171A33;         /* main text */
  --color-muted: #545977;       /* secondary text */
  --color-line: #D3D7E6;        /* borders and dividers */
  --color-accent: #3B2FD9;      /* brand colour: buttons, links, highlights */
  --color-accent-hover: #2C22B5;
  --color-accent-soft: #E0DEFB; /* pale accent for backgrounds */
  --color-on-accent: #FFFFFF;   /* text on top of the accent colour */
  --color-highlight: #FFC933;   /* second brand colour: sparing highlights */
  --color-success: #17754A;
  --color-error: #BE3326;
  --header-bg: rgba(238, 240, 246, 0.82);
  --backdrop: rgba(23, 26, 51, 0.62);

  /* Fonts (change the Google Fonts <link> in index.html too) */
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Sizing */
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

/* Dark theme colours (applied by the toggle, or by the system setting when JavaScript is off) */
:root[data-theme="dark"] {
  --color-bg: #13162F;
  --color-bg-tint: #181C3A;
  --color-surface: #1E2245;
  --color-ink: #ECEDF8;
  --color-muted: #A9ADCB;
  --color-line: #30355F;
  --color-accent: #A29BFF;
  --color-accent-hover: #BDB8FF;
  --color-accent-soft: #2B2C63;
  --color-on-accent: #13162F;
  --color-highlight: #FFD257;
  --color-success: #6ED4A2;
  --color-error: #FF8E80;
  --header-bg: rgba(19, 22, 47, 0.82);
  --backdrop: rgba(6, 7, 20, 0.72);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #13162F;
    --color-bg-tint: #181C3A;
    --color-surface: #1E2245;
    --color-ink: #ECEDF8;
    --color-muted: #A9ADCB;
    --color-line: #30355F;
    --color-accent: #A29BFF;
    --color-accent-hover: #BDB8FF;
    --color-accent-soft: #2B2C63;
    --color-on-accent: #13162F;
    --color-highlight: #FFD257;
    --color-success: #6ED4A2;
    --color-error: #FF8E80;
    --header-bg: rgba(19, 22, 47, 0.82);
    --backdrop: rgba(6, 7, 20, 0.72);
    color-scheme: dark;
  }
}

/* ==========================================================================
   2. BASE & TYPOGRAPHY
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.has-modal { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--color-accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: var(--color-highlight); color: #171A33; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   3. LAYOUT HELPERS & BUTTONS
   ========================================================================== */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section { padding-block: clamp(72px, 10vw, 128px); }
.section--tint { background: var(--color-bg-tint); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px 56px;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.section-title {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.04;
}

.section-desc {
  color: var(--color-muted);
  font-size: 1.125rem;
  max-width: 46ch;
}

.subhead {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

@media (min-width: 900px) {
  .section-head {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: end;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.975rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--lg { min-height: 52px; padding: 14px 26px; font-size: 1.0625rem; }

.btn--primary { background: var(--color-accent); color: var(--color-on-accent); }
.btn--primary:hover { background: var(--color-accent-hover); }

.btn--outline { border-color: var(--color-ink); color: var(--color-ink); background: transparent; }
.btn--outline:hover { background: var(--color-ink); color: var(--color-bg); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 1.5px solid var(--color-line);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-ink);
  transition: border-color 0.2s ease;
}
.icon-btn:hover { border-color: var(--color-ink); }

.icon {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   4. HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--color-line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.0625rem;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 0.875rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.site-nav__list {
  display: flex;
  gap: 4px;
  margin: 0; padding: 0;
  list-style: none;
}
.site-nav__list a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  font-weight: 550;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.site-nav__list a:hover { color: var(--color-ink); }
.site-nav__list a.is-active { color: var(--color-ink); background: var(--color-surface); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle .icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--moon { display: block; }

.menu-toggle { display: none; }
.menu-toggle__bars { display: grid; gap: 6px; width: 18px; }
.menu-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease);
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:last-child { transform: translateY(-4px) rotate(-45deg); }

.site-nav__cta { display: none; }

/* Mobile & tablet navigation */
@media (max-width: 959px) {
  .js .menu-toggle { display: inline-grid; }
  .header-cta { display: none; }

  .js .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    padding: 12px var(--gutter) 24px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-line);
    box-shadow: 0 24px 40px -24px rgba(23, 26, 51, 0.35);
    display: none;
  }
  .js .site-nav.is-open {
    display: block;
    animation: menu-in 0.22s var(--ease);
  }
  .js .site-nav__list { flex-direction: column; gap: 0; }
  .js .site-nav__list a {
    padding: 14px 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--color-line);
    font-size: 1.25rem;
    color: var(--color-ink);
  }
  .js .site-nav__list a.is-active { background: none; color: var(--color-accent); }
  .js .site-nav__cta { display: flex; margin-top: 20px; width: 100%; }

  /* Without JavaScript the links simply wrap under the logo */
  html:not(.js) .header-inner { flex-wrap: wrap; padding-block: 12px; }
  html:not(.js) .site-nav { order: 3; width: 100%; overflow-x: auto; }
}

@media (max-width: 339px) {
  .brand__name { display: none; }
}

/* ==========================================================================
   5. HERO
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(40px, 7vw, 96px) clamp(72px, 9vw, 128px);
  overflow: hidden;
}
/* Dotted "canvas" background */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--color-line) 1.3px, transparent 1.6px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: 0.9375rem;
  font-weight: 550;
}
.status__dot {
  position: relative;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-highlight);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-highlight) 35%, transparent);
}

.hero__name {
  font-size: clamp(3.5rem, 1.4rem + 9.2vw, 8.75rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.05em;
  margin-bottom: clamp(24px, 3vw, 36px);
}
.hero__name span { display: block; }
.hero__name span + span { padding-left: 0.55em; color: var(--color-accent); }

.hero__lead {
  max-width: 30ch;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  font-weight: 550;
  line-height: 1.3;
  letter-spacing: -0.012em;
  margin-bottom: 16px;
}
.hero__intro { max-width: 52ch; color: var(--color-muted); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.hero__note { margin-top: 28px; color: var(--color-muted); font-size: 0.9375rem; }

/* Hero illustration */
.hero__art {
  width: 100%;
  max-width: 460px;
  justify-self: start;
}
@media (min-width: 900px) {
  .hero__art { justify-self: end; }
}
.hero__art svg { display: block; width: 100%; height: auto; overflow: visible; }

.art-card { fill: var(--color-surface); stroke: var(--color-line); stroke-width: 2; }
.art-sun { fill: var(--color-highlight); }
.art-block { fill: var(--color-accent-soft); }
.art-squiggle { fill: none; stroke: var(--color-ink); stroke-width: 5; stroke-linecap: round; }
.art-ring { fill: none; stroke: var(--color-accent); stroke-width: 6; }
.art-avatar__disc { fill: var(--color-accent); }
.art-avatar__text {
  fill: var(--color-on-accent);
  font-family: var(--font-display);
  font-size: 92px;
  font-weight: 750;
  letter-spacing: -3px;
}
.art-frame__box { fill: none; stroke: var(--color-accent); stroke-width: 2; }
.art-frame__handle { fill: var(--color-surface); stroke: var(--color-accent); stroke-width: 2; }
.art-frame__tag { fill: var(--color-accent); }
.art-frame__tagtext {
  fill: var(--color-on-accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
}
.art-cursor__arrow { fill: var(--color-ink); stroke: var(--color-surface); stroke-width: 2; stroke-linejoin: round; }
.art-cursor__tag { fill: var(--color-highlight); }
.art-cursor__text { fill: #171A33; font-family: var(--font-body); font-size: 14px; font-weight: 700; }

/* ==========================================================================
   6. ABOUT & SKILLS
   ========================================================================== */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(48px, 7vw, 96px);
}
@media (min-width: 900px) {
  .about { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
}

.about__text .section-title { margin-bottom: 28px; }
.about__text > p { max-width: 60ch; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 20px;
  margin: 36px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--color-line);
}
.facts dt { color: var(--color-muted); font-size: 0.875rem; margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 600; }

.about__skills {
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
}

.skills { display: grid; gap: 18px; margin: 0 0 40px; padding: 0; list-style: none; }
.skill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: baseline;
}
.skill__name { font-weight: 600; }
.skill__level { color: var(--color-muted); font-size: 0.875rem; }
.skill__bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-tint);
  overflow: hidden;
}
.skill__bar span {
  display: block;
  height: 100%;
  width: var(--level, 50%);
  border-radius: inherit;
  background: var(--color-accent);
  transform-origin: left center;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0; padding: 0;
  list-style: none;
}
.tags li {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  font-size: 0.9375rem;
  font-weight: 550;
}

/* ==========================================================================
   7. SERVICES
   ========================================================================== */
.services {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0; padding: 0;
  list-style: none;
}
@media (min-width: 680px) {
  .services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}

.service {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3.5vw, 36px);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  transition: border-color 0.25s ease;
}
.service:hover { border-color: var(--color-accent); }

.service__icon {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  margin-bottom: 28px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-accent);
}
.service__icon svg {
  width: 28px; height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.service:nth-child(2) .service__icon { background: var(--color-highlight); color: #171A33; }
.service:nth-child(4) .service__icon { background: var(--color-ink); color: var(--color-bg); }

.service__title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.service p { color: var(--color-muted); max-width: 48ch; }

.service__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: auto 0 0; padding: 20px 0 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 600;
}
.service__list li { position: relative; padding-left: 14px; }
.service__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ==========================================================================
   8. WORK GRID, FILTERS & PROJECT WINDOW
   ========================================================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.filter {
  min-height: 42px;
  padding: 8px 18px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-ink);
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.filter:hover { border-color: var(--color-ink); }
.filter[aria-pressed="true"] {
  background: var(--color-ink);
  border-color: var(--color-ink);
  color: var(--color-bg);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 40px) 24px;
  margin: 0; padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.work-card { position: relative; }
.work-card[hidden] { display: none; }
.work-card.is-entering { animation: card-in 0.4s var(--ease) both; }

.work-card__media {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  background: var(--color-bg-tint);
}
.work-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.work-card:hover .work-card__media img,
.work-card:focus-within .work-card__media img { transform: scale(1.04); }

.work-card__meta { padding-top: 16px; }
.work-card__title { font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 4px; }
.work-card__open {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
}
/* Stretch the button over the whole card so the image is clickable too */
.work-card__open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
}
.work-card__open:focus-visible { outline: none; }
.work-card__open:focus-visible::after { outline: 3px solid var(--color-accent); outline-offset: 6px; }
.work-card:hover .work-card__title { color: var(--color-accent); }
.work-card__cat { color: var(--color-muted); font-size: 0.9375rem; }

/* Project window (native <dialog>) */
.lightbox {
  width: min(100% - 24px, 1040px);
  max-width: none;
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.lightbox::backdrop {
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lightbox[open] { animation: dialog-in 0.3s var(--ease); }
.lightbox:not([open]) { display: none; }
/* Fallback for browsers without <dialog> support */
.lightbox.is-fallback[open] {
  position: fixed;
  inset: 12px;
  z-index: 200;
  box-shadow: 0 0 0 100vmax var(--backdrop);
}

.lightbox__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 860px) {
  .lightbox__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .lightbox__media { position: sticky; top: 0; align-self: start; }
}

.lightbox__close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
}
.lightbox__media { background: var(--color-bg-tint); }
.lightbox__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.lightbox__body { padding: clamp(24px, 4vw, 44px); }
.lightbox__cat { color: var(--color-muted); font-size: 0.9375rem; margin-bottom: 6px; padding-right: 48px; }
.lightbox__title {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  padding-right: 48px;
}
.lightbox__content .lead { font-size: 1.125rem; line-height: 1.5; }
.lightbox__content h3 { font-size: 1.0625rem; font-weight: 700; margin: 24px 0 8px; }
.lightbox__content ul { margin: 0; padding-left: 1.2em; }
.lightbox__content li { margin-bottom: 4px; }
.lightbox__content li::marker { color: var(--color-accent); }

.project-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 12px 20px;
  margin: 24px 0 0;
  padding: 18px 0;
  border-block: 1px solid var(--color-line);
}
.project-facts dt { color: var(--color-muted); font-size: 0.8125rem; }
.project-facts dd { margin: 0; font-weight: 600; font-size: 0.9375rem; }

.lightbox__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}
.lightbox__nav .btn { flex: 1 1 150px; }

/* ==========================================================================
   9. TIMELINE
   ========================================================================== */
.timelines {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 56px;
}
@media (min-width: 900px) {
  .timelines { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 72px; }
}

.timeline {
  position: relative;
  margin: 0; padding: 0;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--color-line);
}
.timeline li {
  position: relative;
  padding: 0 0 36px 36px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 0; top: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--color-bg-tint);
  border: 3px solid var(--color-accent);
}
.timeline li:first-child::before { background: var(--color-accent); }

.timeline__when { color: var(--color-accent); font-size: 0.9375rem; font-weight: 650; margin-bottom: 6px; }
.timeline__role { font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 4px; }
.timeline__org { font-weight: 550; margin-bottom: 8px; }
.timeline li > p:last-child { color: var(--color-muted); max-width: 56ch; }

/* ==========================================================================
   10. CONTACT FORM
   ========================================================================== */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 80px);
}
@media (min-width: 900px) {
  .contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
}

.contact__intro .section-title { margin-bottom: 20px; }
.contact__email {
  display: inline-block;
  margin-top: 28px;
  color: var(--color-ink);
  font-size: clamp(1.25rem, 1rem + 1.4vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration-color: var(--color-highlight);
  text-decoration-thickness: 4px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}
.contact__email:hover { color: var(--color-accent); text-decoration-thickness: 4px; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 28px 0 0; padding: 0;
  list-style: none;
}
.socials a { color: var(--color-ink); font-weight: 600; }
.socials a:hover { color: var(--color-accent); }

.contact-form {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
}

.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 0.9375rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--color-muted); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 30%, transparent);
}
.field [aria-invalid="true"] { border-color: var(--color-error); }

.field__hint { color: var(--color-muted); font-size: 0.875rem; margin: 0; }
.field__error { color: var(--color-error); font-size: 0.875rem; font-weight: 600; margin: 0; }
.field__error:empty { display: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-form__submit { justify-self: start; }
.contact-form__submit[disabled] { opacity: 0.6; cursor: progress; }

.form-status {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid currentColor;
  font-weight: 600;
}
.form-status.is-info { color: var(--color-accent); background: var(--color-accent-soft); }
.form-status.is-success { color: var(--color-success); }
.form-status.is-error { color: var(--color-error); }
.form-status[hidden] { display: none; }

/* ==========================================================================
   11. FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--color-line);
  padding-block: 28px;
  color: var(--color-muted);
  font-size: 0.9375rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.footer-top { color: var(--color-ink); font-weight: 600; }

/* ==========================================================================
   12. MOTION
   ========================================================================== */
@keyframes art-pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: none; }
}
@keyframes cursor-in {
  from { opacity: 0; transform: translate(40px, 30px); }
  to   { opacity: 1; transform: none; }
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-highlight) 35%, transparent); }
  50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--color-highlight) 0%, transparent); }
}

@media (prefers-reduced-motion: no-preference) {
  /* The one orchestrated moment: the hero assembles itself on load */
  .js .hero__copy > * { animation: rise 0.7s var(--ease) both; }
  .js .hero__copy > :nth-child(2) { animation-delay: 0.08s; }
  .js .hero__copy > :nth-child(3) { animation-delay: 0.16s; }
  .js .hero__copy > :nth-child(4) { animation-delay: 0.22s; }
  .js .hero__copy > :nth-child(5) { animation-delay: 0.28s; }
  .js .hero__copy > :nth-child(6) { animation-delay: 0.34s; }

  .js .art-piece {
    transform-box: fill-box;
    transform-origin: center;
    animation: art-pop 0.8s var(--ease) both;
    animation-delay: calc(var(--d, 0s) + 0.2s);
  }
  .js .art-cursor { animation-name: cursor-in; animation-duration: 1s; }

  .status__dot { animation: pulse 2.4s ease-in-out infinite; }

  /* Scroll reveal: quiet fade, only when JavaScript is running */
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }

  .js .skill__bar span { transform: scaleX(0); transition: transform 1.1s var(--ease) 0.2s; }
  .js .is-visible .skill__bar span { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
