:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-soft: #edf2ee;
  --ink: #17211d;
  --muted: #59655f;
  --line: #d9ded7;
  --accent: #126d5d;
  --accent-strong: #0b4c42;
  --rust: #a34d32;
  --gold: #d59a2d;
  --shadow: 0 24px 60px rgba(25, 33, 30, 0.14);
  --max: 1160px;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

body.nav-open {
  overflow: hidden;
}

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

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

p,
h1,
h2,
h3 {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 52px);
  color: #ffffff;
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.site-header.is-scrolled,
.site-header.nav-active {
  background: rgba(247, 244, 239, 0.94);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(23, 33, 29, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 800;
}

.brand span:last-child {
  overflow-wrap: anywhere;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
  font-size: 0.95rem;
  font-weight: 700;
}

.site-nav a {
  position: relative;
  padding: 10px 0;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 2px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}

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

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(740px, 88svh);
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(15, 22, 19, 0.88), rgba(15, 22, 19, 0.42) 58%, rgba(15, 22, 19, 0.18)),
    url("assets/portfolio-hero.png") center / cover no-repeat;
  color: #ffffff;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  content: "";
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 36px));
  margin-left: clamp(18px, 8vw, 110px);
  padding: 150px 0 76px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f4bb64;
}

.hero h1 {
  margin-bottom: 18px;
  max-width: 12.5ch;
  overflow-wrap: anywhere;
  font-size: clamp(2.55rem, 7.5vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 660px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 13px 18px;
  font-weight: 850;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

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

.button-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(18, 109, 93, 0.28);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-strong);
}

.button-secondary {
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.08);
}

.intro-band {
  background: var(--ink);
  color: #ffffff;
}

.intro-grid {
  display: grid;
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.intro-grid > div {
  min-height: 136px;
  padding: clamp(22px, 4vw, 34px);
  background: var(--ink);
}

.metric,
.metric-label {
  display: block;
}

.metric {
  color: #f0b44e;
  font-size: clamp(2rem, 5vw, 3.9rem);
  font-weight: 900;
  line-height: 1;
}

.metric-label {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.section,
.split-section,
.contact-section {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
}

.section {
  padding: clamp(76px, 10vw, 132px) 0;
}

.section.muted {
  width: 100%;
  max-width: none;
  padding-right: max(18px, calc((100vw - var(--max)) / 2));
  padding-left: max(18px, calc((100vw - var(--max)) / 2));
  background: var(--surface-soft);
}

.section-header {
  max-width: 710px;
  margin-bottom: 34px;
}

.section-header.compact {
  margin-bottom: 0;
}

.section-header h2,
.contact-section h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.section-header p,
.contact-section p,
.about-copy p,
.timeline-item p,
.project-card p {
  color: var(--muted);
}

.showcase-section {
  padding-top: clamp(76px, 10vw, 132px);
  background: #f4f6f8;
}

.showcase-header {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto clamp(30px, 5vw, 54px);
}

.scroll-stack {
  height: calc(var(--stack-count) * 100svh);
}

.scroll-stack-pin {
  position: sticky;
  top: 0;
  display: grid;
  height: 100svh;
  place-items: center;
  padding: 24px 18px;
}

.stack-stage {
  position: relative;
  width: min(100%, 1000px);
  height: min(590px, calc(100svh - 48px));
}

.stack-card {
  position: absolute;
  inset: 0;
  z-index: calc(10 + var(--card-index));
  padding-top: 56px;
  transform-origin: center top;
  will-change: transform;
}

.stack-tab {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  width: min(245px, 62vw);
  height: 56px;
  align-items: center;
  border-radius: 8px 8px 0 0;
  padding: 0 22px;
  background: var(--card-color);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 850;
}

.stack-card-inner {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1.05fr) minmax(285px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  overflow: hidden;
  border-radius: 0 8px 8px 8px;
  padding: clamp(28px, 5vw, 60px);
  background: var(--card-color);
  box-shadow: 0 18px 42px rgba(23, 33, 29, 0.18), inset 0 -2px 4px rgba(23, 33, 29, 0.16);
}

.stack-copy {
  max-width: 470px;
}

.stack-copy .project-type {
  color: var(--accent-strong) !important;
}

.stack-copy h3 {
  margin-bottom: 16px;
  font-size: clamp(1.85rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.stack-copy > p:not(.project-type) {
  margin-bottom: 0;
  color: rgba(23, 33, 29, 0.66);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}

.stack-copy .tag-list li {
  border-color: rgba(23, 33, 29, 0.16);
  background: rgba(255, 255, 255, 0.4);
}

.stack-project-link {
  display: inline-flex;
  margin-top: 22px;
  align-items: center;
  border-bottom: 2px solid currentColor;
  padding-bottom: 3px;
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 850;
}

.stack-project-link:hover,
.stack-project-link:focus-visible {
  color: var(--rust);
}

.stack-image-wrap {
  min-height: 0;
  height: clamp(250px, 36vw, 405px);
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
}

.stack-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(23, 33, 29, 0.06);
}

.project-card img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
}

.project-card-body {
  padding: 22px;
}

.project-type {
  margin-bottom: 8px;
  color: var(--rust) !important;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-card h3,
.timeline-item h3,
.skill-groups h3 {
  margin-bottom: 8px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #faf9f6;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.split-section {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: clamp(30px, 6vw, 84px);
  padding: clamp(76px, 10vw, 132px) 0;
}

.about-copy {
  font-size: 1.03rem;
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 32px;
}

.skill-groups > div {
  border-top: 4px solid var(--gold);
  padding-top: 16px;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(18px, 4vw, 44px);
  border-top: 1px solid #cdd5cd;
  padding-top: 24px;
}

.timeline-date {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 900;
}

.contact-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 30px;
  align-items: center;
  padding: clamp(76px, 10vw, 132px) 0;
}

.contact-actions {
  justify-content: flex-end;
}

.contact-actions .button-secondary {
  border-color: var(--line);
  background: var(--surface);
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-2px);
}

.icon-button svg {
  width: 21px;
  height: 21px;
}

.icon-button::after {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(3px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.icon-button:hover::after,
.icon-button:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-footer {
  display: flex;
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 800;
}

@media (max-width: 920px) {
  .project-grid,
  .skill-groups,
  .split-section,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

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

  .nav-toggle {
    display: grid;
  }

  .site-nav {
    position: fixed;
    top: 72px;
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
  }

  .site-header.nav-active .site-nav {
    display: flex;
  }

  .site-nav a {
    padding: 16px 18px;
  }

  .site-nav a + a {
    border-top: 1px solid var(--line);
  }

  .site-nav a::after {
    display: none;
  }

  .hero {
    min-height: 84svh;
    background-position: 62% center;
  }

  .hero-content {
    width: min(100% - 36px, 640px);
    margin: 0 auto;
    padding-bottom: 54px;
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .contact-actions .icon-button {
    width: 48px;
  }

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

  .showcase-section {
    padding-top: 76px;
  }

  .scroll-stack {
    height: calc(var(--stack-count) * 88svh);
  }

  .scroll-stack-pin {
    padding: 12px 18px;
  }

  .stack-stage {
    height: min(660px, calc(100svh - 24px));
  }

  .stack-card {
    padding-top: 46px;
  }

  .stack-tab {
    width: min(210px, 66vw);
    height: 46px;
    padding: 0 16px;
    font-size: 0.82rem;
  }

  .stack-card-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(180px, 1fr);
    gap: 18px;
    padding: 26px;
  }

  .stack-copy h3 {
    margin-bottom: 10px;
    font-size: clamp(1.55rem, 8vw, 2.1rem);
  }

  .stack-copy > p:not(.project-type) {
    font-size: 0.94rem;
  }

  .stack-copy .tag-list {
    margin-top: 13px;
  }

  .stack-image-wrap {
    height: auto;
  }

  .intro-grid > div {
    min-height: 112px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .scroll-stack {
    height: auto;
  }

  .scroll-stack-pin {
    position: static;
    height: auto;
    padding-bottom: 76px;
  }

  .stack-stage {
    display: grid;
    height: auto;
    gap: 18px;
  }

  .stack-card {
    position: static;
    padding-top: 56px;
    transform: none !important;
  }
}
