/* ============================================
   Tristan Brandt — Portfolio
   Shared stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0c0c0e;
  --bg-elevated: #15151a;
  --surface: #1c1c22;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f0ece3;
  --text-soft: #c5c0c9;
  --text-muted: #8e8a90;

  --accent-purple: #a78bfa;
  --accent-plum: #c084fc;
  --accent-mint: #6ee7b7;
  --accent-cyan: #67e8f9;

  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --max-width: 1280px;
  --radius: 18px;
  --radius-sm: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Subtle grain overlay for warmth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, video {
  max-width: 100%;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

::selection { background: var(--accent-purple); color: var(--bg); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Header
   ============================================ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 22px 0;
  background: linear-gradient(to bottom, rgba(12, 12, 14, 0.85), rgba(12, 12, 14, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.wordmark .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-mint);
  box-shadow: 0 0 14px var(--accent-mint);
  animation: pulse 2.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-soft);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: all 0.25s var(--ease);
}

.back-link:hover {
  border-color: var(--accent-purple);
  color: var(--text);
  background: rgba(167, 139, 250, 0.08);
}

.back-link .arrow { transition: transform 0.2s var(--ease); }
.back-link:hover .arrow { transform: translateX(-3px); }

/* ============================================
   Hero (landing)
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  position: relative;
}

.hero-ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.hero-ambient::before,
.hero-ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.hero-ambient::before {
  width: 540px; height: 540px;
  background: var(--accent-purple);
  top: -120px; right: -60px;
  opacity: 0.35;
  animation: drift 20s ease-in-out infinite alternate;
}
.hero-ambient::after {
  width: 420px; height: 420px;
  background: var(--accent-mint);
  bottom: -120px; left: 6%;
  opacity: 0.22;
  animation: drift 24s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(60px, 40px); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 28px;
}

.eyebrow::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--accent-cyan);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 8.5vw, 116px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-purple);
}

.hero-intro {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 58ch;
  margin: 0 0 48px;
  font-weight: 300;
}

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-hint .line {
  width: 28px;
  height: 1px;
  background: rgba(255,255,255,0.18);
  position: relative;
  overflow: hidden;
}
.scroll-hint .line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-mint);
  transform: translateX(-100%);
  animation: scroll-line 2.2s ease-in-out infinite;
}

@keyframes scroll-line {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ============================================
   Bento tiles
   ============================================ */

.tiles-section { padding: 24px 0 120px; }

.section-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(28px, 4vw, 48px);
  margin: 0 0 32px;
  font-weight: 400;
  color: var(--text-soft);
}

.section-label small {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 220px;
  gap: 16px;
}

.tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  background: var(--surface);
  isolation: isolate;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.65);
}

.tile-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  transition: transform 1s var(--ease);
}

.tile:hover .tile-image { transform: scale(1.08); }

.tile-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(170deg, rgba(12, 12, 14, 0.45) 0%, rgba(12, 12, 14, 0.9) 100%);
  transition: opacity 0.5s var(--ease);
}

.tile-content {
  position: absolute;
  inset: 0;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tile-number {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--text-soft);
  opacity: 0.7;
}

.tile-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.tile-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.0;
  margin: 0 0 8px;
  font-weight: 400;
}

.tile-sub {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0;
  max-width: 28ch;
}

.tile-arrow {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  flex-shrink: 0;
  transition: all 0.35s var(--ease);
}

.tile-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease);
}

.tile:hover .tile-arrow {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: var(--bg);
}
.tile:hover .tile-arrow svg { transform: translate(3px, -3px); }

/* Accent tints */
.tile--purple .tile-overlay { background: linear-gradient(170deg, rgba(167, 139, 250, 0.22), rgba(12, 12, 14, 0.94)); }
.tile--mint   .tile-overlay { background: linear-gradient(170deg, rgba(110, 231, 183, 0.22), rgba(12, 12, 14, 0.94)); }
.tile--cyan   .tile-overlay { background: linear-gradient(170deg, rgba(103, 232, 249, 0.22), rgba(12, 12, 14, 0.94)); }
.tile--plum   .tile-overlay { background: linear-gradient(170deg, rgba(192, 132, 252, 0.22), rgba(12, 12, 14, 0.94)); }

/* Bento layout — desktop */
.tile--about      { grid-column: span 2; grid-row: span 1; }
.tile--portfolio  { grid-column: span 4; grid-row: span 2; }
.tile--interests  { grid-column: span 2; grid-row: span 1; }
.tile--experience { grid-column: span 3; grid-row: span 1; }
.tile--contact    { grid-column: span 3; grid-row: span 1; }

.tile--portfolio .tile-title { font-size: clamp(38px, 4.8vw, 68px); }

/* ============================================
   Section pages
   ============================================ */

.section-page {
  padding: 140px 0 100px;
  min-height: 100vh;
}

.section-hero {
  margin-bottom: 80px;
  max-width: 920px;
}

.section-hero .eyebrow { margin-bottom: 24px; }

.section-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

.section-hero h1 em {
  font-style: italic;
  color: var(--accent-purple);
}

.section-hero p {
  font-size: clamp(17px, 1.8vw, 20px);
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 60ch;
  font-weight: 300;
}

/* Continue strip */
.continue-strip {
  margin-top: 120px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.continue-strip small {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.continue-strip-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.continue-strip-links a {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--text-soft);
  transition: color 0.25s var(--ease);
}

.continue-strip-links a:hover { color: var(--accent-cyan); }

/* ============================================
   About
   ============================================ */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: start;
}

.about-portrait {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  pointer-events: none;
}

.about-text h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 36px;
  margin: 0 0 20px;
  color: var(--text);
}

.about-text p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-soft);
  margin: 0 0 22px;
}

.about-text p strong {
  color: var(--text);
  font-weight: 500;
}

.about-meta {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.about-meta dt {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.about-meta dd {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

/* ============================================
   Interests
   ============================================ */

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.interest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s var(--ease);
  position: relative;
}

.interest-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-purple);
  box-shadow: 0 24px 48px -18px rgba(167, 139, 250, 0.28);
}

.interest-card-image {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  position: relative;
}

.interest-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(12, 12, 14, 0.7) 100%);
}

.interest-card-tag {
  position: absolute;
  top: 16px; left: 16px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-mint);
}

.interest-card-body { padding: 24px; }

.interest-card-body h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 8px;
}

.interest-card-body p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* ============================================
   Experience / Timeline
   ============================================ */

.timeline {
  position: relative;
  max-width: 920px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent-purple), var(--accent-mint), var(--accent-cyan));
  opacity: 0.5;
}

.timeline-item {
  position: relative;
  padding: 0 0 52px 56px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: 5px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent-purple);
  z-index: 1;
}

.timeline-marker::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--accent-purple);
}

.timeline-item:nth-child(2) .timeline-marker { border-color: var(--accent-mint); }
.timeline-item:nth-child(2) .timeline-marker::after { background: var(--accent-mint); }
.timeline-item:nth-child(3) .timeline-marker { border-color: var(--accent-cyan); }
.timeline-item:nth-child(3) .timeline-marker::after { background: var(--accent-cyan); }
.timeline-item:nth-child(4) .timeline-marker { border-color: var(--accent-plum); }
.timeline-item:nth-child(4) .timeline-marker::after { background: var(--accent-plum); }

.timeline-date {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.timeline-role {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  margin: 0 0 4px;
}

.timeline-company {
  color: var(--accent-cyan);
  font-size: 15px;
  margin: 0 0 14px;
  font-style: italic;
  font-family: var(--font-display);
}

.timeline-desc {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
  max-width: 60ch;
}

.skills-section {
  margin-top: 96px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}

.skills-section h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 42px;
  margin: 0 0 32px;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 14px;
  color: var(--text-soft);
  transition: all 0.25s var(--ease);
}

.skill-tag:hover {
  border-color: var(--accent-mint);
  color: var(--accent-mint);
  transform: translateY(-2px);
}

/* ============================================
   Portfolio
   ============================================ */

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.filter-btn {
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }

.filter-btn.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: var(--bg);
  font-weight: 500;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  grid-auto-flow: dense;
}

.portfolio-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  transition: transform 0.5s var(--ease);
  border: 1px solid var(--border);
}

.portfolio-item--vertical {
  grid-column: span 3;
  aspect-ratio: 9 / 16;
}

.portfolio-item--horizontal {
  grid-column: span 6;
  /* Aspect tuned so a horizontal card's height matches a vertical card's
     (a vertical spans 3 cols 9:16 ≈ same height as 6-col card at 9:8). */
  aspect-ratio: 9 / 8;
}

.portfolio-item--horizontal .portfolio-title { font-size: 30px; }

@media (max-width: 1024px) {
  .portfolio-grid { grid-template-columns: repeat(6, 1fr); gap: 14px; }
  .portfolio-item--vertical  { grid-column: span 3; }
  .portfolio-item--horizontal { grid-column: span 6; }
}

@media (max-width: 640px) {
  .portfolio-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .portfolio-item--vertical  { grid-column: span 2; }  /* 2-up grid */
  .portfolio-item--horizontal { grid-column: span 4; } /* full-width */
  /* NOTE: .portfolio-play, .portfolio-tag and .portfolio-type-badge are
     handled in a LATER @media block so they win the cascade vs the
     desktop rules (which are defined further down this file). */
}

.portfolio-item:hover { transform: translateY(-6px); }

.portfolio-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.8s var(--ease);
}

.portfolio-item:hover .portfolio-thumb { transform: scale(1.08); }

.portfolio-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 12, 14, 0.96) 0%, rgba(12, 12, 14, 0.1) 55%);
  pointer-events: none;
}

.portfolio-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 22px;
  z-index: 2;
  pointer-events: none;
}

.portfolio-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-strong);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  backdrop-filter: blur(6px);
}

.portfolio-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 4px;
  line-height: 1.1;
}

.portfolio-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}

.portfolio-play {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease);
  z-index: 2;
  pointer-events: none;
}

.portfolio-item:hover .portfolio-play {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: var(--bg);
  transform: scale(1.1);
}

.portfolio-play svg { width: 14px; height: 14px; }

/* Video modal */
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 200;
  display: none;
  padding: 60px 24px 40px;
  opacity: 0;
  overflow-y: auto;
  transition: opacity 0.3s var(--ease);
}

.video-modal.open {
  display: block;
  opacity: 1;
}

/* Stacks the player + caption vertically and centers them */
.video-modal-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-height: 100%;
  justify-content: center;
}

.video-modal-inner {
  position: relative;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.video-modal-inner[data-orient="vertical"] {
  max-width: 480px;
  aspect-ratio: 9 / 16;
}

.video-modal-inner[data-orient="horizontal"] {
  max-width: 1080px;
  aspect-ratio: 16 / 9;
}

/* Carousel slides */
.carousel-stage {
  position: absolute;
  inset: 0;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-slide iframe,
.carousel-slide video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Prev / next nav */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              color 0.25s var(--ease), transform 0.25s var(--ease);
}

.carousel-nav:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: var(--bg);
  transform: translateY(-50%) scale(1.06);
}

.carousel-nav svg { width: 18px; height: 18px; }

.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }

.carousel-nav.is-hidden { display: none; }

/* Dots */
.carousel-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 99px;
}

.carousel-dots.is-hidden { display: none; }

.carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  border: 0;
  padding: 0;
}

.carousel-dot.active {
  background: var(--accent-mint);
  width: 24px;
  border-radius: 99px;
}

/* Slide counter */
.carousel-counter {
  position: absolute;
  top: 16px; left: 16px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text);
  z-index: 3;
}

.carousel-counter.is-hidden { display: none; }

/* Card-type badge (shown on carousel cards) */
.portfolio-type-badge {
  position: absolute;
  top: 16px; left: 16px;
  padding: 5px 11px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.portfolio-type-badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.portfolio-type-badge--mint { color: var(--accent-mint); }
.portfolio-type-badge--cyan { color: var(--accent-cyan); }

/* ============================================
   Modal caption (below the player / carousel)
   ============================================ */

.modal-caption {
  width: 100%;
  max-width: 640px;
  text-align: center;
  padding: 0 16px;
}

.modal-caption-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin: 0 0 10px;
}

.modal-caption-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 30px;
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 400;
  line-height: 1.1;
}

.modal-caption-text {
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 18px;
  color: var(--text-soft);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.modal-tag {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.03);
}

/* ============================================
   Header actions (multi-button group)
   ============================================ */

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

@media (max-width: 480px) {
  .header-actions { gap: 6px; }
  .header-actions .back-link { padding: 6px 12px; font-size: 13px; }
}

/* ============================================
   Clients strip (experience page)
   ============================================ */

.clients-strip {
  margin: 0 0 64px;
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.clients-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.clients-list {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 2vw, 22px);
  color: var(--text);
  line-height: 1.5;
}

/* ============================================
   Categorised skills (experience page)
   ============================================ */

.skills-categories {
  display: grid;
  gap: 32px;
}

.skills-category-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-weight: 500;
}

/* ============================================
   Education block (experience page)
   ============================================ */

.education-section {
  margin-top: 96px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}

.education-section h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 42px;
  margin: 0 0 32px;
}

.education-section .timeline-role { font-size: 26px; }
.education-section .timeline-company { margin-bottom: 10px; }

/* ============================================
   Header navigation (hover-open on desktop, tap on mobile)
   ============================================ */

.header-nav {
  position: relative;
}

.header-nav-toggle {
  width: 40px; height: 40px;
  border-radius: 99px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.header-nav-toggle:hover,
.header-nav.is-open .header-nav-toggle {
  border-color: var(--accent-purple);
  background: rgba(167, 139, 250, 0.08);
}

.header-nav-icon,
.header-nav-icon::before,
.header-nav-icon::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}

.header-nav-icon {
  position: relative;
  transition: background 0.2s var(--ease);
}

.header-nav-icon::before,
.header-nav-icon::after {
  content: "";
  position: absolute;
  left: 0;
  transition: transform 0.25s var(--ease), top 0.25s var(--ease);
}

.header-nav-icon::before { top: -5px; }
.header-nav-icon::after  { top:  5px; }

/* Hamburger → X morph */
.header-nav.is-open .header-nav-icon { background: transparent; }
.header-nav.is-open .header-nav-icon::before { top: 0; transform: rotate(45deg); }
.header-nav.is-open .header-nav-icon::after  { top: 0; transform: rotate(-45deg); }

.header-nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 200px;
  background: rgba(28, 28, 34, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  list-style: none;
  margin: 0;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

/* Invisible bridge so the cursor can travel from toggle → menu without losing hover */
.header-nav-menu::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0; right: 0;
  height: 16px;
}

.header-nav-menu li { list-style: none; }

.header-nav-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--text-soft);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.header-nav-menu a::after {
  content: "→";
  font-style: normal;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  color: var(--accent-purple);
}

.header-nav-menu a:hover {
  background: rgba(167, 139, 250, 0.12);
  color: var(--text);
}

.header-nav-menu a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Hover-trigger (desktop) */
@media (hover: hover) and (pointer: fine) {
  .header-nav:hover .header-nav-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Tap-trigger (mobile / explicit toggle) */
.header-nav.is-open .header-nav-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================================
   Home page — single-screen side-by-side
   ============================================ */

.home-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 0 32px;
  position: relative;
  overflow: hidden;
}

.home-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.home-hero { max-width: 56ch; }

.home-hero .eyebrow { margin-bottom: 22px; }

.home-hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 76px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.home-hero-title em {
  font-style: italic;
  color: var(--accent-purple);
}

.home-hero-intro {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0;
  max-width: 50ch;
  font-weight: 300;
}

.home-tiles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  max-height: 78vh;
}

.home-tile {
  position: relative;
  flex: 1 1 0;
  min-height: 150px;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  background: var(--surface);
  isolation: isolate;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.home-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.55);
}

.home-tile .tile-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  transition: transform 0.9s var(--ease);
}

.home-tile:hover .tile-image { transform: scale(1.05); }

.home-tile .tile-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(170deg, rgba(12,12,14,0.45), rgba(12,12,14,0.92));
  transition: opacity 0.45s var(--ease);
}

.home-tile.tile--purple .tile-overlay { background: linear-gradient(170deg, rgba(167,139,250,0.22), rgba(12,12,14,0.94)); }
.home-tile.tile--cyan   .tile-overlay { background: linear-gradient(170deg, rgba(103,232,249,0.22), rgba(12,12,14,0.94)); }
.home-tile.tile--mint   .tile-overlay { background: linear-gradient(170deg, rgba(110,231,183,0.22), rgba(12,12,14,0.94)); }
.home-tile.tile--plum   .tile-overlay { background: linear-gradient(170deg, rgba(192,132,252,0.22), rgba(12,12,14,0.94)); }

.home-tile .tile-content {
  position: absolute;
  inset: 0;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-tile .tile-number {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: var(--text-soft);
  opacity: 0.75;
}

.home-tile .tile-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.home-tile .tile-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.0;
  margin: 0 0 4px;
  font-weight: 400;
}

.home-tile .tile-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}

.home-tile .tile-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
  transition: all 0.35s var(--ease);
}

.home-tile .tile-arrow svg {
  width: 14px; height: 14px;
  transition: transform 0.3s var(--ease);
}

.home-tile:hover .tile-arrow {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: var(--bg);
}
.home-tile:hover .tile-arrow svg { transform: translate(2px, -2px); }

@media (max-width: 1000px) {
  .home-main {
    min-height: auto;
    padding: 110px 0 60px;
  }
  .home-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .home-tiles {
    max-height: none;
    height: auto;
  }
  .home-tile { min-height: 140px; }
}

@media (max-width: 640px) {
  .home-main { padding-top: 100px; }
  .home-tile { min-height: 130px; }

  /* Portfolio mobile cleanup — placed AFTER the desktop rules so it wins.
     Hides the play badge and the eyebrow tag entirely on narrow viewports.
     The type-badge ("3 videos" / "5 photos") stays since it carries info. */
  .portfolio-play  { display: none; }
  .portfolio-tag   { display: none; }
}

/* ============================================
   Performance — content-visibility + reduced GPU work
   ============================================ */

/* Skip rendering off-screen portfolio cards entirely until they approach viewport */
.portfolio-item {
  content-visibility: auto;
  contain-intrinsic-size: 300px 540px;
}

.portfolio-item--horizontal {
  contain-intrinsic-size: 600px 540px;
}

/* Drop backdrop-filter from small, repeated UI elements (low visual gain, high GPU cost) */
.portfolio-play,
.portfolio-type-badge,
.carousel-dots,
.carousel-counter {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Lighter ambient blur — still soft, much cheaper to composite */
.hero-ambient::before,
.hero-ambient::after {
  filter: blur(60px);
}
.hero-ambient::before { width: 460px; height: 460px; }
.hero-ambient::after  { width: 360px; height: 360px; }

/* Lighter header backdrop blur */
.site-header {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ============================================
   Lite mode — auto-applied on low-power machines, or via footer toggle.
   Strips the GPU-expensive effects so the page feels snappy on older
   Intel Macs and budget laptops. Activated by <html data-lite="true">,
   set in guard.js before first paint.
   ============================================ */

/* Native cursor */
[data-lite="true"] body { cursor: auto !important; }
[data-lite="true"] .cursor { display: none !important; }
[data-lite="true"] a,
[data-lite="true"] button,
[data-lite="true"] .tile,
[data-lite="true"] .home-tile,
[data-lite="true"] .portfolio-item,
[data-lite="true"] .filter-btn,
[data-lite="true"] .social-link,
[data-lite="true"] .contact-big-email { cursor: pointer !important; }
[data-lite="true"] input,
[data-lite="true"] textarea { cursor: text !important; }

/* Remove backdrop-filter blurs (one of the most expensive properties) */
[data-lite="true"] .site-header,
[data-lite="true"] .header-nav-menu,
[data-lite="true"] .video-modal-inner,
[data-lite="true"] .carousel-nav,
[data-lite="true"] .gate-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Solid fallback backgrounds where the blur used to provide opacity */
[data-lite="true"] .site-header     { background: rgba(12, 12, 14, 0.96); }
[data-lite="true"] .header-nav-menu { background: rgba(28, 28, 34, 0.98); }
[data-lite="true"] .gate-card       { background: rgba(28, 28, 34, 0.96); }

/* Kill the continuous-animation grain + ambient gradients */
[data-lite="true"] body::before { display: none; }
[data-lite="true"] .hero-ambient { display: none; }
[data-lite="true"] .hero-ambient::before,
[data-lite="true"] .hero-ambient::after { animation: none; }

/* No expensive hover transforms — keep the rest of the visual */
[data-lite="true"] .tile:hover,
[data-lite="true"] .home-tile:hover,
[data-lite="true"] .portfolio-item:hover,
[data-lite="true"] .interest-card:hover {
  transform: none;
  box-shadow: none;
}
[data-lite="true"] .tile:hover .tile-image,
[data-lite="true"] .home-tile:hover .tile-image,
[data-lite="true"] .portfolio-item:hover .portfolio-thumb,
[data-lite="true"] .interest-card:hover .interest-card-image {
  transform: none;
}

.video-modal-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
  z-index: 250;
}

.video-modal-close:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: var(--bg);
  transform: rotate(90deg);
}

/* ============================================
   Contact
   ============================================ */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.contact-big-email {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 52px);
  font-weight: 400;
  display: inline-block;
  line-height: 1.05;
  margin: 0 0 32px;
  position: relative;
  word-break: break-word;
}

.contact-big-email::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--accent-purple);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.contact-big-email:hover::after { transform: scaleX(1); }

.contact-section {
  margin-bottom: 36px;
}

.contact-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.contact-detail {
  font-size: 17px;
  color: var(--text);
  margin: 0;
}

.socials {
  display: grid;
  gap: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.3s var(--ease);
}

.social-link:hover {
  border-color: var(--accent-mint);
  background: rgba(110, 231, 183, 0.05);
  transform: translateX(4px);
}

.social-link .icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--ease);
  flex-shrink: 0;
}

.social-link:hover .icon {
  background: var(--accent-mint);
  color: var(--bg);
}

.social-link .icon svg { width: 18px; height: 18px; }

.social-link-text { flex: 1; }
.social-link-name { font-size: 15px; color: var(--text); margin: 0; font-weight: 500; }
.social-link-handle { font-size: 13px; color: var(--text-muted); margin: 2px 0 0; }

.social-link-arrow {
  color: var(--text-muted);
  transition: all 0.3s var(--ease);
  flex-shrink: 0;
}

.social-link:hover .social-link-arrow {
  color: var(--accent-mint);
  transform: translate(2px, -2px);
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.contact-form h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  margin: 0 0 6px;
}

.contact-form .form-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s var(--ease);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--accent-purple);
  color: var(--bg);
  border: 0;
  border-radius: 99px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.btn:hover {
  background: var(--accent-mint);
  transform: translateY(-2px);
}

.btn svg { transition: transform 0.2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

/* ============================================
   Footer
   ============================================ */

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-socials {
  display: flex;
  gap: 22px;
}

.footer-socials a:hover { color: var(--accent-mint); }

/* ============================================
   Reveal animations
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.00s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.07s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.14s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.21s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.28s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.35s; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 0.42s; }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: 0.49s; }

/* ============================================
   Custom cursor (desktop only)
   ============================================ */

@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, .tile, .portfolio-item, input, textarea,
  .filter-btn, .social-link, .contact-big-email { cursor: none; }

  .cursor {
    position: fixed;
    top: 0; left: 0;
    width: 10px; height: 10px;
    background: var(--accent-mint);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.25s var(--ease), height 0.25s var(--ease), background 0.25s var(--ease);
    will-change: transform;
    /* mix-blend-mode removed — it was forcing a full-screen recomposite
       every frame which made the cursor stutter on Intel-era laptops. */
  }

  .cursor.hover {
    width: 44px; height: 44px;
    background: var(--accent-purple);
  }

  input, textarea { cursor: text !important; }
}

/* ============================================
   Page-load fade
   ============================================ */

body:not(.loaded) main { opacity: 0; }
main {
  opacity: 1;
  transition: opacity 0.6s var(--ease-out);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1000px) {
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 200px;
  }
  .tile--about,
  .tile--interests,
  .tile--experience,
  .tile--contact { grid-column: span 1; }
  .tile--portfolio { grid-column: span 2; grid-row: span 2; }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }

  .bento {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }
  .tile--about,
  .tile--interests,
  .tile--experience,
  .tile--contact,
  .tile--portfolio {
    grid-column: span 1;
    grid-row: span 1;
  }
  .tile--portfolio { grid-row: span 2; }

  .hero { padding: 110px 0 60px; }
  .section-page { padding: 100px 0 60px; }
  .section-hero { margin-bottom: 56px; }

  .tile-content { padding: 22px; }
  .tile-arrow { width: 38px; height: 38px; }

  .timeline-item { padding-left: 44px; }
  .timeline-role { font-size: 24px; }

  .contact-form { padding: 24px; }
  .about-meta { grid-template-columns: 1fr; }

  .continue-strip-links a { font-size: 18px; }
}

/* ============================================
   Reduced motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
  .hero-ambient::before,
  .hero-ambient::after { animation: none; }
}

/* ============================================
   Access gate
   ============================================ */

.gate-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.gate-body main {
  width: 100%;
  position: relative;
  z-index: 2;
}

.gate-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.gate-ambient::before,
.gate-ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}
.gate-ambient::before {
  width: 560px; height: 560px;
  background: var(--accent-purple);
  top: -15%; right: -10%;
  opacity: 0.32;
  animation: drift 22s ease-in-out infinite alternate;
}
.gate-ambient::after {
  width: 460px; height: 460px;
  background: var(--accent-mint);
  bottom: -15%; left: -10%;
  opacity: 0.22;
  animation: drift 26s ease-in-out infinite alternate-reverse;
}

.gate-card {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 0 auto;
  padding: 48px;
  background: rgba(28, 28, 34, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), filter 0.5s var(--ease);
}

.gate-card.success {
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
  filter: blur(4px);
}

.gate-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text-soft);
  margin-bottom: 28px;
}
.gate-wordmark .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-mint);
  box-shadow: 0 0 12px var(--accent-mint);
  animation: pulse 2.6s infinite;
}

.gate-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.gate-title em {
  font-style: italic;
  color: var(--accent-purple);
}

.gate-intro {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0 0 28px;
  font-weight: 300;
}

.gate-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.gate-input {
  flex: 1;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.01em;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.gate-input::placeholder { color: var(--text-muted); }
.gate-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: rgba(167, 139, 250, 0.06);
}

.gate-submit {
  padding: 0 26px;
  border: 0;
  border-radius: 99px;
  background: var(--accent-purple);
  color: var(--bg);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.gate-submit:hover {
  background: var(--accent-mint);
  transform: translateY(-1px);
}
.gate-submit svg { transition: transform 0.2s var(--ease); }
.gate-submit:hover svg { transform: translateX(3px); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.gate-form.error { animation: shake 0.42s var(--ease); }
.gate-form.error .gate-input { border-color: var(--accent-plum); }

.gate-error {
  display: block;
  font-size: 14px;
  color: var(--accent-plum);
  margin: 0;
  opacity: 0;
  transform: translateY(-4px);
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              max-height 0.3s var(--ease), margin 0.3s var(--ease);
}
.gate-error.show {
  opacity: 1;
  transform: translateY(0);
  max-height: 4em;
  margin: 16px 0 0;
}

.gate-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.gate-footer em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-soft);
  letter-spacing: 0;
  font-size: 13px;
}

@media (max-width: 520px) {
  .gate-card { padding: 32px 24px; }
  .gate-form { flex-direction: column; }
  .gate-submit { padding: 14px 24px; justify-content: center; }
}

/* Subtle "Lock" link in footer */
.lock-link {
  color: var(--text-muted);
  opacity: 0.55;
  transition: all 0.25s var(--ease);
}
.lock-link:hover {
  opacity: 1;
  color: var(--accent-plum);
}
