@media screen and (max-width: 768px) and (orientation: landscape) {
  body { display: none; }
  .orientation-msg {
    display: flex !important;
  }
}

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

:root {
  --black: #0d0d0d;
  --white: #fafaf8;
  --grey: #888;
  --card-w: 260px;
  --card-h: 412px; /* ISO/IEC 7810 ID-1 portrait: 85.60×53.98 mm → 260×412 px */
}

html {
  scroll-behavior: auto;
  color-scheme: only light;
  scroll-snap-type: y mandatory;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
}

/* ─── DESKTOP ─────────────────────────────────────────── */
.desktop { display: flex; }
.mobile  { display: none; }

/* Left panel */
.left-panel {
  position: fixed;
  top: 0; left: 0;
  width: 42vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 0 0 13.62vw;
  z-index: 10;
}

.left-panel .eyebrow {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s, transform .5s;
}


.left-panel .headline {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s .06s, transform .5s .06s;
}

.left-panel .sub {
  font-size: 14px;
  line-height: 1.65;
  color: #555;
  max-width: 320px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s .12s, transform .5s .12s;
}

.left-panel.visible .eyebrow,
.left-panel.visible .headline,
.left-panel.visible .sub { opacity: 1; transform: none; }

.links {
  display: flex;
  gap: 16px;
  margin-top: 40px;
}

.linkedin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 15px;
  font-size: 12px;
  letter-spacing: .02em;
  color: color-mix(in srgb, var(--current-accent, #888) 60%, #888);
  background: color-mix(in srgb, var(--current-accent, #888) 7%, transparent);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}

/* Right scroll track */
.right-track {
  margin-left: 42vw;
  width: 58vw;
}

/* Fixed card stage */
.card-stage {
  position: fixed;
  top: 0;
  right: 0;
  width: 58vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

/* ─── ID CARD ─────────────────────────────────────────── */
.id-card-wrap {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
}

/* Shadow on a sibling so filter never flattens preserve-3d */
.card-shadow {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  box-shadow: 0 28px 60px rgba(0,0,0,.28);
  pointer-events: none;
}

/* Card container — transform driven by JS (swing + mouse tilt + flip) */
.card-3d {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
  position: relative;
  will-change: transform;
}

/* The single visible face */
.card-face {
  position: absolute;
  inset: 0;
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
}


/* Card interior */
.card-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 20px;
  position: relative;
}

.card-top-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--accent, #0d0d0d);
}

.card-label {
  font-size: 8px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 20px;
  margin-top: 6px;
}

.card-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid #f0f0f0;
  margin-bottom: 18px;
  flex-shrink: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.85) 0%, var(--accent) 100%);
}

.card-photo-placeholder {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: #e8e8e8;
  margin-bottom: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #aaa;
}

.card-name {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 6px;
  color: #111;
}

.card-title {
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent, #0d0d0d);
  margin-bottom: 16px;
  text-align: center;
}

.card-divider {
  width: 30px;
  height: 1px;
  background: #e0e0e0;
  margin-bottom: 16px;
}

.card-logo-horizontal {
  margin-top: auto;
  max-width: 160px;
  max-height: 76px;
  object-fit: contain;
}

.card-dates {
  font-size: 9px;
  color: #bbb;
  letter-spacing: .08em;
  margin-top: 8px;
}

/* Role sections */
.role-section {
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* ─── SCROLL NAV ──────────────────────────────────────── */
.scroll-nav {
  position: fixed;
  right: calc(29vw - 182px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 20;
}

.scroll-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  justify-content: flex-end;
}

.scroll-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: transparent;
  flex-shrink: 0;
  transition: background .35s, border-color .35s, transform .35s;
}

.scroll-nav-item.active .scroll-nav-dot {
  background: var(--nav-accent, #0d0d0d);
  border-color: var(--nav-accent, #0d0d0d);
  transform: scale(1.4);
}

/* ─── MOBILE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .scroll-nav { display: none; }
  .desktop { display: none; }

  .mobile {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .mobile-header {
    flex-shrink: 0;
    height: 25dvh;
    position: relative;
  }

  .mobile-eyebrow {
    position: absolute;
    top: 5dvh;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--grey);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .5s, transform .5s;
  }

  .mobile-headline {
    position: absolute;
    top: 9dvh;
    left: 50px;
    right: 50px;
    font-family: 'Instrument Serif', serif;
    font-size: 51.2px;
    line-height: 1.08;
    letter-spacing: -.02em;
    text-align: center;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .5s .06s, transform .5s .06s;
  }

  .mobile-header.visible .mobile-eyebrow,
  .mobile-header.visible .mobile-headline { opacity: 1; transform: none; }

  .mobile-swipe-area {
    flex: 1;
    position: relative;
    overflow: visible;
    min-height: 0;
  }

  /* Each card is individually positioned — JS sets translateX per card.
     Card is always rendered at the exact desktop dimensions (260×412px);
     JS injects scale() into every transform to fit the available space,
     guaranteeing pixel-identical proportions to the desktop card. */
  .mobile-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--card-w);
    height: var(--card-h);
    border-radius: 15px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0,0,0,.14), 0 3px 8px rgba(0,0,0,.06);
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
  }

  .mobile-footer {
    flex-shrink: 0;
    height: 10dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    justify-content: center;
    padding: 0 20px max(16px, env(safe-area-inset-bottom));
  }

  .mobile-progress {
    position: absolute;
    top: 1.5dvh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
  }

  .mobile-progress-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    border: 1px solid #d0d0d0;
    background: transparent;
    flex-shrink: 0;
    transition: background .35s, border-color .35s;
  }
  .mobile-progress-dot.active {
    background: #d0d0d0;
    border-color: #d0d0d0;
  }

}

/* ─── SMALL-HEIGHT PHONES (iPhone SE / 8, ≤700px tall) ──── */
@media (max-width: 768px) and (max-height: 700px) {
  .mobile-eyebrow {
    margin-bottom: 8px;
  }
  .mobile-headline {
    font-size: 38px;
  }
  /* Card interior proportions are preserved by JS scale() — no overrides needed */
}

/* ─── HOVER (pointer devices only) ───────────────────────── */
@media (hover: hover) {
  .linkedin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.10);
  }
  .linkedin-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
  }
}
