/* ============================================================
   MIDNIGHT CHAMPAGNE — Digital Identity Card
   Plain CSS3 only. No frameworks, no preprocessors.
   ============================================================ */

:root {
  --gold: #c4a35a;
  --gold-light: #e2c887;
  --gold-dark: #9a7b3c;
  --gold-glow: rgba(196, 163, 90, 0.35);

  --ink: #0c0c0f;
  --ink-raised: #12121a;
  --surface: #18181f;
  --surface-hover: #1f1f28;

  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(196, 163, 90, 0.25);

  --text: #eceae4;
  --muted: #9c9a94;
  --dim: #6b6963;

  --font-display: "Outfit", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-signature: Georgia, "Times New Roman", serif;

  --radius-card: 20px;
  --radius-small: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --mx: 50vw;
  --my: 42vh;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(900px 620px at 100% 0%, rgba(196, 163, 90, 0.07), transparent 62%),
    radial-gradient(820px 620px at 0% 100%, rgba(196, 163, 90, 0.05), transparent 62%),
    var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

::selection { background: var(--gold); color: #14100a; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

img { display: block; max-width: 100%; }
ul { list-style: none; }
a { color: inherit; }
button { font-family: inherit; }

a, button {
  -webkit-tap-highlight-color: rgba(196, 163, 90, 0.22);
  touch-action: manipulation;
}

.shell { width: min(76rem, calc(100% - 3rem)); margin-inline: auto; }

.page { position: relative; z-index: 2; }

.gold-grad {
  background: linear-gradient(105deg, var(--gold-light) 0%, var(--gold) 48%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Ambient layers ---------- */

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.spotlight {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--mx) var(--my), rgba(196, 163, 90, 0.10), transparent 70%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Reveal (scroll) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms + var(--d, 0ms));
  will-change: opacity, transform;
}

.reveal.revealed { opacity: 1; transform: none; }

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.4rem;
}

.logo-tile {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-small);
  background: linear-gradient(135deg, #f6eeda 0%, var(--gold-light) 100%);
  border: 1px solid rgba(196, 163, 90, 0.45);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.logo-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(196, 163, 90, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.logo-tile img { width: 38px; height: 38px; object-fit: contain; border-radius: 7px; }

.topbar-meta {
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.meta-sep { color: var(--gold-dark); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 96px);
  padding-block: clamp(2rem, 6vh, 4rem);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  flex: none;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-top: 1.2rem;
}

.hero-role {
  margin-top: 1.3rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.role-sep { color: var(--gold); margin-inline: 0.35em; }

.mobile-break { display: none; }

.hero-tagline {
  margin-top: 0.85rem;
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.75;
}

/* ============================================================
   THE 3D CARD
   ============================================================ */

.hero-card { display: flex; justify-content: center; }

.card-holder { width: min(100%, 500px); }

.card-scene {
  width: 100%;
  aspect-ratio: 1.586;
  perspective: 1400px;
  animation: cardFloat 7s ease-in-out infinite;
  touch-action: pan-y;
}

.card-tilt {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.card-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s var(--ease);
  animation: dealIn 1.15s var(--ease) 0.2s backwards;
  cursor: pointer;
}

.card-3d.is-flipped { transform: rotateY(180deg); }

.card-3d:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 8px; border-radius: 24px; }

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  padding: clamp(16px, 5.4%, 28px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(430px 320px at 10% -12%, rgba(196, 163, 90, 0.22), transparent 62%),
    linear-gradient(135deg, #17171f 0%, #0e0e13 52%, #14141c 100%);
  border: 1px solid var(--border-gold);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 30px 60px rgba(0, 0, 0, 0.55);
}

.card-back { transform: rotateY(180deg); padding-top: clamp(56px, 22%, 76px); line-height: 1.45; }

/* Entrance */
@keyframes dealIn {
  0%   { transform: rotateY(-78deg); opacity: 0; }
  55%  { transform: rotateY(14deg);  opacity: 1; }
  78%  { transform: rotateY(-5deg); }
  100% { transform: rotateY(0deg);   opacity: 1; }
}

/* Float + pulsing shadow */
@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.card-shadow {
  width: 74%;
  height: 34px;
  margin: 30px auto 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 68%);
  filter: blur(10px);
  animation: shadowPulse 7s ease-in-out infinite;
}

@keyframes shadowPulse {
  0%, 100% { transform: scaleX(1);    opacity: 0.75; }
  50%      { transform: scaleX(0.86); opacity: 0.5; }
}

/* Foil glare (both faces) */
.card-glare {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: var(--glare, 0);
  background:
    radial-gradient(340px circle at var(--gx, 50%) var(--gy, 50%),
      rgba(226, 200, 135, 0.55), rgba(196, 163, 90, 0.18) 45%, transparent 70%),
    linear-gradient(115deg,
      transparent 32%, rgba(255, 255, 255, 0.09) 45%,
      rgba(226, 200, 135, 0.14) 50%, rgba(255, 255, 255, 0.09) 55%, transparent 68%);
}

/* ---------- Card front ---------- */

.card-watermark {
  position: absolute;
  right: 6px;
  bottom: -0.22em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(6rem, 26vw, 9.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: rgba(196, 163, 90, 0.055);
  pointer-events: none;
  user-select: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.chip {
  position: relative;
  width: 52px;
  height: 38px;
  margin-top: 4px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 45%, var(--gold-dark) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), inset 0 -2px 3px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.chip::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(74, 55, 20, 0.65);
  border-radius: 4px;
  background:
    linear-gradient(rgba(74, 55, 20, 0.65), rgba(74, 55, 20, 0.65)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(rgba(74, 55, 20, 0.65), rgba(74, 55, 20, 0.65)) 0 50% / 100% 1px no-repeat;
}

.chip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  bottom: 6px;
  width: 14px;
  transform: translateX(-50%);
  border-left: 1px solid rgba(74, 55, 20, 0.65);
  border-right: 1px solid rgba(74, 55, 20, 0.65);
}

.card-ring { position: relative; width: clamp(40px, 12%, 58px); height: clamp(40px, 12%, 58px); flex: none; }

.card-ring::before,
.card-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
}

.card-ring::before { inset: 0; opacity: 0.85; }
.card-ring::after  { inset: 10px; opacity: 0.4; }

.card-brand {
  margin-top: clamp(0.5rem, 3vw, 1.1rem);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--dim);
}

.brand-sep { color: var(--gold); }

.card-number {
  margin-top: 0.55rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(0.82rem, 3.6vw, 1.02rem);
  letter-spacing: 0.2em;
  color: rgba(236, 234, 228, 0.82);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.card-number a {
  color: inherit;
  text-decoration: none;
}

.card-number a:active { color: var(--gold-light); }

.card-id { margin-top: auto; }

.card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 4.8vw, 1.5rem);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.05;
  background: linear-gradient(105deg, var(--gold-light) 0%, var(--gold) 48%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card-role {
  margin-top: 0.45rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(0.6rem, 3.5vw, 1.2rem);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card-meta { display: inline-flex; align-items: center; gap: 0.5em; color: var(--muted); }
.card-meta svg { color: var(--gold); flex: none; }
.card-flip-hint { color: var(--gold); }

/* ---------- Card back ---------- */

.mag-stripe {
  position: absolute;
  top: clamp(18px, 7%, 26px);
  left: 0;
  right: 0;
  height: clamp(28px, 11%, 40px);
  background: linear-gradient(180deg, #060608 0%, #1a1a20 48%, #070709 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-back-eyebrow {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.card-back-email {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.92rem, 3.8vw, 1.22rem);
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.card-back-email:hover { color: var(--gold-light); border-bottom-color: var(--border-gold); }

.card-back-links { margin-top: 0.5rem; font-size: 0.74rem; }

.card-back-links li { border-top: 1px solid rgba(255, 255, 255, 0.06); }

.card-back-links a {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3rem 0;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.35s var(--ease), transform 0.35s var(--ease);
}

.card-back-links a:hover { color: var(--gold-light); transform: translateX(4px); }

.link-dim { color: var(--dim); }

.card-back-links .arrow { margin-left: auto; color: var(--gold); flex: none; }

.card-back-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.qr { width: clamp(30px, 9.5%, 46px); height: auto; color: var(--gold); opacity: 0.9; flex: none; }

.card-signature {
  font-family: var(--font-signature);
  font-style: italic;
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

/* ============================================================
   SECTIONS
   ============================================================ */

section { padding-block: clamp(3.5rem, 9vh, 6rem); }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0.9rem 0 1.6rem;
}

/* ---------- About ---------- */

.about-copy p {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1.1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-top: 2.4rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.6rem 1.2rem;
  text-align: center;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), background 0.45s var(--ease);
}

.stat:hover {
  transform: translateY(-6px);
  border-color: var(--border-gold);
  background: var(--surface-hover);
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
}

.skill-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.4rem;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), background 0.5s var(--ease);
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  background: radial-gradient(320px circle at var(--px, 50%) var(--py, 50%), rgba(196, 163, 90, 0.13), transparent 65%);
}

.skill-card:hover::before { opacity: 1; }

.skill-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-gold);
  background: var(--surface-hover);
}

.skill-head { display: flex; align-items: baseline; gap: 0.7rem; }

.skill-index {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--gold-dark);
}

.skill-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.skill-count {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(196, 163, 90, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 0.18rem 0.62rem;
  line-height: 1.4;
}

.skill-list { margin-top: 1rem; }

.skill-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.64rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  transition: opacity 0.8s var(--ease), transform 0.35s var(--ease), color 0.35s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms + var(--d, 0ms));
}

.skill-list li:last-child { border-bottom: 1px solid var(--border); }

.row-dash {
  flex: none;
  width: 14px;
  height: 1.5px;
  background: var(--gold);
  transition: width 0.35s var(--ease);
}

.skill-row:hover { color: var(--gold-light); transform: translateX(6px); }
.skill-row:hover .row-dash { width: 26px; }

/* ---------- Projects ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.6rem 1.4rem;
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease), background 0.5s var(--ease);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  background: radial-gradient(320px circle at var(--px, 50%) var(--py, 50%), rgba(196, 163, 90, 0.13), transparent 65%);
}

.project-card:hover::before { opacity: 1; }

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-gold);
  background: var(--surface-hover);
}

.project-index {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.project-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  margin-top: 0.7rem;
}

.project-desc {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ---------- Contact ---------- */

.contact-rows {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 46rem;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.3rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), background 0.45s var(--ease);
}

a.contact-row:hover {
  transform: translateX(8px);
  border-color: var(--border-gold);
  background: var(--surface-hover);
}

.contact-row .arrow {
  flex: none;
  color: var(--gold);
  transition: transform 0.35s var(--ease);
}

a.contact-row:hover .arrow { transform: translate(3px, -3px); }

.contact-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.contact-value {
  display: block;
  margin-top: 0.28rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  transition: color 0.35s var(--ease);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.contact-email {
  text-decoration: none;
}

.contact-email:active { color: var(--gold-light); }

a.contact-row:hover .contact-value { color: var(--gold-light); }

.btn-copy {
  flex: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  min-height: 44px;
  min-width: 44px;
  padding: 0.65rem 1.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a1408;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 55%, var(--gold-dark) 100%);
  box-shadow: 0 6px 18px rgba(196, 163, 90, 0.25);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), filter 0.35s var(--ease);
}

.btn-copy:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--gold-glow); }
.btn-copy:active { transform: scale(0.97); filter: brightness(1.08); }
.btn-copy.copied { filter: brightness(1.12); }

.copy-status {
  min-height: 1.4em;
  margin-top: 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold-light);
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 3rem 3.5rem;
  text-align: center;
  color: var(--dim);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.75rem;
    min-height: 0;
    text-align: center;
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }

  .hero-card { order: -1; }

  .card-holder { width: min(92vw, 460px); margin-inline: auto; }

  .hero-copy .eyebrow { justify-content: center; }
  .hero-copy .eyebrow::before { display: none; }
  .hero-tagline { margin-inline: auto; }

  .spotlight { opacity: 0.65; }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 1.5rem); }

  .topbar {
    padding-block: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top, 0));
  }

  .topbar-meta { display: none; }

  .logo-tile { width: 48px; height: 48px; }

  .hero {
    gap: 2rem;
    padding-top: 0.75rem;
  }

  .hero-name { font-size: clamp(2.35rem, 11vw, 3.4rem); }

  .hero-role {
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 32ch;
    margin-inline: auto;
  }

  .role-sep { display: none; }

  .mobile-break { display: block; }

  .hero-tagline {
    font-size: 0.95rem;
    max-width: 34ch;
  }

  .card-holder { width: min(94vw, 400px); }

  .card-scene {
    animation-duration: 9s;
    perspective: 1000px;
  }

  .card-face { border-radius: 18px; padding: clamp(14px, 4.8%, 22px); }

  .card-glare { border-radius: 18px; }

  .card-bottom {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .card-meta:first-child { flex: 1 1 100%; }

  .card-flip-hint { margin-left: auto; }

  .card-back-links a {
    min-height: 44px;
    padding: 0.55rem 0;
  }

  section { padding-block: 2.75rem; }

  .section-title { font-size: clamp(1.55rem, 7vw, 2rem); }

  .about-copy p { font-size: 0.95rem; line-height: 1.75; }

  .skills-grid,
  .projects-grid { grid-template-columns: 1fr; }

  .contact-row {
    flex-wrap: wrap;
    align-items: stretch;
    padding: 1rem 1.1rem;
    min-height: 44px;
  }

  .contact-text { flex: 1 1 100%; }

  .contact-value { font-size: 0.95rem; }

  .btn-copy { width: 100%; margin-top: 0.35rem; }

  a.contact-row {
    min-height: 56px;
    padding-block: 1rem;
  }

  a.contact-row .arrow { margin-left: auto; align-self: center; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

  .stat { padding: 1.25rem 1rem; }

  .stat-num { font-size: 2.1rem; }

  .site-footer {
    padding-bottom: max(2.5rem, calc(1.5rem + env(safe-area-inset-bottom, 0)));
    font-size: 0.78rem;
    line-height: 1.6;
  }
}

@media (max-width: 420px) {
  .shell { width: calc(100% - 1.25rem); }

  .stats-grid { grid-template-columns: 1fr; }

  .card-watermark { font-size: clamp(4.5rem, 22vw, 6rem); }

  .card-number { letter-spacing: 0.14em; font-size: 0.78rem; }

  .card-back-email { font-size: 0.88rem; word-break: break-all; }
}

/* Touch devices: skip hover-only motion, keep tap feedback */
@media (hover: none), (pointer: coarse) {
  .logo-tile:hover,
  .stat:hover,
  .skill-card:hover,
  .project-card:hover,
  .skill-row:hover,
  a.contact-row:hover,
  .card-back-links a:hover,
  .btn-copy:hover {
    transform: none;
    box-shadow: inherit;
  }

  .stat:hover,
  .skill-card:hover,
  .project-card:hover,
  a.contact-row:hover {
    border-color: inherit;
    background: inherit;
  }

  .skill-card:hover::before,
  .project-card:hover::before { opacity: 0; }

  .skill-row:hover .row-dash { width: 14px; }

  .card-back-links a:hover,
  .card-back-email:hover {
    color: inherit;
    border-bottom-color: transparent;
  }

  a.contact-row:hover .contact-value,
  a.contact-row:hover .arrow { color: inherit; transform: none; }

  .card-back-links a:active { color: var(--gold-light); }

  a.contact-row:active {
    border-color: var(--border-gold);
    background: var(--surface-hover);
  }

  .card-3d:active { transform: scale(0.985); }
  .card-3d.is-flipped:active { transform: rotateY(180deg) scale(0.985); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .card-scene,
  .card-shadow { animation: none !important; }

  .card-glare { opacity: 0 !important; }

  .reveal { opacity: 1 !important; transform: none !important; }
}
