/* ═══════════════════════════════════════════════════════════
   KAMRAN MEDIA — CINEMATIC EDITORIAL
   Aesthetic: dark-room meets film strip meets motion reel
═══════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg:           #d6d2c8;
  --bg2:          #ccc8be;
  --surface:      #dedad2;
  --border:       #b8b3aa;
  --text:         #1a1814;
  --text-muted:   #5a5750;
  --text-faint:   #8a8780;
  --accent:       #1a1814;
  --accent-warm:  #c8a96e;
  --button-bg:    #1a1814;
  --button-text:  #dedad2;
  --shadow:       rgba(26,24,20,0.12);
  --shadow-deep:  rgba(26,24,20,0.26);
  --grain-opacity: 0.14;
}

:root.dark-mode, .dark-mode {
  --bg:           #0e0d0b;
  --bg2:          #161410;
  --surface:      #1c1a16;
  --border:       #2e2b25;
  --text:         #ede9e0;
  --text-muted:   #8c8880;
  --text-faint:   #524f4a;
  --accent:       #ede9e0;
  --accent-warm:  #c8a96e;
  --button-bg:    #ede9e0;
  --button-text:  #0e0d0b;
  --shadow:       rgba(0,0,0,0.35);
  --shadow-deep:  rgba(0,0,0,0.55);
  --grain-opacity: 0.07;
}

/* dark mode texture overrides */
.dark-mode .portfolio-section {
  background-image: radial-gradient(circle, rgba(200,169,110,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}
.dark-mode .about-section {
  background-image:
    repeating-linear-gradient(0deg,  rgba(200,169,110,0.04) 0px, rgba(200,169,110,0.04) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, rgba(200,169,110,0.04) 0px, rgba(200,169,110,0.04) 1px, transparent 1px, transparent 32px);
}
.dark-mode .contact-section {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(200,169,110,0.05) 0px,
    rgba(200,169,110,0.05) 1px,
    transparent 1px,
    transparent 18px
  );
}
.dark-mode .hero::after {
  background: repeating-linear-gradient(
    -52deg,
    transparent 0px,
    transparent 55px,
    rgba(200,169,110,0.07) 55px,
    rgba(200,169,110,0.07) 57px
  );
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Serif Display', Georgia, serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.5s ease, color 0.5s ease;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ─── Film Grain Overlay ────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 997;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: grain 0.35s steps(1) infinite;
}
@keyframes grain {
  0%   { background-position: 0 0; }
  10%  { background-position: -5% -10%; }
  20%  { background-position: -15% 5%; }
  30%  { background-position: 7% -25%; }
  40%  { background-position: -5% 25%; }
  50%  { background-position: -15% 10%; }
  60%  { background-position: 15% 0%; }
  70%  { background-position: 0% 15%; }
  80%  { background-position: 3% 35%; }
  90%  { background-position: -10% 10%; }
  100% { background-position: 0 0; }
}

/* ─── Page Load Curtain ─────────────────────────────────── */
#page-curtain {
  position: fixed;
  inset: 0;
  z-index: 9996;
  background: #1a1814;
  transform-origin: top;
  animation: curtain-rise 1.1s cubic-bezier(0.77,0,0.18,1) 0.1s forwards;
  pointer-events: none;
}
@keyframes curtain-rise {
  0%   { transform: scaleY(1); opacity: 1; }
  99%  { transform: scaleY(0); opacity: 1; }
  100% { transform: scaleY(0); opacity: 0; visibility: hidden; }
}

/* ─── Scroll Progress Bar ───────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent-warm);
  z-index: 9995;
  transition: width 0.1s linear;
}

/* ─── Container ─────────────────────────────────────────── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ─── Header ────────────────────────────────────────────── */
header {
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.5s ease, box-shadow 0.3s ease;
  animation: header-drop 0.8s cubic-bezier(0.22,1,0.36,1) 1.2s both;
}
header.scrolled { box-shadow: 0 4px 24px var(--shadow-deep); }
@keyframes header-drop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  gap: 16px;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), filter 0.5s ease;
  filter: invert(1) brightness(0.9);
}
.dark-mode .header-logo { filter: none; }
.header-logo:hover { transform: rotate(-5deg) scale(1.1); }

.logo {
  font-family: 'Old Standard TT', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
  user-select: none;
}
nav { flex-grow: 1; text-align: right; }
.nav-links { list-style: none; display: inline-flex; gap: 32px; }
.nav-links li a {
  text-decoration: none;
  font-family: 'DM Mono', monospace;
  font-size: 0.77rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  position: relative;
  transition: color 0.25s ease;
}
.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent-warm);
  transition: width 0.3s ease;
}
.nav-links li a:hover { color: var(--text); }
.nav-links li a:hover::after { width: 100%; }

/* ─── Toggle ────────────────────────────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 50px; height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  /* light mode = grey track */
  background: #a09d98;
  border: 1px solid #888582;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.4s, border-color 0.4s;
}
.slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 4px; bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), background 0.4s;
}
/* dark mode = white track */
input:checked + .slider { background: #ffffff; border-color: #d0cdc8; }
input:checked + .slider::before { transform: translateX(24px); background: #1a1814; }

/* ─── Scroll Reveal ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left {
  opacity: 0;
  transform: translateX(-44px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* stagger helpers */
.d1 { transition-delay: 0.05s; }
.d2 { transition-delay: 0.15s; }
.d3 { transition-delay: 0.25s; }
.d4 { transition-delay: 0.35s; }
.d5 { transition-delay: 0.45s; }
.d6 { transition-delay: 0.55s; }
.d7 { transition-delay: 0.65s; }

/* ─── HERO ──────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 130px 28px 90px;
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
}

/* animated diagonal tape lines */
.hero::after {
  content: '';
  position: absolute;
  inset: -100%;
  width: 300%;
  height: 300%;
  pointer-events: none;
  background: repeating-linear-gradient(
    -52deg,
    transparent 0px,
    transparent 55px,
    rgba(100, 80, 40, 0.10) 55px,
    rgba(100, 80, 40, 0.10) 57px
  );
  animation: tape-drift 1.5s linear infinite;
}
@keyframes tape-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(72px, 93px); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}
.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a5c1e;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fade-up 0.8s cubic-bezier(0.22,1,0.36,1) 1.3s both;
}
.dark-mode .hero-eyebrow { color: var(--accent-warm); }
.dark-mode .hero-eyebrow::before { background: var(--accent-warm); }
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px; height: 1px;
  background: #7a5c1e;
  animation: line-grow 0.6s ease 1.5s both;
  transform-origin: left;
}
@keyframes line-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Glitch hero title */
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4.5rem, 12vw, 10rem);
  line-height: 0.88;
  letter-spacing: 0.01em;
  color: var(--text);
  margin-bottom: 32px;
  animation: fade-up 0.9s cubic-bezier(0.22,1,0.36,1) 1.5s both;
}
.glitch { position: relative; display: inline-block; }

.hero-subtitle {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--text-muted);
  margin-bottom: 12px;
  max-width: 400px;
  animation: fade-up 0.9s cubic-bezier(0.22,1,0.36,1) 1.65s both;
}
.hero-tools {
  font-family: 'DM Mono', monospace;
  font-size: clamp(0.62rem, 1.1vw, 0.74rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a5c1e;
  margin-bottom: 46px;
  max-width: 500px;
  animation: fade-up 0.9s cubic-bezier(0.22,1,0.36,1) 1.75s both;
}
.dark-mode .hero-tools { color: var(--accent-warm); opacity: 0.85; }

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  animation: fade-up 0.9s cubic-bezier(0.22,1,0.36,1) 1.8s both;
}

.button {
  background-color: var(--button-bg);
  color: var(--button-text);
  padding: 15px 38px;
  border-radius: 2px;
  text-decoration: none;
  font-family: 'DM Mono', monospace;
  font-size: 0.79rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-block;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: color 0.35s ease;
}
.button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-warm);
  transform: translateX(-101%);
  transition: transform 0.45s cubic-bezier(0.77,0,0.18,1);
  z-index: 0;
}
.button span { position: relative; z-index: 1; }
.button:hover::before { transform: translateX(0); }
.button:hover { color: #0e0d0b; }

.hero-scroll-hint {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a5c1e;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dark-mode .hero-scroll-hint { color: var(--text-muted); }

.scroll-line {
  width: 44px; height: 2px;
  background: #c8a030;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.dark-mode .scroll-line { background: var(--text-faint); }
.scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: #7a5c1e;
  animation: scroll-sweep 2s ease-in-out infinite 1.8s;
  border-radius: 2px;
}
.dark-mode .scroll-line::after { background: var(--accent-warm); }
@keyframes scroll-sweep {
  0%   { left: -100%; opacity: 0; }
  15%  { opacity: 1; }
  50%  { left: 0%; }
  85%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Floating frame decoration */
.hero-frame {
  position: absolute;
  right: 6%; top: 50%;
  transform: translateY(-50%);
  width: min(320px, 30vw);
  height: min(420px, 40vw);
  border: 1px solid var(--border);
  border-radius: 2px;
  pointer-events: none;
  animation: frame-float 7s ease-in-out infinite, fade-up 1s ease 2s both;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-frame::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(200,169,110,0.22);
  border-radius: 2px;
}
.hero-frame-inner {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 3px,
    rgba(200,169,110,0.04) 3px,
    rgba(200,169,110,0.04) 4px
  );
  animation: scanlines 0.12s steps(1) infinite;
}
@keyframes scanlines {
  0%   { background-position: 0 0; }
  100% { background-position: 0 4px; }
}
@keyframes frame-float {
  0%,100% { transform: translateY(-50%) translateX(0) rotate(0deg); }
  33%     { transform: translateY(calc(-50% - 14px)) translateX(5px) rotate(0.5deg); }
  66%     { transform: translateY(calc(-50% + 10px)) translateX(-5px) rotate(-0.4deg); }
}

.hero-counter {
  position: absolute;
  bottom: 36px; right: 6%;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 5.5rem;
  color: var(--border);
  line-height: 1;
  pointer-events: none;
  letter-spacing: 0.05em;
  transition: color 0.5s;
}

@keyframes fade-up {
  from { opacity:0; transform:translateY(28px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ─── Section Label ─────────────────────────────────────── */
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--accent-warm);
}

/* ─── Portfolio ─────────────────────────────────────────── */
.portfolio-section {
  padding: 100px 0;
  background-color: var(--bg2);
  background-image: radial-gradient(circle, rgba(100,80,40,0.18) 1px, transparent 1px);
  background-size: 28px 28px;
  position: relative;
  overflow: hidden;
}
.portfolio-section > .container > h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem,5vw,4.5rem);
  letter-spacing: 0.04em;
  margin-bottom: 52px;
  line-height: 1;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px,1fr));
  gap: 32px;
}

.portfolio-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1), box-shadow 0.5s ease;
}
.portfolio-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(200,169,110,0.08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}
.portfolio-item:hover {
  transform: translateY(-8px) rotate(-0.4deg);
  box-shadow: 0 28px 52px var(--shadow-deep);
}
.portfolio-item:hover::before { opacity: 1; }

.portfolio-item-num {
  position: absolute;
  top: 14px; right: 16px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--accent-warm);
  z-index: 2;
  opacity: 0.8;
}
.portfolio-item-body { padding: 22px; }
.portfolio-item h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 8px;
}
.portfolio-item p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.view-project-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-warm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.3s ease, color 0.25s ease;
}
.view-project-link:hover { gap: 16px; color: var(--text); }

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  background: var(--bg2);
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ─── About ─────────────────────────────────────────────── */
.about-section {
  padding: 100px 0;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg,  rgba(100,80,40,0.07) 0px, rgba(100,80,40,0.07) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, rgba(100,80,40,0.07) 0px, rgba(100,80,40,0.07) 1px, transparent 1px, transparent 32px);
}
.about-section > .container > h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem,5vw,4.5rem);
  letter-spacing: 0.04em;
  margin-bottom: 52px;
  line-height: 1;
}

.about-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px,1fr));
  gap: 28px;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
/* Gold left-bar on hover */
.about-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 0;
  background: var(--accent-warm);
  transition: height 0.45s cubic-bezier(0.22,1,0.36,1);
}
.about-card:hover {
  border-color: rgba(200,169,110,0.5);
  box-shadow: 0 8px 32px var(--shadow);
}
.about-card:hover::after { height: 100%; }

/* ── Visible title (always shown) ── */
.about-card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Small mono label above title */
.card-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 8px;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
}

/* "Click to reveal" hint */
.card-hint {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
}
.card-hint::before {
  content: '';
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--text-faint);
}

/* ── Hidden content — expands below the title on click ── */
.card-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s cubic-bezier(0.22,1,0.36,1), opacity 0.4s ease, margin-top 0.4s ease;
  margin-top: 0;
  border-top: 0px solid var(--border);
}

/* Revealed state */
.about-card.open .card-body {
  max-height: 600px;
  opacity: 1;
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

/* Arrow hint rotates when open */
.card-hint::after {
  content: '↓';
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  display: inline-block;
  margin-left: 4px;
}
.about-card.open .card-hint::after { transform: rotate(180deg); }

/* Content styles inside card-body */
.card-body p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.card-body h4 {
  font-family: 'DM Serif Display', serif;
  font-size: 0.97rem;
  color: var(--text-muted);
  margin: 14px 0 6px;
}
.card-body ul { list-style: none; padding: 0; }
.card-body ul li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
}
.card-body ul li:last-child { border-bottom: none; }
.card-body ul li::before {
  content: '—';
  color: var(--accent-warm);
  flex-shrink: 0;
  font-size: 0.74rem;
  margin-top: 4px;
}
.card-body strong { color: var(--text); }

/* ─── Contact ───────────────────────────────────────────── */
.contact-section {
  padding: 100px 0;
  background-color: var(--bg2);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(100,80,40,0.08) 0px,
    rgba(100,80,40,0.08) 1px,
    transparent 1px,
    transparent 18px
  );
  position: relative;
  overflow: hidden;
}
.contact-section::before {
  content: "TALK";
  position: absolute;
  bottom: -8%; right: -2%;
  font-family: 'Bebas Neue', sans-serif;
  font-size: min(28vw, 340px);
  line-height: 0.85;
  color: var(--border);
  pointer-events: none;
  user-select: none;
  transition: color 0.5s;
  letter-spacing: 0.05em;
}
.contact-section > .container > h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem,5vw,4.5rem);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  line-height: 1;
  position: relative;
}
.contact-section > .container > p {
  color: var(--text-muted);
  margin-bottom: 40px;
  font-style: italic;
  position: relative;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
  position: relative;
}
.contact-info p {
  font-family: 'DM Mono', monospace;
  font-size: 0.87rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.02em;
}
.contact-info i { color: var(--accent-warm); width: 18px; text-align: center; }
.contact-info a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.contact-info a:hover { color: var(--accent-warm); border-color: var(--accent-warm); }

.social-links { display: flex; gap: 14px; position: relative; flex-wrap: wrap; }
.social-links a {
  width: 46px; height: 46px;
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  text-decoration: none;
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.social-links a:hover {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  background: rgba(200,169,110,0.08);
  transform: translateY(-4px) rotate(-3deg);
}

/* ─── Footer ────────────────────────────────────────────── */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
}
footer p {
  font-family: 'DM Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ─── Responsive ────────────────────────────────────────── */

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
  .hero-frame, .hero-counter { display: none; }

  /* Header — two-row layout: logo+toggle on top, nav centred below */
  .nav-container {
    flex-wrap: wrap;
    padding: 12px 16px 10px;
    gap: 0;
    row-gap: 10px;
  }
  .nav-left {
    flex: 1;
    gap: 8px;
  }
  .logo { font-size: 1.1rem; white-space: nowrap; }
  .header-logo { height: 24px; }
  .switch { flex-shrink: 0; }
  /* nav fills its own row, centred */
  nav {
    width: 100%;
    order: 3;
    text-align: center;
    flex-grow: 0;
  }
  .nav-links {
    display: inline-flex;
    gap: 0;
    justify-content: center;
    width: 100%;
  }
  .nav-links li {
    flex: 1;
    text-align: center;
  }
  .nav-links li a { font-size: 0.65rem; letter-spacing: 0.09em; }

  /* Hero — centered */
  .hero { text-align: center; padding: 120px 20px 72px; justify-content: center; }
  .hero .hero-content {
    text-align: center;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
  }
  .hero .hero-eyebrow { justify-content: center; }
  .hero-title { font-size: clamp(3.2rem, 16vw, 5.5rem); margin-bottom: 22px; }
  .hero-subtitle {
    margin: 0 auto 18px;
    font-size: 1rem;
    max-width: 88%;
  }
  .hero-tools {
    margin: 0 auto 40px;
    text-align: center;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
  .hero-cta-row { flex-direction: column; align-items: center; gap: 20px; justify-content: center; }
  .button { width: 100%; max-width: 320px; text-align: center; padding: 14px 28px; }

  /* Sections */
  .portfolio-section { padding: 72px 0; }
  .portfolio-section > .container > h2 { font-size: clamp(2.2rem, 9vw, 3rem); margin-bottom: 36px; }
  .portfolio-grid { grid-template-columns: 1fr; gap: 24px; }

  .about-section { padding: 72px 0; }
  .about-section > .container > h2 { font-size: clamp(2.2rem, 9vw, 3rem); margin-bottom: 36px; }
  .about-content { grid-template-columns: 1fr; gap: 20px; }

  .contact-section { padding: 72px 0; }
  .contact-section::before { font-size: min(40vw, 200px); bottom: -4%; }
  .contact-section > .container > h2 { font-size: clamp(2.2rem, 9vw, 3rem); }
  .contact-info p { font-size: 0.8rem; }
}

/* ── Small phones (≤ 430px) ── */
@media (max-width: 430px) {
  .container { padding: 0 16px; }

  /* Header — two-row, tighter sizing */
  .nav-container { padding: 10px 12px 8px; }
  .logo { font-size: 0.95rem; letter-spacing: 0.04em; }
  .header-logo { height: 20px; }
  .nav-links li a { font-size: 0.6rem; letter-spacing: 0.07em; }

  .switch { width: 42px; height: 22px; }
  .slider::before { height: 15px; width: 15px; bottom: 3px; }
  input:checked + .slider::before { transform: translateX(20px); }

  /* Hero — extra top padding to clear the taller two-row header */
  .hero { padding: 110px 16px 60px; }
  .hero-title { font-size: clamp(2.8rem, 17vw, 4.2rem); }
  .hero-eyebrow { font-size: 0.63rem; letter-spacing: 0.12em; }
  .hero-subtitle { font-size: 0.92rem; }
  .hero-tools { font-size: 0.58rem; letter-spacing: 0.1em; }

  .about-card { padding: 20px; }
  .portfolio-item-body { padding: 16px; }
}

/* ─── Easter Egg: Basketball Hoop ──────────────────────── */
#egg-hoop {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 90px;
  z-index: 9990;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
#egg-hoop.visible { transform: translateX(-50%) translateY(0%); }

#egg-backboard {
  width: 70px; height: 50px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 4px;
  margin: 0 auto 4px;
  position: relative;
}
#egg-backboard::after {
  content: '';
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 22px;
  border: 1.5px solid var(--accent-warm);
  border-radius: 2px;
}
#egg-rim {
  width: 64px; height: 8px;
  background: #e05a00;
  border-radius: 4px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(224,90,0,0.4);
}
#egg-net { width: 60px; margin: 0 auto; overflow: hidden; height: 40px; }
#egg-net svg { width: 100%; height: 100%; }

/* ─── Ball ──────────────────────────────────────────────── */
#egg-ball {
  position: fixed;
  font-size: 1.6rem;
  z-index: 9991;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.6);
  line-height: 1;
  margin: -14px 0 0 -14px;
  transition: opacity 0.2s ease;
}
#egg-ball.shooting {
  animation: ball-arc 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
#egg-ball.swish {
  animation: ball-swish 0.5s ease forwards;
}
@keyframes ball-arc {
  0%   { left: var(--sx); top: var(--sy); transform: scale(0.7) rotate(0deg); opacity: 1; }
  40%  { left: calc((var(--sx) + var(--ex)) / 2 - 60px); top: calc(var(--sy) - 220px); transform: scale(1.1) rotate(180deg); opacity: 1; }
  100% { left: var(--ex); top: calc(var(--ey) - 20px); transform: scale(0.9) rotate(540deg); opacity: 1; }
}
@keyframes ball-swish {
  0%   { transform: scale(0.9); }
  40%  { transform: scale(1.15) translateY(6px); }
  100% { transform: scale(0.7) translateY(30px); opacity: 0; }
}

/* Net wiggle on swish */
#egg-hoop.swish #egg-net { animation: net-wiggle 0.5s ease; }
@keyframes net-wiggle {
  0%   { transform: skewX(0deg); }
  20%  { transform: skewX(8deg) scaleX(1.05); }
  50%  { transform: skewX(-6deg) scaleX(0.97); }
  75%  { transform: skewX(3deg); }
  100% { transform: skewX(0deg); }
}

/* Rim flash */
#egg-hoop.swish #egg-rim { animation: rim-flash 0.4s ease; }
@keyframes rim-flash {
  0%   { background: #e05a00; box-shadow: 0 2px 8px rgba(224,90,0,0.4); }
  30%  { background: #ff8c00; box-shadow: 0 0 20px rgba(255,140,0,0.8); }
  100% { background: #e05a00; box-shadow: 0 2px 8px rgba(224,90,0,0.4); }
}

/* ─── Toast message ─────────────────────────────────────── */
#egg-toast {
  position: fixed;
  bottom: 110px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--accent-warm);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  padding: 10px 20px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  z-index: 9992;
  pointer-events: none;
  box-shadow: 0 8px 24px var(--shadow-deep);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
#egg-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
