:root {
  /* type */
  --font-serif: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* the accent - aubergine */
  --accent: #5b4b8a;

  /* spatial scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --content-max: 1180px;
  --side-pad: clamp(20px, 5vw, 64px);

  --header-h: 84px;

  --radius: 4px;
  --radius-lg: 12px;

  --t-fast: 180ms;
  --t-med:  320ms;
  --ease:   cubic-bezier(.22,.61,.36,1);
}

/* LIGHT THEME (default) */
:root,
[data-theme="light"] {
  --bg:           #faf8f5;   /* warm off-white */
  --bg-elev:     #f3efe7;   /* slightly raised */
  --ink:         #161412;   /* near-black, warm */
  --ink-2:       #4a4742;   /* secondary text */
  --ink-3:       #8a857d;   /* tertiary text / dates */
  --line:        #e6e1d8;   /* dividers, borders */
  --line-strong: #cfc8bb;
  --accent-tint: rgba(91, 75, 138, 0.10);

  /* nav gradient: opaque-ish at the top, transparent at the bottom.
     Uses bg color so it visually "merges" into the page. */
  --nav-fade-top:    rgba(232, 226, 215, 0.92);
  --nav-fade-bottom: rgba(232, 226, 215, 0.00);
}

/* DARK THEME */
[data-theme="dark"] {
  --bg:           #161412;
  --bg-elev:     #1f1c19;
  --ink:         #f0ece4;
  --ink-2:       #b8b2a5;
  --ink-3:       #7a7468;
  --line:        #2b2723;
  --line-strong: #3d3833;
  --accent:      #a99ed4;   /* lighter aubergine for contrast */
  --accent-tint: rgba(169, 158, 212, 0.12);

  --nav-fade-top:    rgba(11, 9, 7, 0.92);
  --nav-fade-bottom: rgba(11, 9, 7, 0.00);
}

/* RESET / BASE */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t-med) var(--ease),
              color var(--t-med) var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; padding: 0; margin: 0; }

::selection { background: var(--accent-tint); color: var(--ink); }

/* HEADER / NAV
   Fixed at the top, fixed height. Gradient background that
   fades to transparent at the bottom (no hard line). The bar
   contents sit in a 3-column flex: language / nav / theme.
*/

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + 24px);
  z-index: 100;
  pointer-events: none;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* the fade: vertical linear gradient using theme-aware vars */
  background: linear-gradient(
    to bottom,
    var(--nav-fade-top) 0%,
    var(--nav-fade-top) 55%,
    var(--nav-fade-bottom) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* mask so the blur also fades out at the bottom */
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
  transition: background var(--t-med) var(--ease);
}

.header-inner {
  pointer-events: auto;
  height: var(--header-h);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* left util / centered nav / right util */
  align-items: center;
  gap: var(--space-5);
}

.header-side  { display: flex; align-items: center; gap: var(--space-2); }
.header-left  { justify-content: flex-start; }
.header-right { justify-content: flex-end; }

/* Language toggle (left side) */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.lang-btn {
  padding: 4px 2px;
  color: inherit;
  transition: color var(--t-fast) var(--ease);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.active { color: var(--ink); font-weight: 500; }
.lang-sep { opacity: 0.5; }

/* Theme toggle (right side) */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  border-radius: 50%;
  transition: color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease);
}
.theme-toggle:hover {
  color: var(--ink);
  background: var(--accent-tint);
}
.theme-toggle .icon { width: 18px; height: 18px; }
/* show sun in dark theme, moon in light theme */
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: none; }

/* Centered nav */
.primary-nav { justify-self: center; }
.nav-list {
  display: flex;
  align-items: baseline;
  gap: clamp(20px, 3vw, 40px);
}
.nav-link {
  position: relative;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--ink-2);
  padding: 6px 0;
  transition:
    color var(--t-fast) var(--ease),
    font-size var(--t-med) var(--ease);
  line-height: 1;
}
.nav-link::after {
  /* underline element, animates from center on active */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width var(--t-med) var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active {
  font-size: 19px;
  color: var(--accent);
  font-weight: 500;
}
.nav-link.is-active::after {
  width: 100%;
}

/* Projects dropdown (hover / focus) */
.nav-item { position: relative; }

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 180px;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  /* hidden until hover/focus */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 50;
  transition:
    opacity var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease),
    visibility var(--t-fast) var(--ease);
}
/* The cursor can cross the gap between the "Projects" link and the panel without the hover dropping */
.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(2px);
}
.nav-dropdown-link {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  white-space: nowrap;
  transition:
    color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease);
}
.nav-dropdown-link:hover {
  color: var(--accent);
  background: var(--accent-tint);
}

/* MOBILE NAV - hamburger + slide-in drawer + projects submenu */

.header-right { gap: var(--space-2); }

/* hamburger (hidden on desktop, shown on mobile) */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--ink-2);
  border-radius: 50%;
  transition: color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease);
}
.nav-toggle:hover { color: var(--ink); background: var(--accent-tint); }
.nav-toggle .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
}
.nav-toggle .bar + .bar { margin-top: 5px; }
/* bars morph into an X while the drawer is open */
body.nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* dim backdrop behind the drawer */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease),
              visibility var(--t-med) var(--ease);
}
body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }

/* "← Menu" control inside the projects submenu (mobile only) */
.nav-submenu-back {
  display: none;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 0 var(--space-4);
  text-align: left;
  transition: color var(--t-fast) var(--ease);
}
.nav-submenu-back:hover { color: var(--accent); }

@media (max-width: 760px) {
  .js .nav-toggle { display: grid; }
  /* keep the hamburger (which morphs into ✕) above the drawer so it can close it */
  .header-right { position: relative; z-index: 120; }

  .header-inner { display: flex; justify-content: space-between; }

  /* .primary-nav becomes an off-canvas drawer sliding in from the right */
  .js .primary-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    z-index: 110;
    height: 100vh;
    height: 100dvh;
    width: min(82vw, 320px);
    justify-self: end;
    padding: calc(var(--header-h) + var(--space-4)) var(--space-6) var(--space-6);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform var(--t-med) var(--ease);
    /* gradient background */
    background: linear-gradient(200deg, var(--accent-tint), transparent 55%), var(--bg-elev);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  }
  body.nav-open .primary-nav { transform: translateX(0); }
  body.nav-open { overflow: hidden; }

  .js .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
  }
  .js .nav-link {
    display: block;
    font-size: 20px;
    padding: var(--space-3) 0;
    line-height: 1.3;
  }
  .js .nav-link::after { display: none; }

  /* projects submenu = inline panel inside the drawer */
  .js .nav-item { position: static; }
  .js .nav-dropdown {
    position: static;
    inset: auto;
    transform: none;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    background: none;
    border: none;
    box-shadow: none;
  }
  .js .nav-dropdown::before { content: none; }
  .js .nav-item:hover .nav-dropdown,
  .js .nav-item:focus-within .nav-dropdown { transform: none; }
  .js .nav-dropdown-link {
    font-size: 19px;
    padding: var(--space-3) 0;
    border-radius: 0;
  }
  .js .nav-submenu-back { display: block; }

  /* when the submenu is open, show only the two projects + back */
  body.nav-show-projects .nav-list > li:not(.nav-item) { display: none; }
  body.nav-show-projects .nav-item > .nav-link { display: none; }
  body.nav-show-projects .nav-item > .nav-dropdown { display: flex; flex-direction: column; }
}

/* GLOBAL SECTION LAYOUT */

.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-7) var(--side-pad);
}

.section-header {
  margin-bottom: var(--space-8);
  max-width: 720px;
}

.section-number {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--space-4);
}

.section-title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4) 0;
}

.section-lede {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 56ch;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--space-5) 0;
}

/* HERO
   Two-column on desktop (text + photo), stacks on mobile.
   Name is "plain" - same weight as the body type, photo
   carries the visual weight.
*/

.section-hero {
  padding-top: calc(var(--header-h) + var(--space-9));
  padding-bottom: var(--space-9);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.hero-text { max-width: 560px; }

.hero-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-5) 0;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.4;
  font-weight: 300;
  color: var(--ink);
  margin: 0 0 var(--space-5) 0;
}
.hero-tagline em {
  font-style: italic;
  color: var(--accent);
}

.hero-intro {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 var(--space-7) 0;
}

.hero-scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color var(--t-fast) var(--ease);
}
.hero-scroll-cue:hover { color: var(--accent); }
.hero-scroll-cue svg {
  width: 14px; height: 14px;
  animation: nudge 2s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

/* hero photo block */
.hero-photo {
  display: flex;
  justify-content: center;
}
.photo-frame {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 5;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.photo-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .photo-frame { max-width: 280px; }
}

/* TIMELINE - shared by Education and Experience */

.timeline {
  position: relative;
  padding-left: var(--space-6);
}
.timeline::before {
  /* vertical line behind the dots */
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item {
  position: relative;
  padding: 0 0 var(--space-7) 0;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-6) + 1px);
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-date {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin: 0 0 var(--space-2) 0;
  text-transform: uppercase;
}
.timeline-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 var(--space-1) 0;
  color: var(--ink);
}
.timeline-place {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0 0 var(--space-3) 0;
}
.timeline-note {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
}

.timeline-thin .timeline-title { font-size: 18px; }

/* inline accent link inside running text (e.g. "CoPlanny" in Experience) */
.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: opacity var(--t-fast) var(--ease);
}
.text-link:hover { opacity: 0.7; }

/* EDUCATION - two columns */

.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
}
.edu-column-title {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--space-6) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.edu-summary {
  margin: var(--space-7) 0 0 0;
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}
.edu-summary-line {
  margin: 0 0 var(--space-3) 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.7;
}
.edu-summary-line:first-child {
  margin-bottom: var(--space-6);
}
.edu-summary-line:last-child {
  margin-bottom: 0;
}
.edu-summary-line strong {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: var(--space-3);
}
.timeline-tag {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: var(--space-2);
}

@media (max-width: 720px) {
  .edu-grid { grid-template-columns: 1fr; }
}

/* PROJECTS */

.projects-group { margin-bottom: var(--space-9); }
.projects-group:last-child { margin-bottom: 0; }

.projects-group-title {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--space-6) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: stretch;
}
.projects-grid-other {
  grid-template-columns: minmax(0, 480px);
}

.project-card {
  position: relative;   /* containing block for the full-card link overlay */
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease);
}
.project-card:hover { transform: translateY(-2px); }
/* whole card is clickable: this link's ::after is stretched over the
   entire card, while the visible link text stays in place */
.project-card { cursor: pointer; }
.project-link-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, var(--accent-tint), transparent 60%),
    var(--bg-elev);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.project-media-label {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.project-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  padding: 8px;
  box-sizing: border-box;
  background: var(--bg-elev);
}
.project-screenshot-contain {
  object-fit: contain;
  padding: 8px;
  background: var(--bg-elev);
}
.project-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 56px;
  width: auto;
  border-radius: 12px;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.project-body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 var(--space-2) 0;
  color: var(--ink);
}
.project-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-2) 0;
}
.project-title-row .project-title {
  margin: 0;
}
.project-inline-logo {
  height: 60px;
  width: 60px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
}
.project-meta {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--space-4) 0;
}
.project-desc {
  font-size: 15px;
  color: var(--ink-2);
  margin: 0 0 var(--space-5) 0;
  flex: 1;
}
.project-links {
  display: flex;
  gap: var(--space-5);
}
.project-link {
  font-size: 14px;
  color: var(--accent);
  transition: opacity var(--t-fast) var(--ease);
}
.project-link:hover { opacity: 0.7; }

.project-card-small .project-body { padding: var(--space-6); }

@media (max-width: 760px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* CONTACTS */

.contact-body {
  margin-top: var(--space-7);
}
.contact-email {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.01em;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.contact-email:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.socials {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-top: var(--space-7);
}
.social-link {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-2);
  transition: color var(--t-fast) var(--ease);
}
.social-link:hover { color: var(--accent); }

/* FOOTER */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-8);
}
.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--side-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.back-to-top {
  color: inherit;
  transition: color var(--t-fast) var(--ease);
}
.back-to-top:hover { color: var(--accent); }

/* PROJECT DETAIL PAGE (krusto.html, listing-builder.html)*/

.project-page {
  padding-top: var(--header-h);
}
.project-hero {
  padding-top: var(--space-7);
  padding-bottom: var(--space-5);
  max-width: 880px;
}
.back-link {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: var(--space-6);
  letter-spacing: 0.04em;
  transition: color var(--t-fast) var(--ease);
}
.back-link:hover { color: var(--accent); }

.project-page-title {
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  margin: var(--space-3) 0 var(--space-5) 0;
  letter-spacing: -0.02em;
  color: var(--ink);
}
/* logo + title on one row (project hero) */
.project-title-block {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-3) 0 var(--space-5) 0;
}
.project-title-block .project-page-title {
  margin: 0;
}
.project-page-logo {
  height: clamp(48px, 6vw, 72px);
  width: auto;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}
.project-page-lede {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 300;
  color: var(--ink-2);
  max-width: 720px;
  margin: 0;
  line-height: 1.5;
}
.project-page-links {
  display: flex;
  gap: var(--space-5);
}

.project-section {
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
  max-width: 880px;
}
.project-section-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 400;
  margin: 0 0 var(--space-4) 0;
  color: var(--ink);
}
.project-section-title:not(:first-child) {
  margin-top: var(--space-7);
}
.project-section-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 var(--space-4) 0;
  max-width: 720px;
}
.project-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 720px;
}
.project-bullets li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}
.project-bullets li:last-child { border-bottom: none; }
.project-bullets strong {
  color: var(--ink);
  font-weight: 500;
  margin-right: var(--space-2);
}

.project-shot {
  margin: var(--space-6) 0 var(--space-7) 0;
}
.project-shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}
.project-shot figcaption {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-3);
  margin-top: var(--space-3);
  line-height: 1.6;
  font-style: italic;
}

/* CAROUSEL (project pages)
   Native CSS scroll-snap viewport (swipes on touch, works with
   no JS) enhanced by script.js with arrows, dots and a caption. */

.carousel {
  margin: var(--space-6) 0 var(--space-7);
  max-width: 720px;
}
.carousel-frame { position: relative; }

.carousel-viewport {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  -ms-overflow-style: none;   /* hide scrollbar (IE/Edge legacy) */
  scrollbar-width: none;      /* hide scrollbar (Firefox) */
}
.carousel-viewport::-webkit-scrollbar { display: none; }  /* hide (WebKit) */
.carousel-viewport:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}
.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
}

/* prev / next arrows, floating over the image */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  z-index: 2;
  transition:
    background-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    opacity var(--t-fast) var(--ease);
}
.carousel-prev { left: var(--space-4); }
.carousel-next { right: var(--space-4); }
.carousel-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.carousel-btn:disabled { opacity: 0; pointer-events: none; }
.carousel-btn svg { width: 18px; height: 18px; }

.carousel-caption {
  font-family: var(--font-sans);
  font-size: 13px;
  font-style: italic;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.6;
  margin: var(--space-3) 0 0;
  min-height: 1.6em;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  background: var(--line-strong);
  transition:
    background-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
.carousel-dot:hover { background: var(--ink-3); }
.carousel-dot.is-active { background: var(--accent); transform: scale(1.3); }

/* ACCESSIBILITY - reduced motion */

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