:root {
  --paper: #faf7f8;
  --ink: #211b1e;
  --muted: #756b70;
  --line: #dfd6da;
  --accent: #d20a62;
  --accent-dark: #8c174b;
  --soft-accent: #f7e6ee;
  --white: #fff;
  --page: min(1380px, calc(100% - 48px));
  --font-small: .875rem;
  --font-body: 1rem;
  --font-lead: 1.25rem;
  --font-title: clamp(2.5rem, 4vw, 4rem);
  --font-display: clamp(4.5rem, 10vw, 10rem);
}

* { box-sizing: border-box; }
::selection { color: var(--white); background: var(--accent); }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url('assets/background-pattern.svg');
  background-position: top center;
  background-repeat: repeat-y;
  background-size: 1440px 1080px;
  font-family: Arial, sans-serif;
  font-size: var(--font-body);
  line-height: 1.45;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background-color .25s ease, box-shadow .25s ease;
}

.site-header.is-scrolled { background: rgb(250 247 248 / .94); box-shadow: 0 8px 30px rgb(58 28 42 / .06); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; width: var(--page); min-height: 72px; margin: 0 auto; }
.brand { font-family: Georgia, serif; font-size: 1.25rem; font-style: italic; font-weight: 400; text-decoration: none; }
.brand span { color: var(--accent); }
.toc { display: flex; align-items: center; gap: 26px; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc a { position: relative; flex: 0 0 auto; padding: 25px 0 23px; color: var(--muted); font-size: var(--font-small); text-decoration: none; white-space: nowrap; }
.toc a::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--accent); content: ''; transform: scaleX(0); transform-origin: left; transition: transform .2s ease; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--ink); }
.toc a:hover::after, .toc a[aria-current="true"]::after { transform: scaleX(1); }

section[id], footer[id] { scroll-margin-top: 96px; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 7vw;
  align-items: center;
  width: var(--page);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 64px 0;
}

.hero__copy { transform: translateY(-28px); }
.hero::after { position: absolute; z-index: -1; bottom: 13%; left: 42%; width: 14px; height: 14px; border: 1px solid var(--accent); content: ''; transform: rotate(45deg); }

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: var(--font-small);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, serif; }
h1 { margin-bottom: 28px; font-size: var(--font-display); font-weight: 400; letter-spacing: -.06em; line-height: .84; }
h2 { margin-bottom: 0; font-size: var(--font-title); font-weight: 400; letter-spacing: -.045em; line-height: 1; }
h3 { margin-bottom: 0; font-size: 2rem; font-weight: 400; letter-spacing: -.025em; line-height: 1.05; }

.hero__lead { max-width: 700px; margin-bottom: 28px; font-size: var(--font-lead); line-height: 1.4; }
.hero__portrait { margin: 0; }
.hero__portrait { position: relative; }
.hero__portrait::before { position: absolute; z-index: -1; inset: -18px 18px 18px -18px; border-radius: 50% 50% 8px 8px; background: var(--soft-accent); content: ''; }
.hero__portrait img { width: 100%; height: min(72vh, 720px); border-radius: 50% 50% 4px 4px; object-fit: cover; object-position: center; }

.skills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; padding: 0; list-style: none; }
.skills li { padding: 8px 12px; border: 1px solid rgb(210 10 98 / .28); border-radius: 999px; color: var(--accent-dark); background: var(--soft-accent); font-size: var(--font-small); }
.text-link { font-weight: 700; text-underline-offset: 5px; }

.section { position: relative; width: var(--page); margin: 0 auto; padding: 104px 0; border-top: 1px solid var(--line); }
.section-heading { position: relative; display: block; max-width: 980px; margin-bottom: 56px; padding-top: 24px; }
.section-heading::before { position: absolute; top: 0; left: 0; width: 52px; height: 3px; background: var(--accent); content: ''; }
.section-heading::after { position: absolute; top: -5px; left: 60px; width: 12px; height: 12px; border: 1px solid var(--accent); border-radius: 50%; content: ''; opacity: .5; }
.section-number { margin: 0 0 44px; color: var(--accent); font-size: var(--font-small); }
.section-intro { max-width: 660px; margin: 24px 0 0; color: var(--muted); font-size: var(--font-body); }

.featured-grid { display: flex; flex-direction: column; gap: 72px; }
.featured-grid .work-card { width: 100%; }
.featured-grid .work-card__media { aspect-ratio: 16 / 10; padding: clamp(18px, 4vw, 64px); background: var(--soft-accent); }
.featured-grid .work-card:nth-child(2) .work-card__media { background: #f0eaed; }
.featured-grid .work-card:nth-child(3) .work-card__media { background: #f8edf2; }
.featured-grid .work-card__meta::before { width: 6px; height: 6px; flex: 0 0 auto; align-self: center; border-radius: 50%; background: var(--accent); content: ''; }

.work-card { min-width: 0; }
.work-card__button { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; text-align: left; }
.work-card__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #ece8e2; }
.work-card__media--portrait { aspect-ratio: 3 / 4; }
.work-card__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s ease; }
.work-card__button:hover img { transform: scale(1.02); }
.work-card__meta { display: flex; justify-content: space-between; gap: 20px; margin: 14px 0 0; color: var(--muted); font-size: var(--font-small); font-style: italic; font-weight: 400; opacity: .8; }
.work-card__type { color: var(--muted); text-align: right; }

.roll-block { width: 100%; margin-bottom: 96px; }
.subsection-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.rail-controls { display: flex; align-items: center; gap: 12px; }
.scroll-hint { margin-right: 8px; color: var(--muted); font-size: var(--font-small); letter-spacing: .06em; text-transform: uppercase; }
.icon-button { width: 48px; height: 48px; border: 1px solid var(--ink); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--accent); color: var(--white); background: var(--accent); }
.icon-button--small { width: 44px; height: 44px; }
.roll-rail { width: 100%; overflow-x: auto; outline: none; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-color: var(--accent) var(--line); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.roll-rail:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.roll-rail__inner { display: flex; gap: 24px; width: max-content; margin-inline: auto; padding: 2px 0 30px; }
.roll-card { width: clamp(280px, 28vw, 390px); scroll-snap-align: start; }
.roll-card button { width: 100%; padding: 12px; border: 0; background: var(--soft-accent); cursor: zoom-in; }
.roll-card img { width: 100%; height: min(68vh, 650px); object-fit: contain; }
.roll-card p { display: flex; justify-content: space-between; margin: 14px 0 0; color: var(--muted); font-size: var(--font-small); font-style: italic; font-weight: 400; opacity: .8; }
.roll-card p span { color: var(--muted); }

.visit-case { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: clamp(40px, 8vw, 130px); margin-bottom: 96px; padding: 76px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.visit-case__intro { position: sticky; top: 120px; align-self: start; }
.visit-case__intro > p:not(.eyebrow) { max-width: 390px; margin-top: 30px; color: var(--muted); font-size: var(--font-body); }
.visit-case__stack { display: flex; flex-direction: column; gap: 20px; }
.visit-card { margin: 0; padding: 20px; background: var(--white); box-shadow: 0 18px 60px rgb(25 45 80 / .08); }
.visit-card button { width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.visit-card img { width: 100%; height: auto; }
.visit-card figcaption { margin-top: 14px; color: var(--muted); font-size: var(--font-small); font-style: italic; font-weight: 400; opacity: .8; text-align: right; }

.work-group + .work-group { margin-top: 72px; }
.work-group__heading { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.work-group__heading h3 { font-size: 2rem; }
.work-group__heading p { margin: 0; color: var(--muted); font-size: var(--font-small); }
.gallery-controls { display: flex; align-items: center; gap: 9px; }
.gallery-controls p { margin-right: 8px; white-space: nowrap; }
.works-grid { display: flex; gap: 24px; width: calc(100vw - max(24px, (100vw - min(1380px, calc(100vw - 48px))) / 2)); padding: 0 0 26px; overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-color: var(--accent) var(--line); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.works-grid:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.works-grid .work-card { flex: 0 0 clamp(300px, 34vw, 460px); scroll-snap-align: start; }
.works-grid .work-card__media { aspect-ratio: 4 / 3; padding: 18px; }

.experience-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 7vw; }
.experience-lead { font-size: 2rem; line-height: 1.2; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--muted); }

footer { width: var(--page); margin: 0 auto; padding: 80px 0 40px; border-top: 1px solid var(--line); }
footer::before { display: block; width: 72px; height: 8px; margin-bottom: 40px; background: var(--accent); content: ''; }
.footer-contacts { display: flex; align-items: flex-start; flex-direction: column; gap: 20px; }
.footer-email { display: inline-block; max-width: 100%; color: var(--accent-dark); font-family: Georgia, serif; font-size: 2rem; letter-spacing: -.025em; line-height: 1.1; overflow-wrap: anywhere; text-underline-offset: 7px; }
.footer-phone { color: var(--accent-dark); font-size: var(--font-lead); text-decoration-thickness: 1px; text-underline-offset: 7px; }
.footer-note { margin: 48px 0 0; color: var(--muted); }

.lightbox { width: min(94vw, 1400px); max-width: none; height: 92vh; padding: 56px 24px 24px; border: 0; color: var(--white); background: #111; }
.lightbox::backdrop { background: rgb(0 0 0 / .8); }
.lightbox img { width: 100%; height: calc(100% - 40px); object-fit: contain; }
.lightbox p { margin: 12px 0 0; text-align: center; }
.lightbox__close { position: absolute; top: 8px; right: 12px; width: 44px; height: 44px; padding: 0; border: 0; color: var(--white); background: transparent; font-size: 2rem; cursor: pointer; }

@media (max-width: 800px) {
  :root { --page: calc(100% - 32px); }
  .site-header__inner { gap: 22px; min-height: 60px; }
  .toc { gap: 20px; }
  .toc a { padding: 20px 0 18px; }
  .hero { grid-template-columns: 1fr; gap: 44px; min-height: auto; padding: 70px 0; }
  .hero__copy { order: 2; transform: none; }
  .hero__portrait { order: 1; }
  .hero__portrait img { height: 58vh; }
  .hero::after { display: none; }
  h1 { font-size: clamp(3.75rem, 18vw, 5.5rem); }
  .section { padding: 68px 0; }
  .section-heading { margin-bottom: 40px; }
  .section-number { margin-bottom: 28px; }
  .featured-grid { gap: 48px; }
  .featured-grid .work-card:nth-child(n) { margin-top: 0; padding-top: 0; }
  .featured-grid .work-card:nth-child(n) .work-card__media { aspect-ratio: 4 / 3; padding: 12px; }
  .works-grid { width: calc(100vw - 16px); }
  .works-grid .work-card { flex-basis: min(82vw, 370px); }
  .work-group__heading { align-items: flex-start; flex-direction: column; }
  .subsection-heading { align-items: start; flex-direction: column; }
  .rail-controls { width: 100%; }
  .scroll-hint { margin-right: auto; }
  .roll-rail { width: calc(100vw - 16px); }
  .roll-card { width: min(76vw, 330px); }
  .roll-card img { height: 60vh; }
  .visit-case { grid-template-columns: 1fr; gap: 38px; margin-bottom: 64px; padding: 56px 0; }
  .visit-case__intro { position: static; }
  .experience-grid { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
