:root {
  --paper: #f4efe4;
  --paper-soft: #fbf6ea;
  --ink: #211a16;
  --muted: #6d6458;
  --faint: #a99f8f;
  --line: #cfc3ad;
  --line-strong: #9f947e;
  --olive: #59643b;
  --olive-dark: #3f4727;
  --sepia: #725334;
  --shadow: 0 18px 42px rgba(54, 43, 25, 0.08);
  --display: Georgia, "Times New Roman", serif;
  --sans: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  --mono: "Courier New", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 6%, rgba(255, 255, 255, 0.82), transparent 25rem),
    radial-gradient(circle at 82% 14%, rgba(209, 192, 162, 0.22), transparent 28rem),
    linear-gradient(110deg, rgba(90, 79, 51, 0.035) 0 1px, transparent 1px 7px),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(80, 63, 38, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 63, 38, 0.025) 1px, transparent 1px);
  background-size: 34px 34px, 38px 38px;
  opacity: 0.36;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 4px;
}

.site-shell {
  width: min(100% - 68px, 1500px);
  margin: 0 auto;
}

.site-header {
  display: grid;
  grid-template-columns: 210px 1fr 300px;
  align-items: center;
  min-height: 68px;
  border-bottom: 1px solid var(--line-strong);
}

.brand {
  font-family: var(--display);
  font-size: clamp(1.9rem, 2.3vw, 2.5rem);
  letter-spacing: 0.04em;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 5vw, 5rem);
}

.main-nav a,
.header-kicker,
.archive-meta span,
.info-list dt,
.bio-block h2,
.skills-block h2,
.section-heading h2,
.timeline-controls,
.timeline-date,
.footer-column span {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.main-nav a {
  position: relative;
  padding: 0.7rem 0;
  font-weight: 700;
  transition: color 180ms ease;
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: -1.23rem;
  left: 0;
  height: 2px;
  content: "";
  background: var(--olive);
  opacity: 0;
  transform: scaleX(0.5);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.is-active {
  color: var(--olive-dark);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after,
.main-nav a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.header-kicker {
  justify-self: end;
  margin: 0;
}

.about-page {
  padding-top: clamp(2.6rem, 4.2vw, 4.35rem);
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.86fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: stretch;
}

.archive-photo {
  position: relative;
  min-height: 0;
  margin: 0;
}

.archive-photo .photo-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 0.85rem;
  border: 1px solid rgba(160, 149, 128, 0.72);
  background: rgba(255, 250, 239, 0.18);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border: 1px solid rgba(80, 63, 38, 0.16);
  filter: saturate(0.82) contrast(1.02);
}

.about-content {
  min-width: 0;
}

.about-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.5fr);
  gap: clamp(1.5rem, 2.8vw, 3rem);
  align-items: start;
}

.page-title-block {
  min-width: 0;
  container-type: inline-size;
  border-bottom: 1px solid var(--line-strong);
}

.page-title-block h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.5rem, 7vw, 8rem);
  font-size: clamp(3.5rem, 26cqw, 8rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.035em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.page-path {
  margin: 1.35rem 0 1rem;
  color: var(--olive-dark);
  font-family: var(--mono);
  font-size: clamp(0.92rem, 1.15vw, 1.05rem);
  letter-spacing: 0.06em;
}

.archive-meta {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.1rem;
}

.archive-meta strong {
  margin: 0 0 1rem;
  color: var(--olive);
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: 0.18em;
  line-height: 1;
}

.archive-meta b {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.profile-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 2.2vw, 2rem);
  margin-top: clamp(2.1rem, 4vw, 2.85rem);
}

.info-list {
  display: grid;
  gap: 1.2rem;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: baseline;
  gap: clamp(0.75rem, 1.2vw, 1rem);
}

.info-list dt {
  color: var(--ink);
  font-weight: 700;
}

.info-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  line-height: 1.55;
}

.info-list a {
  transition: color 180ms ease;
}

.info-list a:hover,
.info-list a:focus-visible {
  color: var(--olive-dark);
}

.bio-block {
  padding-left: clamp(1.25rem, 1.7vw, 1.6rem);
  border-left: 1px solid var(--line-strong);
}

.bio-block h2,
.skills-block h2 {
  margin: 0 0 1rem;
  color: var(--olive-dark);
}

.bio-block p {
  max-width: 48rem;
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.72;
}

.bio-block p + p {
  margin-top: 1.1rem;
}

.skills-block {
  margin-top: 2.05rem;
  padding: 1.35rem 0 1.45rem;
  border-bottom: 1px solid var(--line-strong);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  display: flex;
  min-width: 0;
}

.focus-tag {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  overflow: hidden;
  padding: 0.56rem 0.95rem;
  border: 1px solid rgba(153, 141, 121, 0.74);
  border-radius: 3px;
  color: var(--ink);
  background: rgba(255, 250, 239, 0.22);
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color 220ms ease, border-color 220ms ease,
    color 220ms ease, transform 320ms var(--fx-ease, ease), box-shadow 320ms ease;
}

.focus-tag > span {
  position: relative;
  z-index: 1;
}

.focus-tag::before {
  position: absolute;
  inset: 5px;
  content: "";
  pointer-events: none;
  opacity: 0;
  color: var(--olive);
  background:
    linear-gradient(currentColor, currentColor) left top / 5px 1px,
    linear-gradient(currentColor, currentColor) left top / 1px 5px,
    linear-gradient(currentColor, currentColor) right top / 5px 1px,
    linear-gradient(currentColor, currentColor) right top / 1px 5px,
    linear-gradient(currentColor, currentColor) left bottom / 5px 1px,
    linear-gradient(currentColor, currentColor) left bottom / 1px 5px,
    linear-gradient(currentColor, currentColor) right bottom / 5px 1px,
    linear-gradient(currentColor, currentColor) right bottom / 1px 5px;
  background-repeat: no-repeat;
  transform: scale(1.12);
  transition: opacity 220ms ease, transform 320ms var(--fx-ease, ease);
}

.focus-tag::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(110deg, transparent 20%, rgba(251, 246, 234, 0.3) 50%, transparent 80%);
  transform: translateX(-110%);
}

.focus-tag:focus-visible {
  color: var(--olive-dark);
  border-color: var(--olive);
  background: rgba(89, 100, 59, 0.07);
}

.focus-tag:focus-visible::before,
.focus-tag[aria-pressed="true"]::before {
  opacity: 0.8;
  transform: scale(1);
}

.focus-tag[aria-pressed="true"] {
  color: var(--paper-soft);
  border-color: var(--olive-dark);
  background: var(--olive-dark);
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px rgba(251, 246, 234, 0.24);
}

.focus-tag[aria-pressed="true"]::before {
  color: var(--paper-soft);
}

.focus-tag.is-exposing::after {
  animation: focus-exposure 560ms ease-out both;
}

@keyframes focus-exposure {
  from { transform: translateX(-110%); }
  to { transform: translateX(110%); }
}

@media (hover: hover) and (pointer: fine) {
  .focus-tag:hover {
    border-color: var(--olive);
    transform: translateY(calc(-2px * var(--motion-strength, 1)));
    box-shadow: 0 4px 10px rgba(54, 43, 25, 0.08);
  }

  .focus-tag:hover::before {
    opacity: 0.8;
    transform: scale(1);
  }
}

html[data-wong-motion="reduced"] .focus-tag,
html[data-wong-motion="reduced"] .focus-tag::before {
  transition: none;
  transform: none;
}

html[data-wong-motion="reduced"] .focus-tag.is-exposing::after {
  animation: none;
}

.experience-section {
  padding: 1.75rem 0 2.35rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.section-heading h2 {
  margin: 0;
  color: var(--olive-dark);
}

.section-heading p {
  display: inline-block;
  margin: 0 0 0 1.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.section-heading > div:first-child {
  display: flex;
  align-items: baseline;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--muted);
}

.timeline-controls span {
  font-size: 0.72rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 1.2rem;
  transition:
    color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--sepia);
  transform: translateX(2px);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.35;
  transform: none;
}

.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--timeline-count, 6), minmax(0, 1fr));
  align-items: center;
  min-height: 44px;
  margin: 0.75rem 0 0.95rem;
  background: linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat;
}

.timeline-track[hidden] { display: none; }

.timeline-progress {
  position: absolute;
  top: calc(50% - 1px);
  left: calc(50% / var(--timeline-count, 6));
  width: calc(var(--timeline-index, 0) * 100% / var(--timeline-count, 6));
  height: 2px;
  pointer-events: none;
  background: var(--olive);
  opacity: 0.72;
  transition: width var(--motion-duration, 620ms) steps(4, end);
}

.timeline-indicator {
  position: absolute;
  top: 50%;
  left: calc((var(--timeline-index, 0) + 0.5) * 100% / var(--timeline-count, 6));
  z-index: 1;
  width: 19px;
  height: 19px;
  border: 1px solid var(--olive);
  border-radius: 2px;
  background: rgba(251, 246, 234, 0.5);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left var(--motion-duration, 620ms) steps(4, end);
}

.timeline-node {
  position: relative;
  z-index: 2;
  justify-self: center;
  width: min(44px, 100%);
  height: 44px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.timeline-node::before {
  position: absolute;
  inset: 50% auto auto 50%;
  content: "";
  border-radius: 50%;
  pointer-events: none;
}

.timeline-node::before {
  width: 10px;
  height: 10px;
  border: 1px solid var(--olive);
  background: #77715d;
  transform: translate(-50%, -50%);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.timeline-node:is(.is-active, .is-preview, :focus-visible)::before {
  background: var(--paper-soft);
  box-shadow: 0 0 0 2px var(--olive);
}

.timeline-film {
  position: relative;
  padding: 9px 0;
}

.timeline-perforations {
  position: absolute;
  right: 0;
  left: 0;
  height: 6px;
  opacity: 0.6;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 20px);
}

.timeline-perforations-top { top: 0; }
.timeline-perforations-bottom { bottom: 0; }

.timeline-list {
  --timeline-inset: 1.75rem;
  position: relative;
  overflow-x: auto;
  scroll-padding-inline: var(--timeline-inset);
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--line-strong) transparent;
}

.timeline-frames {
  position: relative;
  display: inline-grid;
  min-width: 100%;
  vertical-align: top;
  grid-auto-columns: minmax(205px, 1fr);
  grid-auto-flow: column;
  gap: clamp(1rem, 2vw, 1.8rem);
  padding: 0.75rem var(--timeline-inset) 0.85rem;
}

.timeline-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  cursor: pointer;
  min-height: 180px;
  padding: 1rem 1rem 0.9rem;
  border: 1px solid rgba(187, 173, 148, 0.72);
  border-radius: 4px;
  background: rgba(255, 250, 239, 0.18);
  scroll-snap-align: start;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.timeline-card:hover,
.timeline-card:focus-visible,
.timeline-card.is-preview,
.timeline-card.is-active {
  background: rgba(255, 250, 239, 0.45);
  border-color: var(--olive);
  box-shadow: var(--shadow);
}

.timeline-card::before {
  position: absolute;
  content: "";
  pointer-events: none;
}

.timeline-card::before {
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--olive);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 420ms var(--fx-ease, ease);
}

.timeline-card.is-active::before { transform: scaleY(1); }

html[data-wong-motion="reduced"] :is(.timeline-progress, .timeline-indicator, .timeline-card),
html[data-wong-motion="reduced"] .timeline-card::before,
html[data-wong-motion="reduced"] .timeline-node::before {
  transition: none;
}

html[data-wong-motion="reduced"] .timeline-card.is-active { transform: none; }
html[data-wong-motion="reduced"] .timeline-list { scroll-behavior: auto; }


.timeline-date {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.timeline-card h3 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 400;
  line-height: 1.2;
}

.timeline-place {
  margin: 0 0 0.8rem;
  font-size: 0.84rem;
}

.timeline-card p:not(.timeline-date, .timeline-place) {
  margin: 0 0 1.1rem;
  font-size: 0.86rem;
  line-height: 1.55;
}

.timeline-card span {
  display: block;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer {
  display: grid;
  grid-template-columns: 64px 120px 150px 170px 1fr;
  gap: clamp(1.4rem, 3.4vw, 3.9rem);
  align-items: center;
  padding: 1.6rem 0 1.75rem;
  border-top: 1px solid var(--line-strong);
}

.footer-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-right: 1px solid var(--line-strong);
  padding-right: 1.1rem;
}

.footer-mark svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.footer-column span {
  display: block;
  margin-bottom: 0.45rem;
}

.footer-column p,
.copyright {
  margin: 0;
  font-size: 0.86rem;
}

.copyright {
  justify-self: end;
  color: var(--muted);
}

.reveal-item {
  animation: fade-up 540ms ease-out both;
}

.archive-meta.reveal-item {
  animation-delay: 90ms;
}

.profile-panel.reveal-item {
  animation-delay: 150ms;
}

.skills-block.reveal-item {
  animation-delay: 220ms;
}

.reveal-section {
  animation: fade-up 540ms ease-out 280ms both;
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1250px) {
  .site-header {
    grid-template-columns: 150px 1fr;
    row-gap: 0.5rem;
    padding: 0.9rem 0;
  }

  .header-kicker {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .about-hero {
    grid-template-columns: 1fr;
  }

  .archive-photo {
    width: 100%;
    max-width: 720px;
    aspect-ratio: 609 / 489;
  }

  .about-title-row {
    grid-template-columns: minmax(0, 1fr) 230px;
  }

  .timeline-frames {
    grid-auto-columns: minmax(235px, 31vw);
  }

  .timeline-list {
    --timeline-inset: 1rem;
  }
}

@media (max-width: 820px) {
  .site-shell {
    width: min(100% - 32px, 720px);
  }

  .site-header {
    display: block;
    min-height: 0;
    padding: 1rem 0 0.9rem;
  }

  .brand {
    display: inline-block;
    margin-bottom: 0.7rem;
  }

  .main-nav {
    justify-content: flex-start;
    gap: 0.95rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
  }

  .main-nav a {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .main-nav a::after {
    bottom: -0.15rem;
  }

  .header-kicker {
    margin-top: 0.45rem;
  }

  .about-page {
    padding-top: 2.6rem;
  }

  .photo-frame {
    padding: 0.75rem;
  }

  .about-title-row,
  .profile-panel {
    grid-template-columns: 1fr;
  }

  .about-title-row {
    gap: 1.5rem;
  }

  .page-title-block h1 {
    font-size: clamp(4rem, 19vw, 6.4rem);
    letter-spacing: 0.04em;
  }

  .archive-meta {
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
  }

  .archive-meta strong,
  .archive-meta b {
    margin: 0;
  }

  .profile-panel {
    gap: 2rem;
  }

  .bio-block {
    padding: 1.35rem 0 0;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .section-heading,
  .section-heading > div:first-child {
    display: block;
  }

  .section-heading p {
    margin: 0.35rem 0 0;
  }

  .timeline-controls {
    margin-top: 1rem;
    justify-content: flex-end;
  }

  .timeline-track {
    margin-bottom: 0.65rem;
  }

  .timeline-frames {
    grid-auto-columns: minmax(245px, 82vw);
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
  }

  .footer-mark {
    border-right: 0;
    padding-right: 0;
  }

  .copyright {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .info-list div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .tag-list li {
    flex: 1 1 auto;
  }

  .focus-tag {
    width: 100%;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-card.is-active { transform: none !important; }
  :is(.timeline-progress, .timeline-indicator, .timeline-card),
  .timeline-card::before,
  .timeline-node::before { transition: none !important; }
  .focus-tag,
  .focus-tag::before {
    transform: none !important;
    transition: none !important;
  }

  .focus-tag.is-exposing::after {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
