:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-soft: #faf7f2;
  --ink: #111111;
  --muted: #66625c;
  --line: rgba(17, 17, 17, 0.1);
  --accent: #7b6b5a;
  --accent-soft: #ebe4da;
  --shadow-soft: 0 18px 40px rgba(17, 17, 17, 0.06);
  --shadow-strong: 0 36px 90px rgba(17, 17, 17, 0.18);
  --radius-xl: 32px;
  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 16px;
  --container: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  background: rgba(123, 107, 90, 0.16);
}

.site-shell {
  width: min(100%, calc(var(--container) + 64px));
  margin: 0 auto;
  padding: 0 20px 48px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 14px;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  transform: translateX(-50%);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand,
.site-nav a {
  font-size: 0.94rem;
  letter-spacing: 0.03em;
}

.brand {
  font-weight: 600;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
}

.site-nav a {
  position: relative;
  transition: color 220ms ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
}

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

.hero {
  min-height: calc(100svh - 64px);
  display: grid;
  align-content: center;
  padding: clamp(64px, 14vh, 140px) 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(280px, 0.72fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: end;
}

.hero-grid > *,
.section-heading > *,
.about-grid > * {
  min-width: 0;
}

.eyebrow,
.section-index,
.summary-label,
.project-meta {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-name-local {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.hero-name {
  margin: 0;
  font-size: clamp(4.4rem, 13vw, 9rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  max-width: 9ch;
}

.hero-role {
  margin: 22px 0 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-intro {
  max-width: 20ch;
  margin: 18px 0 0;
  font-size: clamp(1.28rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.hero-note,
.portrait-card,
.about-panel,
.detail-card,
.gallery-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-note {
  padding: 24px;
  border-radius: var(--radius-lg);
  display: grid;
  gap: 20px;
}

.summary-item {
  display: grid;
  gap: 8px;
}

.summary-item p,
.about-panel p,
.footer-email {
  margin: 0;
}

.summary-item p {
  color: var(--ink);
  line-height: 1.6;
  overflow-wrap: break-word;
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: 72px;
  width: fit-content;
  color: var(--muted);
  font-size: 0.92rem;
}

.scroll-line {
  width: 1px;
  height: 52px;
  background: linear-gradient(to bottom, rgba(17, 17, 17, 0), rgba(17, 17, 17, 0.22));
  position: relative;
}

.scroll-line::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
  animation: cue-float 1.8s ease-in-out infinite;
}

.section,
.site-footer {
  margin-top: 112px;
}

.section-heading {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.section-heading p:last-child {
  max-width: 62ch;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.project-item:nth-child(2),
.project-item:nth-child(4) {
  margin-top: 52px;
}

.project-card {
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  overflow: hidden;
  text-align: left;
  color: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition:
    transform 280ms ease,
    box-shadow 280ms ease,
    border-color 280ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 28px 70px rgba(17, 17, 17, 0.12);
  border-color: rgba(123, 107, 90, 0.22);
}

.project-card:focus-visible,
.site-nav a:focus-visible {
  outline: 2px solid rgba(123, 107, 90, 0.45);
  outline-offset: 3px;
}

.project-media {
  position: relative;
  aspect-ratio: 3200 / 1131;
  overflow: hidden;
  background: #d7d1c9;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: opacity 250ms ease;
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  padding: 22px;
  background:
    linear-gradient(to top, rgba(17, 17, 17, 0.52), rgba(17, 17, 17, 0.18) 45%, rgba(17, 17, 17, 0));
  opacity: 0;
  transition: opacity 250ms ease;
}

.project-overlay span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.project-card:hover .project-overlay,
.project-card:focus-visible .project-overlay {
  opacity: 1;
}

.project-copy {
  display: grid;
  gap: 14px;
  padding: 22px 22px 24px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.project-copy h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.project-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: break-word;
}

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

.tag-list li {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(123, 107, 90, 0.16);
  font-size: 0.84rem;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.portrait-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.portrait-frame {
  min-height: 420px;
  border-radius: calc(var(--radius-lg) - 6px);
  background:
    linear-gradient(145deg, rgba(123, 107, 90, 0.18), rgba(255, 255, 255, 0.2)),
    linear-gradient(to bottom, #ebe4da, #ddd6cb);
  display: grid;
  place-items: end start;
  padding: 24px;
  overflow: hidden;
}

.portrait-frame span {
  font-size: clamp(3.4rem, 8vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.1em;
}

.portrait-caption {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.about-copy {
  display: grid;
  gap: 18px;
}

.about-lead {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.about-copy > p {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.8;
  overflow-wrap: break-word;
}

.about-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.about-panel {
  padding: 20px;
  border-radius: var(--radius-md);
}

.about-panel p {
  color: var(--muted);
  line-height: 1.7;
  margin-top: 8px;
  overflow-wrap: break-word;
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-block {
  display: grid;
  gap: 12px;
}

.footer-email {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.has-js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 650ms ease,
    transform 650ms ease;
}

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

.case-body {
  background:
    radial-gradient(circle at 12% 0%, rgba(123, 107, 90, 0.1), transparent 34vw),
    var(--bg);
}

.case-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 0 20px 56px;
}

.read-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 3px;
  background: rgba(17, 17, 17, 0.06);
}

.read-progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--ink);
}

.case-main {
  padding-top: clamp(44px, 9vw, 112px);
}

.case-hero {
  display: grid;
  grid-template-columns: 0.28fr minmax(0, 1fr) minmax(260px, 0.36fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  margin-bottom: clamp(42px, 8vw, 92px);
}

.back-link {
  align-self: start;
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 220ms ease;
}

.back-link::before {
  content: "< ";
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--ink);
}

.case-hero-copy h1 {
  max-width: 10ch;
  margin: 8px 0 0;
  font-size: clamp(3.2rem, 8vw, 7.4rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

.case-hero-copy p:last-child {
  max-width: 54ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.75;
}

.case-meta-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.case-meta-panel p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.case-reader {
  display: grid;
  gap: clamp(18px, 3.4vw, 46px);
}

.case-page {
  margin: 0;
}

.case-page-frame {
  position: relative;
  aspect-ratio: 2400 / 849;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: clamp(16px, 2vw, 28px);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08)),
    var(--accent-soft);
  box-shadow: 0 22px 70px rgba(17, 17, 17, 0.12);
}

.case-page-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: translateX(-100%);
  animation: page-loading 1.4s ease-in-out infinite;
}

.case-page.is-loaded .case-page-frame::before {
  display: none;
}

.case-page img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 380ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.case-page.is-loaded img {
  opacity: 1;
}

.case-page figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(44px, 8vw, 92px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.case-bottom-nav a {
  color: var(--muted);
  transition: color 220ms ease;
}

.case-bottom-nav a:hover,
.case-bottom-nav a:focus-visible {
  color: var(--ink);
}

@keyframes cue-float {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(45deg);
  }
  50% {
    transform: translate(-50%, 5px) rotate(45deg);
  }
}

@keyframes page-loading {
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .section-heading,
  .about-grid,
  .case-hero {
    grid-template-columns: 1fr;
  }

  .projects-grid,
  .about-panels {
    grid-template-columns: 1fr;
  }

  .project-item:nth-child(2),
  .project-item:nth-child(4) {
    margin-top: 0;
  }

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

  .hero-name {
    max-width: none;
  }

  .hero-intro,
  .section-heading h2,
  .about-lead {
    max-width: none;
  }

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

  .case-main {
    padding-top: 72px;
  }

  .case-hero-copy h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 0 16px 36px;
  }

  .case-shell {
    padding: 0 12px 40px;
  }

  .site-header {
    padding-top: 16px;
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .site-nav {
    gap: 12px;
  }

  .brand,
  .site-nav a {
    font-size: 0.88rem;
  }

  .section,
  .site-footer {
    margin-top: 84px;
  }

  .project-card,
  .hero-note,
  .portrait-card {
    border-radius: 24px;
  }

  .hero-name {
    font-size: clamp(3.6rem, 17vw, 4.9rem);
  }

  .hero-intro {
    font-size: 1rem;
    max-width: 18ch;
  }

  .project-copy,
  .portrait-card,
  .about-panel,
  .case-meta-panel {
    padding: 18px;
  }

  .case-page-frame {
    border-radius: 14px;
  }

  .case-bottom-nav {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
