/* =============================================================
   Design tokens
   ============================================================= */

:root {
  --bg: #f7f7f4;
  --ink: #181818;
  --ink-soft: #585855;
  --rule: rgba(20, 20, 20, 0.13);
  --accent: #4a8caf;

  --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%);
  --portrait-filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.04));
  --disney-filter: none;

  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: Georgia, Palatino, "Palatino Linotype", Times, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1424;
    --ink: #c5c5c2;
    --ink-soft: #9fb0c8;
    --rule: 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%);
    --portrait-filter: none;
    --disney-filter: invert(1);
  }
}

/* =============================================================
   Reset & base
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga";
}

::selection { background: var(--ink); color: var(--bg); }

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
a:focus { outline: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* =============================================================
   Entrance reveal (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; }
  .reveal-3 { animation-delay: 360ms; }
  .reveal-4 { animation-delay: 500ms; }
  .reveal-5 { animation-delay: 640ms; }
  @keyframes fadeUp { to { opacity: 1; transform: none; } }
}

/* =============================================================
   Home page
   ============================================================= */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.container-flex {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: 0;
}

.name {
  font-family: var(--sans);
  font-size: clamp(2.5rem, 7vw, 3.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin: 0 auto 0.22em;
  max-width: var(--measure);
}

.role {
  font-family: var(--sans);
  font-size: clamp(1.5rem, 3.4vw, 1.9rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink-soft);
  margin: 0 auto clamp(1.25rem, 3.5vw, 2.25rem);
  max-width: var(--measure);
}
.role a {
  display: inline-flex;
  align-items: center;
  background: var(--role-gradient);
  color: #fff;
  padding: 0.17em 0.4em;
  margin-left: 0.12em;
  border-radius: 0.28em;
  vertical-align: middle;
  transform: translateY(-0.08em);
  transition: filter 200ms;
}
.role a:hover { background: var(--role-gradient-hover); }
.role a > span { display: inline-flex; align-items: center; }
.role a svg { display: block; height: 1.04em; width: auto; }
.role a svg path { fill: #fff; }

.prose {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  max-width: var(--measure);
  margin: 0 auto;
}
.prose p {
  margin: 0 0 1.5em;
  hyphens: auto;
  text-wrap: pretty;
}
.prose p:last-of-type { margin-bottom: 0; }
.prose a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  transition: border-color 180ms, color 180ms;
}
.prose a:hover {
  color: var(--accent);
  border-bottom-color: var(--ink);
}

.inline-links {
  display: grid;
  grid-template-columns: max-content;
  gap: 0.25em;
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: var(--measure);
  margin: clamp(2rem, 4vw, 3rem) auto 0.78em;
  padding: 0 var(--pad-x);
  box-sizing: content-box;
}
.inline-links a {
  color: var(--ink);
  transition: color 200ms;
}
.inline-links a:hover { color: var(--accent); }
.links-sep {
  width: 100%;
  height: 0;
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0.2em 0;
  justify-self: stretch;
}

.portrait-wrap {
  max-width: calc(368px + 2 * var(--pad-x));
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.portrait {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  max-width: 368px;
  max-height: 88vh;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: var(--portrait-filter);
}
.portrait, .portrait img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.portrait img::selection { background: transparent; }

/* ── Mobile (≤560px) ── */
@media (max-width: 560px) {
  .name { letter-spacing: -0.022em; }
  .inline-links { font-size: clamp(17.07px, 5.46vw, 2.56rem); }
  .portrait { width: 85%; }
}

/* ── Standard desktop (561–1499px) ── */
@media (min-width: 561px) and (max-width: 1499px) {
  .inline-links { font-size: 1.35rem; letter-spacing: -0.015em; }
  .portrait { max-width: 331px; }
}

/* ── Two-column wide desktop (≥1500px) ── */
@media (min-width: 1500px) {
  .container-flex {
    display: grid;
    grid-template-columns: 368px minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    column-gap: clamp(3.4rem, 5.1vw, 6.8rem);
    align-items: start;
    max-width: 1300px;
    margin: 0 auto;
    padding: clamp(3.5rem, 6vw, 7rem) var(--pad-x);
  }
  .container-flex > .page { display: contents; }

  .name {
    grid-column: 1;
    grid-row: 1;
    max-width: none;
    margin: 0 0 0.22em;
    font-size: 3.2rem;
  }
  .role {
    grid-column: 1;
    grid-row: 2;
    max-width: none;
    margin: 0 0 clamp(1.5rem, 2.5vw, 2.5rem);
    font-size: 1.9rem;
  }
  .inline-links {
    grid-column: 1;
    grid-row: 3;
    max-width: none;
    margin: 0 0 0.78em;
    padding: 0;
    font-size: 1.35rem;
    letter-spacing: -0.015em;
  }
  .portrait-wrap {
    grid-column: 1;
    grid-row: 4;
    display: flex;
    align-items: flex-end;
    max-width: 338px;
    min-height: 0;
    margin: 0;
    padding: 0;
    align-self: stretch;
    overflow: hidden;
  }
  .container-flex .portrait {
    width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: auto;
  }
  .prose {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: start;
    max-width: 48rem;
    margin: 0 0 calc((1 - 1.6) * 0.5em) 0;
    font-size: 1.125rem;
    line-height: 1.6;
  }
}

@media print {
  :root { --bg: #fff; --ink: #111; --ink-soft: #444; }
  .portrait { max-height: 60vh; }
}

/* =============================================================
   Work page
   ============================================================= */

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

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

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

.head {
  font-size: clamp(2.5rem, 7vw, 3.2rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 0 0 0.4em;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 38rem;
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
}
.lede strong {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink);
}

@media (min-width: 1500px) {
  .lede { max-width: none; margin-left: 0; }
}

.section-label {
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin: clamp(2.5rem, 6vw, 4rem) 0 0.6rem;
}
.section-label:first-of-type { margin-top: 0; }

/* ── Experience list ── */

.work-list {
  display: flex;
  flex-direction: column;
}
.work-item {
  display: grid;
  grid-template-columns: 3.4rem 1fr auto;
  align-items: center;
  gap: 0 1rem;
  padding: 0.7rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 10px;
  transition: background 160ms;
}
a.work-item:hover {
  background: color-mix(in oklch, var(--ink) 6%, transparent);
}
a.work-item:hover .work-co { color: var(--accent); }

.logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  justify-self: center;
}
.logo-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.logo-tile.penn img { width: 90%; height: 90%; }
.logo-tile.espn img { width: 92%; height: 92%; }
.logo-tile.disney { width: 3.2rem; }
.logo-tile.disney img {
  width: 100%;
  height: auto;
  filter: var(--disney-filter);
}

.work-line {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.work-co {
  font-size: clamp(0.98rem, 1.6vw, 1.15rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 160ms;
}
.work-role {
  font-size: clamp(0.83rem, 1.35vw, 0.92rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink-soft);
}
.work-year {
  font-family: var(--mono);
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  white-space: nowrap;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 601px) {
  .work-item { align-items: start; }
  .logo-tile { align-self: center; }
  .work-year { align-self: baseline; }
}

@media (max-width: 600px) {
  .work-item {
    grid-template-columns: 3.4rem 1fr;
    align-items: center;
    gap: 0.1rem 0.8rem;
  }
  .work-line { grid-column: 2; }
  .work-year {
    grid-column: 2;
    justify-self: start;
    font-size: 0.85rem;
    margin-top: 0.2rem;
  }
}

/* ── Awards & recognition ── */

.sub-label {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 2.25rem 0 0.4rem;
}
.sub-label:first-of-type { margin-top: 0.5rem; }
.sub-label.with-emmy,
.sub-label.with-seal {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.sub-label .emmy-stat,
.sub-label .seal-mark {
  height: 2.1rem;
  width: auto;
}

.award-list {
  display: flex;
  flex-direction: column;
}
.award-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.award-item:last-child { border-bottom: none; }
.award-title {
  font-size: clamp(0.9rem, 1.4vw, 1rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.award-note {
  color: var(--ink-soft);
  font-weight: 400;
}
.award-year {
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.3vw, 0.9rem);
  color: var(--ink-soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .award-item {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .award-year { order: -1; }
}

/* =============================================================
   Error pages
   ============================================================= */

.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: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
  font-variant-numeric: tabular-nums;
}

.error-page .head { margin-bottom: 0.5em; }

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

.error-page .back {
  align-self: flex-start;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
