:root {
  --bg: #f6f6f2;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #dcdcd7;
  --accent: #b7ff3c;
  --accent-ink: #111111;
  --surface: #ffffff;
  --header-bg: rgba(246, 246, 242, 0.9);
  --overlay: rgba(17, 17, 17, 0.35);
  --on-ink-muted: rgba(246, 246, 242, 0.65);
  --preview-soft: #fafaf7;
  --preview-mid: #f0f0ea;
  --display: Syne, "Segoe UI", sans-serif;
  --sans: "Space Grotesk", "Segoe UI", sans-serif;
  --header-h: 72px;
  --max: 1180px;
  --pad: clamp(20px, 4vw, 40px);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #141412;
  --ink: #f2f2ee;
  --muted: #9a9a92;
  --line: #2c2c28;
  --accent: #b7ff3c;
  --accent-ink: #111111;
  --surface: #1c1c18;
  --header-bg: rgba(20, 20, 18, 0.92);
  --overlay: rgba(0, 0, 0, 0.55);
  --on-ink-muted: rgba(20, 20, 18, 0.6);
  --preview-soft: #1a1a16;
  --preview-mid: #181814;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 0;
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

body:has(.header) {
  padding-top: var(--header-h);
}

body:has(.case-top) {
  padding-top: 64px;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
}
.skip:focus { top: 12px; }

/* ——— Header ——— */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  width: min(100% - (var(--pad) * 2), var(--max));
  margin-left: auto;
  margin-right: auto;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 16px;
  box-sizing: border-box;
}

.header-inner .logo {
  justify-self: start;
}

.header-inner .nav {
  justify-self: center;
}

.header-inner .header-tools {
  justify-self: end;
}

.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  z-index: 110;
}
.logo span { color: var(--muted); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  position: relative;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 8px 10px;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
}

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

.burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: column;
  z-index: 110;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 90;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 110;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--ink);
}

.theme-toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid var(--ink);
  background: var(--bg);
  flex-shrink: 0;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--ink);
  transition: transform 0.22s ease, background 0.22s ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(16px);
  background: var(--accent);
}

html[data-theme="dark"] .theme-toggle-track {
  background: var(--ink);
  border-color: var(--accent);
}

.theme-toggle-text {
  min-width: 2.8em;
}

/* ——— Shared ——— */
.section,
.hero,
.contact-inner,
.footer,
.case-page,
.case-top-inner {
  width: min(100% - (var(--pad) * 2), var(--max));
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.section { padding-block: clamp(72px, 12vw, 120px); }

.section-index {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.section-head {
  display: grid;
  gap: 8px;
  margin-bottom: clamp(36px, 6vw, 56px);
  max-width: 16ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn span { transition: transform 0.2s ease; }
.btn:hover span { transform: translateX(4px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: #a8f028;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn-lg {
  min-height: 56px;
  padding: 0 28px;
  font-size: 14px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border: 0;
  background: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.text-link span { transition: transform 0.2s ease; }
.text-link:hover { color: #4a7a00; }
.text-link:hover span { transform: translateX(5px); }

/* ——— Hero ——— */
.hero {
  padding-block: clamp(28px, 5vw, 48px) clamp(64px, 10vw, 96px);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  align-items: end;
}

.hero-left,
.hero-right {
  min-width: 0;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 28px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.eyebrow,
.role-tag {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.eyebrow {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 8px;
}

.role-tag {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--muted);
  margin-bottom: clamp(28px, 5vw, 48px);
}

.hero-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 8.5vw, 96px);
  line-height: 0.88;
  letter-spacing: -0.05em;
}

.hero-title span {
  display: block;
  white-space: nowrap;
}

.hero-title .accent-line {
  display: inline-block;
  background: linear-gradient(180deg, transparent 62%, var(--accent) 62%);
}

.hero-lead {
  margin: 24px 0 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 18px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.tech-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 36px 0 0;
  padding: 0;
}

.tech-chips li {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.portrait {
  margin: 0;
  position: relative;
  border: 1px solid var(--line);
  background: var(--surface);
}

.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 28%;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.4s ease;
}

.portrait:hover img { filter: grayscale(0.2) contrast(1.05); }

.portrait figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.about-block {
  margin-top: clamp(56px, 10vw, 96px);
  display: grid;
  gap: 24px;
}

.about-block-page {
  margin-top: clamp(28px, 5vw, 40px);
}

.page-section {
  padding-top: clamp(28px, 5vw, 48px);
}

.about-rule {
  height: 1px;
  background: var(--line);
}

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

.about-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.about-copy p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 17px;
}

/* ——— Services ——— */
.services {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.service {
  display: grid;
  gap: 10px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.3s ease, background 0.3s ease;
  position: relative;
}

.service::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}

.service:hover {
  padding-left: 18px;
  background: rgba(183, 255, 60, 0.08);
}

.service:hover::before { transform: scaleY(1); }
.service:hover h3 { transform: translateX(4px); }

.service-num {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.service h2,
.service h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  transition: transform 0.3s ease;
}

.service-desc {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
}

.service-price {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
}

/* ——— Calculator ——— */
.calc-section {
  border-block: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 0, transparent calc(50% - 0.5px), var(--line) calc(50% - 0.5px), var(--line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    var(--bg);
}

.calc {
  display: grid;
  gap: 28px;
  max-width: 720px;
}

.calc-group {
  margin: 0;
  padding: 0 0 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.calc-group legend {
  padding: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.choice:hover { border-color: var(--ink); }

.choice:has(input:checked) {
  border-color: var(--ink);
  background: rgba(183, 255, 60, 0.18);
}

.choice input {
  margin-top: 3px;
  accent-color: #6db800;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.choice span {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  width: 100%;
  font-weight: 600;
}

.choice em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
}

.calc-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.calc-total-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
}

.calc-total-value {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(36px, 7vw, 56px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.calc-total-value span {
  background: linear-gradient(180deg, transparent 70%, rgba(183, 255, 60, 0.85) 70%);
}

/* ——— Projects ——— */
.projects {
  display: grid;
  gap: 48px;
}

.project {
  display: grid;
  gap: 20px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.project:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.project-preview {
  position: relative;
  min-height: 240px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease;
}

.project:hover .project-preview {
  transform: translateY(-4px);
  border-color: var(--ink);
}

.project-body {
  display: grid;
  gap: 8px;
  align-content: start;
}

.project-num {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.project-cat {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.project h2,
.project h3 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.project-body > p { margin: 0; color: var(--muted); }

.project-tech {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.project-tech span { color: var(--ink); }

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 8px;
}

.project-actions .text-link { padding-top: 10px; }

.text-link-accent {
  background: linear-gradient(180deg, transparent 65%, var(--accent) 65%);
}

.project-preview-photo {
  aspect-ratio: 4 / 3;
  min-height: 0;
  padding: 0;
  background: var(--preview-soft);
  display: grid;
  place-items: center;
}

.project-preview-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Project placeholders */
.preview-ttt {
  display: grid;
  place-items: center;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 33.33%,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 33.33% 100%,
    var(--preview-soft);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 48px);
  gap: 0;
}

.preview-grid span {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  border: 1px solid var(--line);
}

.preview-grid span:nth-child(1),
.preview-grid span:nth-child(5),
.preview-grid span:nth-child(9) {
  background: var(--accent);
}

.preview-bot {
  display: grid;
  place-items: end start;
  padding: 28px;
  background: #111;
}

.chat {
  width: min(70%, 240px);
  display: grid;
  gap: 10px;
}

.chat i {
  display: block;
  height: 36px;
  border-radius: 16px 16px 16px 4px;
  background: #2a2a2a;
}

.chat i.short { width: 62%; }
.chat i.reply {
  justify-self: end;
  width: 70%;
  border-radius: 16px 16px 4px 16px;
  background: var(--accent);
}

.preview-mini {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 80% 20%, rgba(183, 255, 60, 0.35), transparent 35%),
    #efefe9;
}

.phone {
  width: 42%;
  min-width: 140px;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--ink);
  background: var(--surface);
  padding: 22px 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.phone b {
  font-family: var(--display);
  font-size: 14px;
}

.phone i {
  display: block;
  height: 8px;
  background: var(--line);
}

.phone i.short { width: 55%; }

.preview-linker {
  display: grid;
  place-items: center;
  background: var(--preview-mid);
}

.nodes {
  position: relative;
  width: 70%;
  max-width: 280px;
  height: 140px;
}

.nodes::before {
  content: "";
  position: absolute;
  inset: 40% 8%;
  border-top: 2px solid var(--ink);
}

.nodes span {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  background: var(--accent);
  border-radius: 50%;
  top: calc(40% - 14px);
}

.nodes span:nth-child(1) { left: 0; }
.nodes span:nth-child(2) { left: calc(50% - 14px); top: 18%; background: var(--surface); }
.nodes span:nth-child(3) { right: 0; }

/* ——— Contact ——— */
.contact {
  padding-block: clamp(80px, 14vw, 140px);
  border-top: 1px solid var(--line);
}

.contact-inner { display: grid; gap: 28px; }

.contact-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 10vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  max-width: 12ch;
}

.contact-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 420px;
  border-top: 1px solid var(--line);
}

.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.contact-list span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-list a {
  font-weight: 700;
  text-underline-offset: 3px;
}

.contact-list a:hover { background: linear-gradient(180deg, transparent 65%, var(--accent) 65%); }

/* ——— Footer ——— */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 22px 36px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.footer a:hover { background: linear-gradient(180deg, transparent 65%, var(--accent) 65%); }

/* ——— Reveal ——— */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--d, 0s);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.btn:focus-visible,
.text-link:focus-visible,
.nav a:focus-visible,
.burger:focus-visible,
.theme-toggle:focus-visible,
.choice:focus-within,
.logo:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ——— Responsive ——— */
@media (min-width: 760px) {
  .services {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--line);
  }

  .service {
    padding: 32px;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .service:nth-child(2n) { border-right: 0; }
  .service:nth-child(n + 3) { border-bottom: 0; }

  .about-copy {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: end;
    gap: 48px;
  }

  .project {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 40px;
  }

  .project:nth-child(even) .project-preview { order: 2; }
  .project-preview { min-height: 320px; }
  .project-preview-photo { min-height: 0; }
}

@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    min-height: calc(100vh - var(--header-h) - 120px);
  }

  .portrait {
    max-width: 420px;
    width: 100%;
    margin-left: auto;
  }

  .calc {
    grid-template-columns: 1fr 1fr;
    max-width: none;
    column-gap: 48px;
  }

  .calc-group:first-child { grid-column: 1; }
  .calc-group:nth-child(2) { grid-column: 2; grid-row: 1; }
  .calc-group:nth-child(3) { grid-column: 1 / -1; }
  .calc-total { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .burger { display: flex; }

  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .header-inner .logo,
  .header-inner .header-tools {
    justify-self: auto;
  }

  .logo {
    font-size: 13px;
    letter-spacing: 0.02em;
  }

  .theme-toggle-text { display: none; }

  .theme-toggle {
    min-height: 40px;
    padding: 6px 8px;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(86vw, 340px);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    padding: 88px 28px 40px;
    background: var(--bg);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform 0.35s ease, visibility 0.35s ease;
    z-index: 105;
    overflow-x: hidden;
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
  }

  .nav.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav a {
    font-family: var(--display);
    font-size: clamp(24px, 7vw, 28px);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    padding: 12px 0;
  }

  .nav a::after {
    left: 0;
    right: auto;
    width: 28px;
    bottom: 8px;
  }

  .case-top-inner {
    gap: 10px;
    min-height: 56px;
  }

  .case-top-tools > a {
    display: none;
  }

  .case-top a {
    font-size: 11px;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 64px;
    --pad: 16px;
  }

  .nav {
    width: 100%;
    border-left: 0;
    padding: 80px 24px 32px;
  }

  .hero {
    padding-block: 20px 48px;
  }

  .hero-title {
    font-size: clamp(36px, 12vw, 52px);
  }

  .hero-lead br { display: none; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    margin-top: 24px;
  }

  .btn,
  .btn-lg {
    width: 100%;
    justify-content: center;
  }

  .portrait {
    max-width: 280px;
    margin-inline: auto;
  }

  .section {
    padding-block: 56px;
  }

  .page-section {
    padding-top: 20px;
  }

  .section-head {
    margin-bottom: 28px;
    max-width: none;
  }

  .section-title {
    font-size: clamp(34px, 11vw, 48px);
  }

  .contact-title {
    font-size: clamp(36px, 11vw, 52px);
  }

  .service {
    padding: 22px 0;
  }

  .calc-section {
    padding-bottom: 56px;
  }

  .calc-total {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .calc-total-value {
    font-size: clamp(32px, 12vw, 44px);
  }

  .choice {
    padding: 12px 14px;
  }

  .choice span {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .projects {
    gap: 32px;
  }

  .project {
    gap: 14px;
    padding-bottom: 32px;
  }

  .case-visual,
  .project-preview,
  .project-preview-photo,
  .case-visual .project-preview,
  .case-visual .project-preview-photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .case-visual:has(.project-preview-photo) {
    aspect-ratio: auto;
  }

  .project-preview-photo img {
    object-fit: contain;
  }

  .project-cat {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .project h2,
  .project h3 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .project-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .project-actions .text-link {
    padding-top: 6px;
  }

  .contact {
    padding-block: 56px;
  }

  .contact-list {
    gap: 16px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-block: 24px 36px;
  }

  .case-page {
    padding-block: 24px 56px;
  }

  .case-hero {
    gap: 20px;
    padding-bottom: 32px;
  }

  .case-title {
    font-size: clamp(34px, 11vw, 48px);
    max-width: none;
  }

  .case-lead {
    font-size: 16px;
  }

  .case-actions .btn {
    width: 100%;
  }

  .case-stage {
    gap: 16px;
    padding: 28px 0;
  }

  .case-stage-head h2,
  .case-stage-body h2 {
    font-size: clamp(24px, 7vw, 32px);
  }

  .case-nav-bottom {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 32px;
  }

  .case-nav-bottom a:last-child {
    text-align: left;
  }

  .result-box {
    padding: 20px;
  }

  .result-box strong {
    font-size: clamp(24px, 8vw, 36px);
  }

  .tech-board {
    gap: 8px;
  }
}

@media (max-width: 400px) {
  .logo {
    font-size: 12px;
  }

  .case-top a {
    max-width: 46vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (hover: none) {
  .project:hover .project-preview {
    transform: none;
  }

  .portrait:hover img {
    filter: grayscale(0.35) contrast(1.05);
  }
}

/* ——— Case study pages ——— */
.case-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.case-top-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.case-top a {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.case-top a:hover {
  background: linear-gradient(180deg, transparent 65%, var(--accent) 65%);
}

.case-top-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.case-page {
  padding-block: clamp(36px, 6vw, 72px) 80px;
}

.case-hero {
  display: grid;
  gap: 28px;
  padding-bottom: clamp(40px, 7vw, 72px);
  border-bottom: 1px solid var(--line);
}

.case-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.case-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(42px, 9vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  max-width: 12ch;
}

.case-title .mark {
  background: linear-gradient(180deg, transparent 62%, var(--accent) 62%);
}

.case-lead {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 18px;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.case-stage {
  display: grid;
  gap: clamp(28px, 5vw, 48px);
  padding: clamp(48px, 8vw, 88px) 0;
  border-bottom: 1px solid var(--line);
}

.case-stage:last-of-type { border-bottom: 0; }

.case-stage-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.case-stage-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.case-stage-body h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: -0.03em;
}

.case-stage p {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 17px;
}

.case-stage ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.case-stage li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.case-visual {
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 280px;
  overflow: hidden;
}

.case-visual:has(.project-preview-photo) {
  min-height: 0;
}

.case-visual .project-preview {
  min-height: 320px;
  border: 0;
}

.case-visual .project-preview-photo {
  min-height: 0;
  aspect-ratio: 4 / 3;
}

.project-preview-photo.project-preview-phone,
.case-visual .project-preview-photo.project-preview-phone {
  aspect-ratio: 704 / 1527;
  width: min(100%, 380px);
  min-height: 0;
  margin-inline: auto;
}

.project-preview-photo.project-preview-phone img {
  object-fit: cover;
  object-position: center;
}

.tech-board {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-board span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-box {
  display: grid;
  gap: 12px;
  padding: 28px;
  background: var(--ink);
  color: var(--bg);
}

.result-box strong {
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.result-box p {
  margin: 0;
  color: var(--on-ink-muted);
}

.case-nav-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.case-nav-bottom a {
  display: grid;
  gap: 6px;
  text-decoration: none;
  padding: 18px;
  border: 1px solid var(--line);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.case-nav-bottom a:hover {
  border-color: var(--ink);
  background: rgba(183, 255, 60, 0.15);
}

.case-nav-bottom a:last-child { text-align: right; }

.case-nav-bottom small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.case-nav-bottom strong {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.case-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 52ch;
}

@media (min-width: 900px) {
  .case-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: end;
  }

  .case-stage {
    grid-template-columns: 180px 1fr;
    align-items: start;
  }

  .case-stage-head { grid-column: 1; }
  .case-stage-body { grid-column: 2; display: grid; gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .burger span,
  .nav,
  .project-preview,
  .service,
  .btn,
  .text-link span {
    transition: none !important;
    animation: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}
