/* === TOKENS === */
:root {
  --bg:             #0e0e0e;
  --bg-elevated:    #161616;
  --bg-hover:       #1c1c1c;
  --border:         rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(255, 255, 255, 0.15);
  --text-primary:   #e8e8e8;
  --text-bright:    #d4d3d2;
  --text-secondary: #888888;
  --text-muted:     #444444;
  --white:          #ffffff;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --bg-glass: rgba(14, 14, 14, 0.8);
  --terminal-bg:  #111111;
  --terminal-dot: #333333;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  top: -100px; left: 0;
  padding: 12px 20px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  z-index: 200;
  transition: top 200ms;
}
.skip-link:focus { top: 0; }

/* === TYPOGRAPHY === */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 400;
}
.eyebrow-with-line {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.eyebrow-with-line::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--text-muted);
}

.eyebrow-with-line::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--text-muted);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--white);
  line-height: 1.05;
}

/* === PRIMITIVES === */
.nav-link, .underline-hover {
  position: relative;
  display: inline-block;
}
.nav-link::after, .underline-hover::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%;
  height: 1px;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-link:hover::after, .underline-hover:hover::after { transform: scaleX(1); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--white);
  color: var(--bg);
}
.btn-primary:hover { background: var(--text-secondary); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  border-color: var(--white);
  color: var(--white);
}

.tilt-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.4s var(--ease), border-color 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.tilt-card:hover { border-color: var(--border-hover); }

/* === BACKGROUND === */
#dot-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms linear;
}
body.dots-ready #dot-grid { opacity: 1; }

.floating-shapes {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.05);
}
.floating-shapes .shape {
  position: absolute;
  opacity: 0;
  transition: opacity 400ms linear;
  will-change: transform;
}
body.shapes-ready .floating-shapes .shape { opacity: 1; }

.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
  z-index: 60;
  pointer-events: none;
}
.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--white);
  will-change: width;
}

.shape-1  { top:  8%; left:  6%; width:  90px; animation: float-a 22s ease-in-out infinite, spin-a 45s linear infinite; }
.shape-2  { top: 22%; left: 82%; width:  60px; animation: float-b 18s ease-in-out infinite, spin-b 38s linear infinite; }
.shape-3  { top: 48%; left: 12%; width: 100px; animation: float-c 25s ease-in-out infinite, spin-a 52s linear infinite; }
.shape-4  { top: 60%; left: 70%; width:  45px; animation: float-a 20s ease-in-out infinite, spin-b 30s linear infinite; }
.shape-5  { top: 80%; left: 76%; width:  75px; animation: float-b 24s ease-in-out infinite, spin-a 42s linear infinite; }
.shape-6  { top: 32%; left: 48%; width:  55px; animation: float-c 19s ease-in-out infinite, spin-b 50s linear infinite; }
.shape-7  { top: 12%; left: 38%; width: 110px; animation: float-a 23s ease-in-out infinite, spin-a 60s linear infinite; }
.shape-8  { top: 70%; left: 92%; width:  40px; animation: float-b 17s ease-in-out infinite, spin-b 36s linear infinite; }
.shape-9  { top:  4%; left: 60%; width:  85px; animation: float-c 26s ease-in-out infinite, spin-a 55s linear infinite; }
.shape-10 { top: 90%; left: 64%; width:  70px; animation: float-a 28s ease-in-out infinite, spin-b 70s linear infinite; }
.shape-11 { top: 38%; left: 22%; width:  95px; animation: float-b 21s ease-in-out infinite, spin-a 48s linear infinite; }
.shape-12 { top: 65%; left: 70%; width:  70px; animation: float-c 23s ease-in-out infinite, spin-b 40s linear infinite; }
.shape-13 { top: 18%; left: 18%; width: 105px; animation: float-a 27s ease-in-out infinite, spin-b 58s linear infinite; }
.shape-14 { top: 52%; left: 88%; width:  55px; animation: float-b 19s ease-in-out infinite, spin-a 44s linear infinite; }
.shape-15 { top: 86%; left:  4%; width: 120px; animation: float-c 30s ease-in-out infinite, spin-b 65s linear infinite; }
.shape-16 { top: 40%; left: 56%; width:  65px; animation: float-a 18s ease-in-out infinite, spin-a 50s linear infinite; }

/* float keyframes use the `translate` property (not `transform`) so the
   parallax JS can compose its own `transform: translateY(...)` on top
   without overwriting the float animation. Both `translate` and `rotate`
   are independent CSS properties from `transform`. */
@keyframes float-a {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -30px; }
}
@keyframes float-b {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 25px; }
}
@keyframes float-c {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -20px; }
}
@keyframes spin-a {
  from { rotate: 0deg; }
  to   { rotate: 360deg; }
}
@keyframes spin-b {
  from { rotate: 0deg; }
  to   { rotate: -360deg; }
}

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity 800ms linear;
}
body.is-loaded .grain-overlay { opacity: 0.035; }

/* === CURSOR === */
.cursor-ring, .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 200ms;
}
@media (hover: hover) and (pointer: fine) {
  body.cursor-active { cursor: none; }
  body.cursor-active a,
  body.cursor-active button,
  body.cursor-active .tilt-card { cursor: none; }
  body.cursor-active .cursor-ring,
  body.cursor-active .cursor-dot { opacity: 1; }
}
.cursor-ring {
  width: 40px; height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), opacity 0.3s var(--ease);
}
.cursor-ring.is-hover {
  width: 60px; height: 60px;
  border-color: rgba(255, 255, 255, 0.15);
}
.cursor-dot {
  width: 8px; height: 8px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* === INTRO === */
.intro-line {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 1px;
  background: var(--white);
  z-index: 150;
  opacity: 1;
  transition: width 600ms var(--ease), opacity 300ms linear 600ms;
}
body.intro-expand .intro-line { width: 80vw; }
body.intro-fade   .intro-line { opacity: 0; }

/* === ANIMATE === */
[data-animate] {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-text-reveal] { display: inline-block; }
[data-text-reveal] .word,
[data-text-reveal] .letter {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
[data-text-reveal] .word-inner,
[data-text-reveal] .letter-inner {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.7s ease;
}
[data-text-reveal].is-visible .word-inner,
[data-text-reveal].is-visible .letter-inner {
  transform: translateY(0);
  opacity: 1;
}
[data-text-reveal] .space {
  display: inline-block;
  width: 0.25em;
}

[data-intro] {
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transform: translateY(20px);
}
[data-intro].is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* === NAV === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  z-index: 50;
  transition: background 400ms ease, backdrop-filter 400ms ease, border-color 400ms ease;
  background: transparent;
  border-bottom: 1px solid transparent;
  opacity: 0;
  transform: translateY(-20px);
}
body.nav-ready .nav {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease),
              background 400ms ease, backdrop-filter 400ms ease, border-color 400ms ease;
}
.nav.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 300ms ease;
}
.nav-link:hover { color: var(--white); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px 4px 8px;
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--white);
  animation: status-pulse 2s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.5; }
}
.status-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.nav-hamburger {
  display: none;
  width: 32px; height: 32px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  transition: background 200ms;
}
.nav-hamburger:hover span { background: var(--white); }

/* === HERO === */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  z-index: 10;
}
.hero-inner {
  max-width: 900px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--white);
  line-height: 1;
}
.hero-tagline {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 500px;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: opacity 400ms ease;
}
.hero-scroll.is-faded { opacity: 0; pointer-events: none; }
.hero-scroll-line {
  display: block;
  width: 1px;
  height: 40px;
  background: var(--text-muted);
  position: relative;
  overflow: hidden;
}
.hero-scroll-dot {
  position: absolute;
  top: -8px; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--white);
  transform: translateX(-50%);
  animation: scroll-dot 2s linear infinite;
}
@keyframes scroll-dot {
  0%   { top: -8px;  opacity: 1; }
  80%  { top: 40px;  opacity: 0; }
  100% { top: 40px;  opacity: 0; }
}
@media (max-width: 768px) {
  .hero-inner { gap: 24px; }
}

/* === ABOUT === */
#about {
  position: relative;
  padding: clamp(6rem, 14vh, 12rem) 24px;
  z-index: 10;
}
.about-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
}
.about-body1 {
  display: flex;
  flex-direction: row;
  gap: 50px;
  max-width: 650px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-secondary);
}

.about-body2 {
  display: flex;
  flex-direction: row;
  gap: 50px;
  max-width: 650px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-secondary);
}


.about-pextra {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text-bright);
}
@media (max-width: 768px) {
  .about-body1, .about-body2 { flex-direction: column; gap: 16px; }
}

/* === PHOTOGRAPHY === */
#photography {
  position: relative;
  padding: clamp(6rem, 14vh, 12rem) 0;
  z-index: 10;
}
#photography .section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.photo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 48px;
}
.photo-header-text { display: flex; flex-direction: column; gap: 16px; }
.photo-badge {
  position: relative;
  width: 100px; height: 100px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.photo-badge-ring {
  width: 100%; height: 100%;
  animation: spin-badge 15s linear infinite;
}
.photo-badge-icon {
  position: absolute;
  top: 50%; left: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  color: var(--text-secondary);
}
@keyframes spin-badge { from { rotate: 0deg; } to { rotate: 360deg; } }

.photo-carousel-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 32px;
  /* Fade the edges so cards drift in/out without hard cuts */
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 60px, black calc(100% - 60px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, black 60px, black calc(100% - 60px), transparent 100%);
  /* Hide the scrollbar but keep the area scrollable */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Smooth touch scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.photo-carousel-viewport::-webkit-scrollbar { display: none; }
.photo-carousel-viewport:active { cursor: grabbing; }
.photo-carousel-track {
  display: flex;
  gap: 20px;
  width: max-content;
  will-change: scroll-position;
}
.photo-card {
  position: relative;
  flex: 0 0 340px;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
}
.photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.photo-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 400ms ease;
}
.photo-caption-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--white);
  transform: translateY(10px);
  transition: transform 400ms var(--ease);
}
.photo-caption-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
  transform: translateY(10px);
  transition: transform 400ms var(--ease) 60ms;
}
.photo-card:hover img { transform: scale(1.08); }
.photo-card:hover .photo-caption { opacity: 1; }
.photo-card:hover .photo-caption-title,
.photo-card:hover .photo-caption-sub { transform: translateY(0); }

.photo-locations {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-align: center;
  margin-top: 32px;
}
@media (max-width: 768px) {
  .photo-header { flex-direction: column; align-items: flex-start; }
  .photo-card { flex: 0 0 75vw; }
}
/* === SKILLS === */
#skills {
  position: relative;
  padding: clamp(6rem, 14vh, 12rem) 24px;
  z-index: 10;
}
.skills-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.skills-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.skills-card {
  padding: 32px;
  opacity: 0;
  translate: 0 50px;
  /* Entry uses `translate` so tilt JS that writes `transform: perspective(...)`
     on hover composes cleanly with the .tilt-card primitive's 0.4s transition. */
  transition: opacity 0.9s var(--ease), translate 0.9s var(--ease),
              transform 0.4s var(--ease), border-color 0.4s ease;
}
.skills-card.is-visible { opacity: 1; translate: 0 0; }
.skills-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.skills-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
              background 300ms ease, border-color 300ms ease, color 300ms ease;
}
.pill.is-visible { opacity: 1; transform: translateY(0); }
.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
@media (max-width: 768px) {
  .skills-grid { grid-template-columns: 1fr; }
}
/* === TERMINAL === */
#terminal {
  position: relative;
  padding: clamp(4rem, 10vh, 8rem) 24px;
  z-index: 10;
}
.terminal-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.terminal-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.terminal-subtext {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 520px;
}
.terminal-stage {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
}
.terminal-accent {
  flex: 0 0 60px;
  width: 60px;
  height: auto;
  color: var(--text-muted);
  opacity: 0.5;
  animation: terminal-accent-pulse 4s ease-in-out infinite;
}
.terminal-accent-right { animation-delay: 2s; }
@keyframes terminal-accent-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.65; }
}
.terminal-wrap {
  flex: 1 1 auto;
  max-width: 920px;
}
.terminal-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.terminal-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
@media (max-width: 768px) {
  .terminal-accent { display: none; }
  .terminal-stage { gap: 0; }
  .terminal-inner { gap: 32px; }
}
.terminal-card {
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.terminal-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.terminal-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--terminal-dot);
}
.terminal-label {
  margin-left: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.terminal-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.terminal-cursor {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: inline-block;
  margin-left: 24px;
  margin-bottom: 24px;
}
.blink {
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  0%, 50%  { opacity: 1; }
  51%, 100% { opacity: 0; }
}
/* === CONTACT === */
#contact {
  position: relative;
  min-height: 100vh;
  padding: clamp(6rem, 14vh, 12rem) 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-inner {
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}
.contact-subtext {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 500px;
}
.contact-email {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 12px;
}
.contact-socials {
  display: flex;
  gap: 32px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.contact-social {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), color 200ms ease;
}
.contact-social:hover { color: var(--white); }
.contact-social.is-visible { opacity: 1; transform: translateY(0); }
.contact-divider {
  width: 120px;
  height: 1px;
  background: var(--border);
  border: none;
  margin-top: 80px;
}
.contact-footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
@media (max-width: 768px) {
  .contact-footer { flex-direction: column; gap: 12px; align-items: center; }
}

/* === VAULT === */
.is-vault { /* page-specific body class for any vault-only overrides */ }

/* Active state for the Vault link in the main nav */
.nav-link[aria-current="page"] { color: var(--white); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.mobile-menu-link[aria-current="page"] { color: var(--white); }

/* Hold below-the-fold content on EVERY page until the intro line has
   fully faded (body.shapes-ready fires at t=900ms in Portfolio.intro,
   matching the moment the line opacity reaches 0). This keeps the
   line and the page content from overlapping during inter-page
   navigation (e.g. vault -> index.html#about). */
#about, #photography, #skills, #terminal, #contact,
.is-vault .vault-layout {
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.is-vault .vault-layout {
  transform: translateY(16px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
body.shapes-ready #about,
body.shapes-ready #photography,
body.shapes-ready #skills,
body.shapes-ready #terminal,
body.shapes-ready #contact,
.is-vault.shapes-ready .vault-layout {
  opacity: 1;
}
.is-vault.shapes-ready .vault-layout {
  transform: translateY(0);
}

/* Vault header (top of vault.html, above the sidebar layout) */
.vault-header {
  position: relative;
  padding: clamp(7rem, 12vh, 10rem) 24px clamp(3rem, 6vh, 5rem);
  z-index: 10;
}
.vault-header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}
.vault-tagline {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 560px;
}

/* Sidebar + content layout */
.vault-layout {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px clamp(6rem, 12vh, 10rem);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}

.vault-sidebar {
  position: sticky;
  top: 96px; /* clears the fixed nav (72px) + a touch */
  display: flex;
  flex-direction: column;
  margin-left: -32px; /* nudge sidebar slightly left of the layout edge */
}
.vault-sidebar-toggle {
  display: none; /* hidden on desktop, shown on mobile */
}
.vault-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vault-tab {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
  cursor: pointer;
}
.vault-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.vault-tab[aria-selected="true"] {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

/* Content panels */
.vault-content {
  min-width: 0; /* allow children to shrink */
}
.vault-panel {
  /* Panel transition is handled by JS in Phase 2 Task 6 (fade+slide via CSS) */
  animation: vault-panel-in 360ms var(--ease);
}
.vault-panel[hidden] { display: none; }
@keyframes vault-panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .vault-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .vault-sidebar {
    position: relative;
    top: auto;
  }
  .vault-sidebar-toggle {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .vault-sidebar-toggle::before { content: "Sections"; }
  .vault-sidebar-toggle::after  { content: "+"; font-size: 1.25rem; }
  .vault-sidebar-toggle[aria-expanded="true"]::after { content: "−"; }
  .vault-sidebar-nav {
    display: none;
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
  }
  .vault-sidebar-nav.is-open { display: flex; }
}
@media (max-width: 768px) {
  .vault-header { padding: clamp(6rem, 12vh, 8rem) 16px clamp(2rem, 5vh, 3rem); }
  .vault-layout { padding-left: 16px; padding-right: 16px; }
}

/* Vault panel shared header */
.vault-panel-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}
.vault-panel-heading {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--white);
  line-height: 1.1;
}
.vault-panel-sub {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 540px;
}

/* Projects grid */
.vault-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.vault-project {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vault-project-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-elevated) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow: hidden;
}
.vault-project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}
.vault-project:hover .vault-project-cover img { transform: scale(1.04); }

/* Empty-state shown in sections that have no entries yet */
.vault-empty {
  padding: 56px 24px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  color: var(--text-secondary);
}
.vault-empty-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}
.vault-empty-sub {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 380px;
}
.vault-project-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vault-project-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.vault-project-blurb {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.vault-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}
.vault-tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.vault-project-links {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Research & Writing entry list */
.vault-entry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}
.vault-entry {
  border-bottom: 1px solid var(--border);
}
.vault-entry-head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 24px 4px;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.vault-entry-head:hover .vault-entry-title { color: var(--white); }
.vault-entry-title {
  font-family: var(--font-display);
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 6px;
  transition: color 200ms ease;
}
.vault-entry-excerpt {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 60ch;
}
.vault-entry-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}
.vault-entry-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.vault-entry-body {
  padding: 0 4px 24px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vault-entry-body[hidden] { display: none; }
.vault-entry[data-vault-expand].is-open .vault-entry-head { padding-bottom: 12px; }
@media (max-width: 640px) {
  .vault-entry-head { flex-direction: column; gap: 12px; }
  .vault-entry-meta { align-items: flex-start; text-align: left; }
}

/* Photo Albums */
.vault-album { margin-bottom: 56px; }
.vault-album-header { margin-bottom: 16px; }
.vault-album-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.vault-album-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.vault-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.vault-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 0;
  cursor: zoom-in;
  transition: border-color 200ms ease, transform 300ms var(--ease);
}
.vault-photo:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.vault-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms var(--ease);
}
.vault-photo:hover img { transform: scale(1.04); }
@media (max-width: 480px) {
  .vault-album-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Photo morph overlay */
.photo-morph {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}
.photo-morph.is-active { display: block; }
.photo-morph[aria-hidden="false"] { display: block; }

.photo-morph-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 14, 14, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 500ms var(--ease);
}
.photo-morph.is-active .photo-morph-backdrop { opacity: 1; }

.photo-morph-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.photo-morph-figure {
  position: relative;
  display: flex;
  gap: 32px;
  align-items: center;
}
.photo-morph-figure[data-orientation="landscape"] {
  flex-direction: column;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  padding: 48px;
}
.photo-morph-figure[data-orientation="portrait"] {
  position: absolute;
  inset: 0;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 48px;
  gap: 40px;
}
.photo-morph-img {
  display: block;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  will-change: transform, opacity;
}
.photo-morph-figure[data-orientation="landscape"] .photo-morph-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 68vh;
}
.photo-morph-figure[data-orientation="portrait"] .photo-morph-img {
  width: auto;
  height: auto;
  max-width: 60vw;
  max-height: 100%;
}
.photo-morph-meta {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--text-primary);
  max-width: 460px;
  min-width: 280px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms var(--ease) 250ms, transform 400ms var(--ease) 250ms;
}
.photo-morph.is-active .photo-morph-meta { opacity: 1; transform: translateY(0); }
.photo-morph-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}
.photo-morph-fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.photo-morph-fields dt { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.photo-morph-fields dd { color: var(--text-primary); }

/* Portrait: meta panel sits on the right — text right-aligned to match */
.photo-morph-figure[data-orientation="portrait"] .photo-morph-meta {
  text-align: right;
  align-items: flex-end;
}
.photo-morph-figure[data-orientation="portrait"] .photo-morph-fields {
  grid-template-columns: 1fr max-content;
  direction: rtl;
}
.photo-morph-figure[data-orientation="portrait"] .photo-morph-fields dt,
.photo-morph-figure[data-orientation="portrait"] .photo-morph-fields dd {
  direction: ltr;
}
.photo-morph-figure[data-orientation="portrait"] .photo-morph-fields dt { text-align: right; }
.photo-morph-figure[data-orientation="portrait"] .photo-morph-fields dd { text-align: left; }
.photo-morph-notes {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.photo-morph-close,
.photo-morph-prev,
.photo-morph-next {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
}
.photo-morph-close,
.photo-morph-prev,
.photo-morph-next { z-index: 2; }
.photo-morph-close { top: 24px; right: 24px; }
.photo-morph-prev  { top: 50%; left: 24px;  transform: translateY(-50%); }
.photo-morph-next  { top: 50%; right: 24px; transform: translateY(-50%); }
.photo-morph-close:hover,
.photo-morph-prev:hover,
.photo-morph-next:hover { border-color: var(--border-hover); color: var(--white); }

@media (max-width: 768px) {
  .photo-morph-figure[data-orientation="portrait"] { flex-direction: column; }
  .photo-morph-figure[data-orientation="portrait"] .photo-morph-img { width: 86vw; max-width: 86vw; height: auto; max-height: 60vh; }
  .photo-morph-figure[data-orientation="landscape"] .photo-morph-img { width: 92vw; height: auto; max-height: 50vh; }
  .photo-morph-meta { max-width: 90vw; }
  .photo-morph-prev, .photo-morph-next { display: none; }
}

/* === MOBILE MENU === */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.mobile-menu:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu-close {
  position: absolute;
  top: 24px; right: 24px;
  font-size: 2rem;
  color: var(--text-secondary);
  padding: 12px;
  line-height: 1;
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}
.mobile-menu-link {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--white);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 400ms var(--ease), transform 400ms var(--ease);
}
.mobile-menu:not([hidden]) .mobile-menu-link { opacity: 1; transform: translateY(0); }
.mobile-menu:not([hidden]) .mobile-menu-link:nth-child(1) { transition-delay: 80ms; }
.mobile-menu:not([hidden]) .mobile-menu-link:nth-child(2) { transition-delay: 160ms; }
.mobile-menu:not([hidden]) .mobile-menu-link:nth-child(3) { transition-delay: 240ms; }
.mobile-menu:not([hidden]) .mobile-menu-link:nth-child(4) { transition-delay: 320ms; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .nav-inner { padding: 0 24px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .status-pill { display: none; }
  .nav-inner { padding: 0 16px; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 300ms !important;
    transition-delay: 0ms !important;
  }
  .floating-shapes .shape { animation: none !important; }
  [data-animate], [data-text-reveal], [data-intro] { transform: none !important; }
  [data-text-reveal] .word-inner,
  [data-text-reveal] .letter-inner { transform: none !important; }
}
