/* =============================================================
   laber.ge — single stylesheet for every page (home, work, errors).
   ============================================================= */

/* Edict Display — licensed Light + LightItalic (local woff2, otf fallback). */
@font-face {
  font-family: 'Edict Display';
  src: url('/fonts/EdictDisplay-Light.woff2?v=2') format('woff2'),
       url('/fonts/EdictDisplay-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Edict Display';
  src: url('/fonts/EdictDisplay-LightItalic.woff2?v=2') format('woff2'),
       url('/fonts/EdictDisplay-LightItalic.otf') format('opentype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #0e1a30;
  --ink: #c5c5c2;
  --muted: #9fb0c8;
  --gold: #d4b25e;
  --line: rgba(255, 255, 255, 0.16);

  --pad: 40px;
  --pad-x: clamp(2rem, 4vw, 2.5rem);
  --measure: 36rem;

  /* PENN wordmark pill gradient + social-icon hover (PENN blue). */
  --role-gradient: linear-gradient(105deg, #1ba98d 0%, #2f86bd 38%, #4a6fc0 62%, #8a55c8 100%);
  --role-gradient-hover: linear-gradient(105deg, #8a55c8 0%, #4a6fc0 38%, #2f86bd 62%, #1ba98d 100%);
  --icon-hover: #4ca3d8;
}

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

html, body { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

/* Entrance reveal (used by the error pages; honors reduced-motion). */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp 800ms ease forwards;
  }
  .reveal-1 { animation-delay: 80ms; }
  .reveal-2 { animation-delay: 220ms; }
  @keyframes fadeUp { to { opacity: 1; transform: none; } }
}

/* =============================================================
   Home — centered intro sentence + social row
   ============================================================= */
.effects-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 100vh;
  min-height: 100dvh;
}

.effects-wrap {
  max-width: 960px;
  padding: 0 2rem;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .effects-reveal {
    opacity: 0;
    animation: effectsFade 800ms cubic-bezier(0.22, 1, 0.36, 1) 80ms forwards;
  }
  @keyframes effectsFade {
    from { opacity: 0; filter: blur(10px); transform: translateY(8px); }
    to   { opacity: 1; filter: blur(0);    transform: none; }
  }
}

.effects-statement {
  margin: 0 auto;
  /* em-based measure scales with the font, so the sentence always wraps to
     multiple lines — never collapses onto one (e.g. ~860px wide). */
  max-width: 15em;
  font-family: 'Edict Display', Georgia, serif;
  font-size: clamp(24px, 3.3vw, 48px);
  font-weight: 300;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}
.effects-name {
  position: relative;
  font-style: italic;
  cursor: pointer;
  white-space: nowrap; /* keep the underline under one line */
}
/* Full-width gradient underline (PENN gradient): faint at rest on every
   device so the name reads as clickable, full on hover where hover exists. */
.effects-name::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.02em;
  height: 2px;
  background: var(--role-gradient);
  border-radius: 1px;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 300ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .effects-name:hover::after { opacity: 1; }
}
/* While the portrait is open (touch or click), the name shows the same
   full-strength gradient underline as mouseover. */
.effects-card-open .effects-name::after { opacity: 1; }

/* Second line under the sentence: same serif, lighter and smaller. */
.effects-sub {
  margin: 12px auto 0;
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap; /* one line on desktop; wraps on phones below */
}

/* PENN wordmark: no pill, the letters carry the gradient (defs in index.html). */
.role-penn {
  display: inline-flex;
  align-items: center;
  padding: 0 0.02em;
  margin-left: 0.12em; /* breathing room after "at" */
  vertical-align: middle;
  transform: translateY(-0.06em);
}
.role-penn svg { display: block; height: 0.92em; width: auto; }
.role-penn svg path { fill: url(#penn-grad); }
.role-penn:hover svg path { fill: url(#penn-grad-hover); }
.role-dot { margin-left: 0.12em; }

/* Social icon row */
.effects-social {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-top: 34px;
}
.effects-social a {
  display: inline-flex;
  justify-content: center;
  width: 24px;
  color: var(--muted);
  transition: color 160ms ease;
}
.effects-social a:hover,
.effects-social a:active { color: var(--icon-hover); }
.effects-social svg { width: 22px; height: 22px; fill: currentColor; }

/* While the portrait popup is open, the icons and links read as disabled. */
.effects-card-open .effects-social,
.effects-card-open .effects-sub {
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 200ms ease;
}

/* Portrait popup card (JS places it at the click point). */
.effects-trail {
  position: fixed;
  inset: 0;
  z-index: 180;
  pointer-events: none;
}
.effects-trail-card {
  position: absolute;
  transform: rotate(var(--rot, 0deg)) scale(0.7);
  width: 240px;
  height: 300px;
  border-radius: 14px;
  overflow: hidden;
  background: #0e1a30;
  /* Stronger shadow so the card lifts off the dark background. */
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.55),
    0 6px 16px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition:
    opacity 220ms ease,
    transform 320ms cubic-bezier(0.18, 0.89, 0.32, 1.28),
    filter 420ms ease;
  will-change: transform, opacity, filter;
}
.effects-trail-card.show {
  opacity: 1;
  transform: rotate(var(--rot, 0deg)) scale(1);
}
.effects-trail-card.fade {
  opacity: 0;
  filter: blur(12px);
  transform: rotate(var(--rot, 0deg)) scale(0.92);
  transition:
    opacity 380ms cubic-bezier(0.4, 0, 0.2, 1),
    filter 380ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 380ms cubic-bezier(0.4, 0, 0.2, 1);
}
.effects-trail-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 440ms ease;
  user-select: none;
  -webkit-user-drag: none;
}
.effects-trail-card img.is-active { opacity: 1; }

/* Hover label — liquid-glass pill (JS sets left/top to the lower-right of
   the cursor; placed once, doesn't follow). */
.effects-hint {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.30) 0%,
    rgba(255, 255, 255, 0.08) 100%);
  color: #0a0a0a;
  border-radius: 999px;
  padding: 10px 17px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(40px) saturate(1.9) brightness(1.04);
  -webkit-backdrop-filter: blur(40px) saturate(1.9) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(15, 17, 22, 0.04),
    0 14px 36px rgba(15, 17, 22, 0.10),
    0 32px 72px rgba(15, 17, 22, 0.10);
  opacity: 0;
  filter: blur(10px);
  transform: scale(0.96);
  transform-origin: top left;
  transition:
    opacity 460ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 540ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.effects-hint.show {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

@media (max-width: 1000px) {
  .effects-stage { padding-left: 10vw; padding-right: 10vw; }
}
@media (max-width: 800px) {
  .effects-stage { padding: 48px 10vw; }
  .effects-statement { font-size: clamp(25px, 8.1vw, 43px); }
}
@media (max-width: 600px) {
  /* Phones: one break, after "CTO," — the segments themselves never wrap. */
  .effects-sub { white-space: normal; font-size: 19px; }
  .effects-sub .sub-seg { display: inline-block; }
}

/* =============================================================
   Work — résumé (experience / awards / patents)
   ============================================================= */
.page-static {
  display: block;
  min-height: 100vh;
  background: var(--bg);
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px var(--pad) 140px;
}
.page--cv { max-width: 960px; }
.page--cv .back { margin-bottom: clamp(1rem, 2.4vw, 1.8rem); }
.page--cv .page-title { margin-top: 10px; }

.page-title {
  font-family: 'Edict Display', Georgia, 'Times New Roman', serif;
  font-weight: 300;
  font-size: clamp(44px, 6vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 24px 0 16px;
}
.page-title em { font-style: italic; }
.page-title--gold { color: var(--gold); }
.page-lede {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 32px;
}

.cv-section { margin-top: 40px; }
.cv-section:first-of-type { margin-top: 0; }

.cv-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cv-list { display: flex; flex-direction: column; }
.cv-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 0 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.cv-row:last-child { border-bottom: none; }
.cv-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
.cv-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* One muted tone at rest: every mark becomes a white silhouette. */
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transition: filter 160ms ease, opacity 160ms ease;
}
.cv-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cv-co {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.cv-role {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--muted);
}
.cv-year {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.cv-text, .cv-year { transition: opacity 160ms ease; }
/* Hover: text dims, the mark returns to its original color. The Disney mark
   is a dark source file, so it flips to white instead. Hover-capable only, so
   a tap on a phone never leaves one logo stuck in color. */
@media (hover: hover) and (pointer: fine) {
  .cv-row:hover .cv-text,
  .cv-row:hover .cv-year { opacity: 0.6; }
  .cv-row:hover .cv-logo img { filter: none; opacity: 1; }
  .cv-row:hover .cv-logo--invert img { filter: invert(1); }
}

.cv-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 44px 0 12px;
}
.cv-sub img { height: 30px; width: auto; }

.cv-awards { display: flex; flex-direction: column; }
.cv-award {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.cv-award:last-child { border-bottom: none; }
.cv-award-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.cv-award-note { color: var(--muted); }
.cv-award-note--block { display: block; }

@media (max-width: 1000px) {
  .page { padding-left: 10vw; padding-right: 10vw; }
}
@media (max-width: 800px) {
  .page { padding-top: 36px; padding-bottom: 80px; }
  .page-lede { font-size: 21px; }
}
@media (max-width: 600px) {
  .cv-row { grid-template-columns: 40px 1fr; gap: 2px 18px; }
  .cv-row .cv-year { grid-column: 2; justify-self: start; margin-top: 4px; }
  .cv-award { grid-template-columns: 1fr; gap: 2px; }
  .cv-award .cv-year { order: -1; }
}

/* =============================================================
   Error pages (404 / 500)
   ============================================================= */
.error-page {
  max-width: calc(var(--measure) + 2 * var(--pad-x));
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad-x) clamp(3rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

@media (min-width: 1500px) {
  .error-page {
    width: fit-content;
    max-width: 1300px;
    padding-top: clamp(3.5rem, 6vw, 7rem);
  }
}

.error-code {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 1rem;
  font-variant-numeric: tabular-nums;
}

.head {
  font-family: 'Edict Display', Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.4em;
}

.lede {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  text-wrap: pretty;
}
.lede strong {
  color: var(--ink);
  font-weight: 400;
}

.error-page .lede { margin-bottom: 0; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.95rem;
  font-weight: 500;
  color: #9a9a97;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
  align-self: flex-start;
  transition: color 200ms;
}
.back svg {
  width: 2.1rem;
  height: 2.1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.back:hover, .back:active { color: var(--ink); }

/* =============================================================
   Money — family page (login gate + checklist)
   ============================================================= */
.gate[hidden], .page[hidden] { display: none; }
.gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px var(--pad-x);
}
.gate-card {
  width: 100%;
  max-width: 320px;
  text-align: center;
}
.gate-title {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 300;
  font-size: clamp(34px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.gate-title em { font-style: italic; }
.gate-note {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 26px;
}
.gate-card input {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 160ms ease;
}
.gate-card input::placeholder { color: var(--muted); opacity: 0.7; }
.gate-card input:focus { border-color: var(--muted); }
.gate-card button {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--role-gradient);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 200ms ease;
}
.gate-card button:hover { background-image: var(--role-gradient-hover); }
/* Held press: the gradient slowly sweeps back and forth. */
@media (prefers-reduced-motion: no-preference) {
  .gate-card button:active {
    background-image: var(--role-gradient);
    background-size: 200% 100%;
    animation: gateSweep 1400ms ease-in-out infinite alternate;
  }
  @keyframes gateSweep {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
  }
}
.gate-error {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #b999de;
  margin: 14px 0 0;
  visibility: hidden;
}
.gate-error.show { visibility: visible; }
.gate-card.shake { animation: gateShake 360ms ease; }
@keyframes gateShake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.check-list { display: flex; flex-direction: column; }
.check-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 15px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.check-item:last-child { border-bottom: none; }
.check-item input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1px solid var(--muted);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 160ms ease, border-color 160ms ease;
}
.check-item input:checked {
  background: var(--icon-hover);
  border-color: var(--icon-hover);
}
.check-item input:checked::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--bg);
  border-bottom: 2px solid var(--bg);
  transform: rotate(-45deg) translate(0, -1px);
}
.check-text {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  transition: color 200ms ease;
}
.check-item input:checked ~ .check-text { color: var(--muted); }
.check-text a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(212, 178, 94, 0.5);
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
.check-text a:hover { color: #e8c976; text-decoration-color: #e8c976; }
