:root {
  --bg: #fff;
  --fg: #121212;
  --nav: #1f1f1f;
  --body: #666;
  --muted: #999;
  --line: #ddd;
  --field: #fafafa;
  --pink: #e1306c;
  --side: 260px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 14px/1.7 "Figtree", "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.02em;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1560px; margin: 0 auto; min-height: 100vh; }

.side {
  position: sticky; top: 0; align-self: start; height: 100vh;
  padding: 60px 20px 40px 53px;
}
.logo { display: block; width: 144px; margin: 0 0 40px -6px; }
.logo img { width: 100%; }

nav ul { list-style: none; margin: 0; padding: 0; }
nav li { margin: 0 0 8px; }
nav a {
  font-size: 16px; line-height: 24px; color: var(--nav); text-decoration: none; letter-spacing: 0;
}
nav a:hover, nav a:focus-visible, nav a.active { color: var(--muted); }
nav li.small { margin-top: 24px; }
nav li.small a { font-size: 13px; }

.social { margin-top: 24px; display: flex; gap: 12px; }
.social a { color: var(--pink); display: inline-flex; }
.social svg { width: 22px; height: 22px; }

.content { container-type: inline-size; padding: 40px clamp(16px, 3vw, 40px) 40px 30px; width: 100%; max-width: 1240px; margin: 0 auto; }

section { scroll-margin-top: 40px; }
section + section { margin-top: 90px; }
section h2 {
  margin: 0 0 28px; text-align: center;
  font-size: 26px; line-height: 1.2; font-weight: 700; color: var(--fg); letter-spacing: 0;
}

.gallery { --cols: 2; --gap: 10px; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: var(--gap); }
@container (min-width: 860px) { .gallery { --cols: 3; } }
@container (min-width: 1150px) { .gallery { --cols: 4; } }
.gallery button { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); padding: 0; border: 0; background: #eee; cursor: zoom-in; display: block; }
.gallery img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; }
.gallery button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

dialog {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
}
dialog::backdrop { background: rgba(255, 255, 255, 0.96); }
dialog .stage { width: 100%; height: 100%; display: grid; place-items: center; padding: 16px; }
dialog img { max-height: calc(100vh - 32px); width: auto; max-width: 100%; }
dialog .ctl {
  position: fixed; background: #fff; color: var(--fg);
  border: 1px solid var(--line); border-radius: 999px;
  width: 44px; height: 44px; font-size: 1.3rem; cursor: pointer;
}
dialog .close { top: 16px; right: 16px; }
dialog .prev { left: 16px; top: 50%; transform: translateY(-50%); }
dialog .next { right: 16px; top: 50%; transform: translateY(-50%); }

.video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.btn {
  display: inline-block; padding: 11px 22px;
  border: 1px solid var(--fg); color: var(--fg); background: transparent;
  text-decoration: none; font: inherit; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: var(--fg); color: #fff; }

.resume-head { text-align: center; margin-bottom: 40px; }

.credit-group { margin-bottom: 36px; max-width: 860px; margin-left: auto; margin-right: auto; }
.credit-group h3 {
  margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  font-size: 13px; line-height: 1.2; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg);
}
.credit-group table { width: 100%; border-collapse: collapse; }
.credit-group td { padding: 5px 12px 5px 0; vertical-align: top; font-size: 14px; }
.credit-group td:first-child { width: 40%; color: var(--fg); }
.credit-group td:nth-child(2) { width: 25%; }
.credit-group td:last-child { color: var(--muted); padding-right: 0; }
.resume-meta p { margin: 0 0 8px; }
.resume-meta strong { color: var(--fg); font-weight: 700; margin-right: 8px; }

.contact { text-align: center; }
.contact h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; font-weight: 400; color: var(--fg); letter-spacing: 0; }
.contact p { margin: 0 0 4px; }
.contact .rule { margin: 20px 0; color: var(--muted); }

form { max-width: 580px; margin: 28px auto 0; display: grid; gap: 18px; text-align: left; }
form .row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--fg); }
label small { color: var(--muted); font-size: 12px; }
input, textarea {
  font: inherit; color: var(--fg); background: var(--field);
  border: 1px solid #999; padding: 10px; border-radius: 0; width: 100%; letter-spacing: 0;
}
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }
form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-msg { margin: 0; font-size: 14px; }
.form-msg[hidden] { display: none; }
.form-msg.ok { color: #2b6a3b; }
.form-msg.err { color: #a12d2d; }

footer { margin-top: 90px; padding: 20px 0; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .layout { display: block; }
  .side { position: static; height: auto; padding: 24px var(--gutter) 8px; text-align: center; }
  .logo { width: 120px; margin: 0 auto 20px; }
  nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
  nav li, nav li.small { margin: 0; }
  .social { justify-content: center; margin-top: 12px; }
  .content { padding: 24px var(--gutter) 24px; }
  section + section { margin-top: 64px; }
}

@media (max-width: 600px) {
  .gallery { --gap: 6px; }
  .credit-group td { display: block; width: auto !important; padding: 0; }
  .credit-group tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  form .row { grid-template-columns: 1fr; }
}

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