:root {
  --background: #f7f7f5;
  --surface: #ffffff;
  --surface-muted: #ecece8;
  --text: #111111;
  --text-muted: #666660;
  --line: #d8d8d2;
  --accent: #1f5eff;
  --max-width: 1180px;
  --mono: "DM Mono", monospace;
  --sans: "Inter", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(247, 247, 245, 0.88);
  border-bottom: 1px solid rgba(216, 216, 210, 0.8);
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 18px max(24px, calc((100vw - var(--max-width)) / 2));
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100;
}

.brand {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.site-nav {
  display: flex;
  gap: 30px;
}

.site-nav a {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.menu-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  display: none;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.section {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 130px 24px;
}

.hero {
  align-items: center;
  display: grid;
  gap: 80px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  min-height: 100vh;
  padding-top: 160px;
}

.eyebrow,
.section-label,
.timeline-year,
.card-index {
  font-family: var(--mono);
}

.eyebrow {
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 6.4rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.98;
  max-width: 950px;
}

.hero-title span {
  color: var(--text);
}

.hero-title span:last-child {
  color: var(--text-muted);
}

.hero-text {
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-top: 30px;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.button {
  align-items: center;
  border: 1px solid var(--text);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.78rem;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--text);
  color: var(--surface);
}

.button-secondary {
  background: transparent;
}

.portrait {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  min-height: 430px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.content-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 60px;
  grid-template-columns: 150px minmax(0, 1fr);
}

.muted-section {
  background: var(--surface-muted);
  box-shadow: 0 0 0 100vmax var(--surface-muted);
  clip-path: inset(0 -100vmax);
}

.section-label {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.section-label span {
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.section-content h2,
.contact-section h2 {
  font-size: clamp(2.35rem, 5vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.02;
  max-width: 900px;
}

.two-column-copy {
  display: grid;
  gap: 50px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 48px;
}

.two-column-copy p,
.section-intro,
.contact-section > p {
  color: var(--text-muted);
  font-size: 1.02rem;
}

.timeline {
  border-top: 1px solid var(--line);
  margin-top: 70px;
}

.timeline-item {
  border-bottom: 1px solid var(--line);
  padding: 0;
}

.story-accordion summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 30px;
  grid-template-columns: 150px 1fr 40px;
  list-style: none;
  padding: 30px 0;
}

.story-accordion {
  transition: background-color 0.3s ease;
}

.story-accordion summary {
  border-radius: 8px;
  transition:
    padding 0.3s ease,
    transform 0.3s ease,
    background-color 0.3s ease;
}

.story-accordion summary:hover {
  background: rgba(31, 94, 255, 0.05);
  transform: translateX(8px);
}

.story-accordion summary::-webkit-details-marker {
  display: none;
}

.story-accordion summary h3 {
  font-size: 1.3rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.story-accordion summary:hover h3 {
  color: var(--accent);
}

.accordion-icon {
  color: var(--accent);
  font-size: 1.5rem;
  justify-self: end;
  transition: transform 0.25s ease;
}

.story-accordion[open] .accordion-icon {
  transform: rotate(45deg);
}

.story-content {
  color: var(--text-muted);
  max-width: 760px;
  padding: 0 0 36px 180px;
}

.story-content p {
  line-height: 1.75;
}

.timeline-year,
.card-index {
  color: var(--accent);
  font-size: 0.72rem;
}

.timeline-item h3,
.info-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

.timeline-item p:last-child,
.info-card p:last-child {
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 60px;
}

.info-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(216, 216, 210, 0.9);
  min-height: 300px;
  padding: 26px;
}

.info-card h3 {
  margin: 8px 0 16px;
}

.resume-layout {
  align-items: center;
  display: grid;
  gap: 80px;
  grid-template-columns: 1fr 0.8fr;
}

.section-intro {
  margin: 28px 0 34px;
  max-width: 600px;
}

.resume-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  min-height: 520px;
  padding: 44px;
  transform: rotate(2deg);
}

.resume-line,
.resume-block {
  background: var(--surface-muted);
}

.resume-line {
  height: 10px;
  margin-bottom: 14px;
}

.resume-line.wide {
  width: 82%;
}

.resume-line.medium {
  width: 60%;
}

.resume-line.short {
  width: 38%;
}

.resume-block {
  height: 90px;
  margin: 34px 0;
}

.resume-block.small {
  height: 64px;
}

.contact-section {
  border-top: 1px solid var(--line);
  padding-bottom: 100px;
  text-align: center;
}

.contact-section h2 {
  margin: 0 auto;
}

.contact-section > p {
  margin: 28px auto 0;
  max-width: 620px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 36px;
}

.contact-links a {
  border-bottom: 1px solid var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  margin: 0 10px;
  padding-bottom: 3px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  display: flex;
  font-family: var(--mono);
  font-size: 0.7rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 28px 24px 50px;
}

@media (max-width: 900px) {
  .hero {
    gap: 50px;
    grid-template-columns: 1fr;
  }

  .portrait-placeholder {
    max-width: 500px;
    width: 100%;
  }

  .content-section {
    grid-template-columns: 1fr;
  }

  .section-label {
    display: flex;
    gap: 10px;
  }

  .section-label span {
    margin-bottom: 0;
  }

  .card-grid,
  .resume-layout {
    grid-template-columns: 1fr;
  }

  .resume-preview {
    max-width: 550px;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 16px 20px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    background: var(--background);
    border-bottom: 1px solid var(--line);
    display: none;
    flex-direction: column;
    gap: 20px;
    left: 0;
    padding: 28px 20px;
    position: absolute;
    right: 0;
    top: 61px;
  }

  .site-nav.open {
    display: flex;
  }

  .section {
    width: 100%;
    padding: 95px 16px;
  }

  .hero {
    min-height: auto;
    padding-top: 130px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 14vw, 4.8rem);
  }

  .portrait-placeholder {
    min-height: 380px;
  }

  .two-column-copy,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    gap: 10px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    min-height: 240px;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
  }
  .story-accordion summary {
    grid-template-columns: 1fr 32px;
    gap: 10px;
    padding: 24px 0;
  }

  .story-accordion summary .timeline-year {
    grid-column: 1 / -1;
  }

  .story-accordion summary h3 {
    font-size: 1.15rem;
  }

  .accordion-icon {
    font-size: 1.3rem;
  }

  .story-content {
    max-width: none;
    padding: 0 0 28px;
  }
  .hero,
  .content-section,
  .section-content,
  .resume-layout,
  .card-grid {
    min-width: 0;
    width: 100%;
  }

  .story-accordion summary:hover {
    transform: none;
  }

  .resume-preview,
  .resume-link:hover .resume-preview {
    transform: none;
  }

  .portrait,
  .card-image,
  .resume-link,
  .resume-preview {
    max-width: 100%;
  }
}
.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.info-card:hover .card-image img {
  transform: scale(1.03);
}

.resume-link {
  display: block;
}

.resume-preview {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  transform: rotate(3deg);

  filter: grayscale(100%) brightness(85%) blur(1.5px);
  transition:
    filter 0.35s ease,
    transform 0.35s ease,
    box-shadow 0.35s ease;

  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}
.resume-link:hover .resume-preview {
  filter: grayscale(0%) brightness(100%);
  transform: rotate(0deg) translateY(-8px);

  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.18);
}
.resume-link {
  display: block;
}

.resume-link:hover .resume-preview {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.14);
}

/* ========================================
   HIGH-IMPACT SCROLL AND ENTRANCE EFFECTS
======================================== */

/* Scroll progress bar */
.scroll-progress {
  background: var(--accent);
  box-shadow: 0 0 14px rgba(31, 94, 255, 0.55);
  height: 4px;
  left: 0;
  position: fixed;
  top: 0;
  transform: scaleX(0);
  transform-origin: left;
  width: 100%;
  z-index: 200;
}

/* Hero entrance */
.hero-copy {
  animation: hero-pop-in 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.portrait {
  animation: portrait-pop-in 1.15s 0.14s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-actions .button {
  animation: button-pop 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-actions .button:nth-child(1) {
  animation-delay: 0.55s;
}

.hero-actions .button:nth-child(2) {
  animation-delay: 0.68s;
}

.hero-title {
  overflow: hidden;
}

.hero-title span {
  display: block;
  opacity: 0;
  transform: translateY(90px) rotate(2deg);
  animation: hero-line-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title span:nth-child(1) {
  animation-delay: 0.15s;
}

.hero-title span:nth-child(2) {
  animation-delay: 0.32s;
}

.hero-title span:nth-child(3) {
  animation-delay: 0.49s;
}

@keyframes hero-line-in {
  0% {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(90px) rotate(2deg);
  }

  75% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-8px) rotate(0);
  }

  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) rotate(0);
  }
}

@keyframes hero-pop-in {
  from {
    opacity: 0;
    transform: translateY(58px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes portrait-pop-in {
  0% {
    opacity: 0;
    transform: translateX(55px) rotate(4deg) scale(0.9);
  }
  72% {
    transform: translateX(-5px) rotate(-1deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotate(0) scale(1);
  }
}

@keyframes button-pop {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Reveal states used by script.js */
.reveal-up,
.reveal-left,
.reveal-scale {
  opacity: 0;
  transition:
    opacity 0.75s ease,
    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.8s ease;
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform, filter;
}

.reveal-up {
  filter: blur(5px);
  transform: translateY(70px) scale(0.94);
}

.reveal-left {
  filter: blur(4px);
  transform: translateX(-60px) rotate(-4deg) scale(0.9);
}

.reveal-scale {
  filter: blur(5px);
  transform: perspective(1100px) rotateY(-18deg) rotateZ(4deg) scale(0.86);
  transform-origin: center;
}

.reveal-up.visible,
.reveal-left.visible,
.reveal-scale.visible {
  filter: blur(0);
  opacity: 1;
  transform: translate(0) rotate(0) scale(1);
}

/* Large section numbers punch into place */
.section-label.reveal-left span {
  display: inline-block;
  transform-origin: center;
  transition:
    color 0.4s ease,
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-label.reveal-left.visible span {
  animation: section-number-punch 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes section-number-punch {
  0% {
    opacity: 0;
    transform: scale(3.5) rotate(-14deg);
  }
  72% {
    transform: scale(0.86) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

/* Story rows sweep in */
.timeline-item {
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.timeline-item::before {
  background: linear-gradient(
    90deg,
    rgba(31, 94, 255, 0),
    rgba(31, 94, 255, 0.15),
    rgba(31, 94, 255, 0)
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-120%);
  z-index: -1;
}

.timeline-item.visible::before {
  animation: story-sweep 1.05s var(--delay, 0ms) cubic-bezier(0.16, 1, 0.3, 1)
    both;
}

@keyframes story-sweep {
  to {
    transform: translateX(120%);
  }
}

.story-accordion summary {
  transition:
    background-color 0.3s ease,
    letter-spacing 0.3s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-accordion summary:hover {
  background: rgba(31, 94, 255, 0.07);
  transform: translateX(8px) scale(1.01);
}

.story-accordion[open] summary {
  background: rgba(31, 94, 255, 0.07);
}

.accordion-icon {
  transition:
    color 0.3s ease,
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-accordion[open] .accordion-icon {
  color: var(--accent);
  transform: rotate(135deg) scale(1.28);
}

.story-accordion[open] .story-content {
  animation: story-content-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes story-content-pop {
  from {
    filter: blur(4px);
    opacity: 0;
    transform: translateY(-24px) scale(0.98);
  }
  to {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Beyond Business cards */
.info-card.reveal-up {
  transform: translateY(95px) scale(0.88) rotate(2deg);
}

.info-card.reveal-up:nth-child(2) {
  transform: translateY(95px) scale(0.88) rotate(-2deg);
}

.info-card.reveal-up.visible {
  transform: translateY(0) scale(1) rotate(0);
}

.info-card {
  transition:
    background-color 0.35s ease,
    box-shadow 0.4s ease,
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-card:hover {
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(31, 94, 255, 0.16);
  transform: translateY(-14px) scale(1.035);
}

.card-image {
  position: relative;
}

.card-image::after {
  background: linear-gradient(
    120deg,
    transparent 25%,
    rgba(255, 255, 255, 0.42),
    transparent 75%
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-130%);
}

.info-card.visible .card-image::after {
  animation: image-shine 1s 0.18s ease both;
}

@keyframes image-shine {
  to {
    transform: translateX(130%);
  }
}

.card-image img {
  transition:
    filter 0.8s ease,
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-card:not(.visible) .card-image img {
  filter: saturate(55%) contrast(0.9);
  transform: scale(1.12);
}

.info-card.visible .card-image img {
  filter: saturate(100%) contrast(1);
  transform: scale(1);
}

.info-card:hover .card-image img {
  filter: saturate(115%) contrast(1.04);
  transform: scale(1.06);
}

/* Resume swings into view */
.resume-link.reveal-scale.visible {
  animation: resume-swing 1.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes resume-swing {
  0% {
    opacity: 0;
    transform: perspective(1100px) rotateY(-24deg) rotateZ(7deg)
      translateY(70px) scale(0.82);
  }
  72% {
    transform: perspective(1100px) rotateY(3deg) rotateZ(-1deg) translateY(-8px)
      scale(1.03);
  }
  100% {
    opacity: 1;
    transform: perspective(1100px) rotateY(0) rotateZ(0) translateY(0) scale(1);
  }
}

/* Contact section gets a final pop */
.contact-section.visible h2,
.contact-section .visible h2 {
  text-shadow: 0 0 0 rgba(31, 94, 255, 0);
}

.contact-links a {
  transition:
    color 0.25s ease,
    letter-spacing 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-links a:hover {
  color: var(--accent);
  letter-spacing: 0.12em;
  transform: translateY(-4px) scale(1.08);
}

/* Mobile: keep the drama without horizontal overflow */
@media (max-width: 720px) {
  .reveal-up,
  .reveal-left {
    transform: translateY(55px) scale(0.92);
  }

  .reveal-up.visible,
  .reveal-left.visible {
    transform: translateY(0) scale(1);
  }

  .story-accordion summary:hover,
  .info-card:hover {
    transform: none;
  }

  .info-card.reveal-up,
  .info-card.reveal-up:nth-child(2) {
    transform: translateY(75px) scale(0.9) rotate(0);
  }

  .info-card.reveal-up.visible {
    transform: translateY(0) scale(1);
  }

  .portrait {
    animation-duration: 0.9s;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .hero-copy,
  .portrait,
  .hero h1,
  .hero-actions .button,
  .section-label.reveal-left.visible span,
  .timeline-item.visible::before,
  .story-accordion[open] .story-content,
  .info-card.visible .card-image::after,
  .resume-link.reveal-scale.visible {
    animation: none;
  }

  .reveal-up,
  .reveal-left,
  .reveal-scale {
    filter: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-progress {
    display: none;
  }
}

.endurance-image {
  width: 100%;
  height: auto !important;
  object-fit: initial !important;
}

.endurance-container {
  aspect-ratio: auto;
  overflow: visible;
}
