/* =============================================================
   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: #ffffff;
  --ink: #181818;
  --muted: #585855;
  --line: rgba(20, 20, 20, 0.13);

  --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, #8a55c8 0%, #4a6fc0 38%, #2f86bd 62%, #1ba98d 100%);
  --role-gradient-hover: linear-gradient(105deg, #1ba98d 0%, #2f86bd 38%, #4a6fc0 62%, #8a55c8 100%);
  --icon-hover: #2f86bd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a30;
    --ink: #c5c5c2;
    --muted: #9fb0c8;
    --line: rgba(255, 255, 255, 0.16);
    --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;
}
/* Full-width gradient underline (PENN gradient) that fades in/out on hover
   — only on hover-capable, fine-pointer devices (not mobile). */
.effects-name::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.02em;
  height: 2px;
  background: var(--role-gradient);
  border-radius: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .effects-name:hover::after { opacity: 1; }
}

/* PENN wordmark pill */
.role-penn {
  display: inline-flex;
  align-items: center;
  background: var(--role-gradient);
  padding: 0.16em 0.36em;
  border-radius: 0.26em;
  vertical-align: middle;
  transform: translateY(-0.06em);
  transition: background 200ms ease;
}
.role-penn:hover { background: var(--role-gradient-hover); }
.role-penn svg { display: block; height: 0.8em; width: auto; }
.role-penn svg path { fill: #fff; }

/* Social icon row */
.effects-social {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-top: 28px;
}
.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 read as disabled. */
.effects-card-open .effects-social {
  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: #fafafa;
  box-shadow:
    0 10px 28px rgba(15, 17, 22, 0.20),
    0 2px 6px rgba(15, 17, 22, 0.10);
  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;
}
@media (prefers-color-scheme: dark) {
  .effects-trail-card {
    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);
  }
}
.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); }
}

/* =============================================================
   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-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; }
/* Disney mark is solid black — flip it to white in dark mode. */
@media (prefers-color-scheme: dark) {
  .cv-logo--invert img { filter: invert(1); }
}
.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;
}
a.cv-row { transition: opacity 160ms ease; }
a.cv-row:hover { opacity: 0.6; }

.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); }
