/* Page-specific compositions — still shared tokens/components */
.page-home .page {
  padding-top: calc(var(--nav-h) + var(--space-6));
  padding-bottom: var(--space-7);
}

.home-layout {
  /*
    Identity on the shared page-left edge. Timeline width is pinned in JS
    so its rail matches the left edge of the top nav (ABOUT…).
    Timeline top is pinned to the portrait top in JS — keep the rail
    hidden until that pass runs so cold loads never flash under the nav.
    Email + socials sit under the portrait (Brittany sticky-column pattern).
  */
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.experience {
  min-width: 0;
  flex: 0 1 auto;
  align-self: flex-start;
}

.identity {
  display: grid;
  justify-items: stretch;
  flex: 0 0 auto;
  align-self: flex-start;
  width: 100%;
  max-width: 20rem;
  min-width: 0;
  margin-left: 0;
  padding-right: 0;
  text-align: left;
  /* Tight name → title; portrait spacing comes from .portrait margin */
  gap: var(--space-2);
}

.identity .identity-title {
  /* Brittany-style: role under the name — foreground type, quieter than the brand */
  justify-self: start;
  width: max-content;
  max-width: 100%;
  margin: 0;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--fg);
  text-align: left;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  white-space: nowrap;
}

.identity .portrait {
  width: 100%;
  margin-top: var(--space-4);
}

.identity-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-4);
}

.identity-contact .contact-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

.identity-contact .contact-line {
  margin-block: 0;
  max-width: 100%;
}

.identity-contact .contact-value {
  white-space: nowrap;
}

.identity-contact .contact-social {
  align-self: stretch;
  width: 100%;
}

/*
  Hide timeline until JS pins width — only when layout JS is active.
  Prevents a one-frame rail at the wrong horizontal position.
*/
@media (min-width: 901px) {
  .has-layout-js .home-layout:not(.is-layout-ready) .experience {
    visibility: hidden;
  }
}

.page-samples .page,
.page-portfolio .page,
.page-contact .page,
.page-resume .page,
.page-reel .page {
  padding-top: calc(var(--nav-h) + var(--space-6));
}

/*
  Shared contact chrome — under the About portrait.
  Quiet email (click to copy) + phone + filled brand marks.
*/

.contact-line,
.contact-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 0.5rem;
  margin-block: var(--space-3);
  padding: 0;
  color: inherit;
  text-decoration: none;
  max-width: 100%;
  transition: color var(--ease);
  -webkit-user-select: text;
  user-select: text;
  cursor: pointer;
}

.contact-line:focus-visible,
.contact-email:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.contact-line__icon,
.contact-email__icon {
  flex: 0 0 auto;
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  color: var(--muted-dim);
  transition: color var(--ease);
  pointer-events: none;
}

.contact-line .contact-value,
.contact-email .contact-value {
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.25;
  color: var(--muted);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--ease);
  -webkit-user-select: text;
  user-select: text;
  cursor: pointer;
}

.contact-line *,
.contact-line *::before,
.contact-line *::after,
.contact-email *,
.contact-email *::before,
.contact-email *::after {
  cursor: pointer;
}

.contact-line:hover .contact-value,
.contact-line:focus-visible .contact-value,
.contact-email:hover .contact-value,
.contact-email:focus-visible .contact-value,
.contact-email.is-copied .contact-value,
.contact-line:hover .contact-line__icon,
.contact-line:focus-visible .contact-line__icon,
.contact-email:hover .contact-email__icon,
.contact-email:focus-visible .contact-email__icon,
.contact-email:hover .contact-line__icon,
.contact-email:focus-visible .contact-line__icon,
.contact-email.is-copied .contact-email__icon,
.contact-email.is-copied .contact-line__icon {
  color: var(--accent);
}

/* Phone: click-to-copy like email; not text-selectable; accent hover */
button.contact-phone {
  border: 0;
  background: transparent;
  font: inherit;
  margin-block: 0;
}

.contact-phone,
.contact-phone .contact-value,
.contact-phone .contact-line__icon,
.contact-phone * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.contact-phone .contact-value {
  color: var(--muted);
}

.contact-phone .contact-line__icon {
  color: var(--muted-dim);
}

.contact-phone:hover .contact-value,
.contact-phone:focus-visible .contact-value,
.contact-phone.is-copied .contact-value,
.contact-phone:hover .contact-line__icon,
.contact-phone:focus-visible .contact-line__icon,
.contact-phone.is-copied .contact-line__icon {
  color: var(--accent);
}

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

.contact-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  gap: 0.45rem;
}

.contact-social__link {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--muted-dim);
  text-decoration: none;
  transition: color var(--ease), transform var(--ease);
}

.contact-social__link:hover,
.contact-social__link:focus-visible {
  color: var(--accent);
}

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

.contact-social__link svg {
  display: block;
}

/*
  Resume — document column shares the site left edge (same as Contact/Experience).
  Download sits on that column’s left rail so it doesn’t float mid-viewport.
  Paper stays a readable measure; not a full-bleed card spanning the shell.
*/
.resume-layout {
  display: grid;
  justify-items: start;
  padding-bottom: var(--space-8);
}

.resume-column {
  width: min(100%, 52rem);
  display: grid;
  gap: var(--space-3);
}

.resume-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-4);
}

.resume-action {
  color: var(--accent);
  font-size: var(--chrome-size);
  font-weight: var(--chrome-weight);
  letter-spacing: var(--chrome-tracking);
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--ease);
}

.resume-action:hover,
.resume-action:focus-visible {
  color: var(--fg);
}

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

/*
  Live HTML resume preview (text select + contact links).
  Height is set to content via resume.html so only the site scrolls —
  no nested iframe scrollbar.
*/
.resume-frame {
  width: 100%;
  margin: 0;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  overflow: hidden;
}

.resume-page {
  display: block;
  width: 100%;
  height: auto;
}

.resume-page--live {
  display: block;
  width: 100%;
  /* Placeholder until JS measures content; then exact content height */
  height: 0;
  border: 0;
  background: #fff;
  overflow: hidden;
  color-scheme: light;
  /* Soften toward PDF-viewer glyph feel (HTML ClearType reads harsher). */
  filter: contrast(0.96);
}

.resume-sheet {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: #f7f6f2;
  color: #1a1f1c;
}

.resume-sheet__header {
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1.75px solid var(--accent);
}

.resume-sheet h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.resume-sheet__headline {
  margin-top: 0.35rem;
  font-size: 1rem;
  font-weight: 500;
  color: #3d4741;
}

.resume-sheet__contact {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: #5a655e;
}

.resume-sheet__contact span + span::before {
  content: "·";
  margin: 0 0.4em;
  color: #9aa39c;
}

.resume-sheet h2 {
  margin: 1rem 0 0.55rem;
  padding-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, #e8e4d4);
}

.resume-role {
  margin-bottom: 0.75rem;
}

.resume-role:last-of-type {
  margin-bottom: 0;
}

.resume-role__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 1rem;
  align-items: baseline;
}

.resume-role__title {
  font-size: 0.95rem;
  font-weight: 700;
}

.resume-role__meta {
  font-size: 0.85rem;
  color: #3d4741;
}

.resume-role__dates {
  font-size: 0.8rem;
  color: #5a655e;
  white-space: nowrap;
  text-align: right;
}

.resume-role p {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #2a322e;
}

.resume-focus {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #2a322e;
}

/*
  Reel — quiet year label, then media spanning the full content shell
  (same width rhythm as Samples). No arbitrary mid-width cap.
*/
.reel-layout {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-8);
  justify-items: stretch;
}

.reel-title {
  /* Same chrome recipe as nav + Resume Open / Download */
  justify-self: start;
  margin: 0;
  color: var(--accent);
  font-size: var(--chrome-size);
  font-weight: var(--chrome-weight);
  letter-spacing: var(--chrome-tracking);
  text-transform: uppercase;
}

.yt-facade {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0a0e0c;
}

.yt-facade.is-playing iframe,
.yt-facade.is-playing .yt-facade__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-facade__button {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

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

.yt-facade__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-facade__play {
  position: relative;
  z-index: 1;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: rgba(15, 20, 18, 0.72);
  border: 1px solid rgba(232, 236, 233, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: border-color var(--ease), background var(--ease);
}

.yt-facade__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.9rem;
  border-color: transparent transparent transparent var(--fg);
  transform: translate(-50%, -50%);
}

.yt-facade__button:hover .yt-facade__play,
.yt-facade__button:focus-visible .yt-facade__play {
  border-color: var(--accent);
  background: rgba(15, 20, 18, 0.85);
}

.yt-facade__button:hover .yt-facade__play::before,
.yt-facade__button:focus-visible .yt-facade__play::before {
  border-color: transparent transparent transparent var(--accent);
}

@media (min-width: 901px) {
  .identity {
    position: sticky;
    top: calc(var(--nav-h) + var(--space-6));
  }
}

@media (max-width: 900px) {
  .home-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-7);
    align-items: start;
  }

  .identity {
    justify-self: start;
    width: 100%;
    max-width: 20rem;
    margin-left: 0;
    padding-right: 0;
    position: static;
  }

  .experience {
    width: auto !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
  }

  .identity .portrait {
    width: min(100%, 16rem);
  }

  .timeline-summary {
    grid-template-columns: 6rem minmax(0, 1fr);
    column-gap: var(--space-3);
  }

  .timeline-body {
    margin-left: calc(6rem + var(--space-3));
  }

  .timeline-project,
  .timeline-role {
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
  }
}

@media (max-width: 834px) {
  .site-header {
    padding-inline: var(--page-gutter);
  }

  .page-portfolio .page,
  .page-samples .page,
  .page-contact .page,
  .page-resume .page,
  .page-reel .page,
  .page-home .page {
    width: min(100% - (var(--page-gutter) * 2), var(--page-max));
  }
}

@media (max-width: 700px) {
  :root {
    /* Two-line nav (5 links) needs more clearance than the desktop bar */
    --nav-h: 7.75rem;
  }

  .site-header {
    min-height: var(--nav-h);
    align-items: flex-start;
  }

  .nav-actions {
    justify-content: flex-end;
    row-gap: var(--space-2);
    padding-inline: 0;
  }

  .btn {
    min-height: 2rem;
    letter-spacing: var(--chrome-tracking);
  }
}

@media (max-width: 480px) {
  .hero-brand {
    font-size: clamp(2.2rem, 11vw, 2.8rem);
  }

  .btn {
    min-height: 2.25rem;
  }

  .timeline-summary {
    grid-template-columns: 1fr;
  }

  .timeline-dates {
    margin-bottom: var(--space-1);
  }

  .timeline-body {
    margin-left: 0;
  }
}
