:root {
  --bg: #0b0d0d;
  --surface: #131717;
  --surface-2: #1b2222;
  --text: #f5f5f5;
  --muted: #b9bec0;
  --accent: #ff650f;
  --cool: #9bb9b4;
  --line: rgba(255, 255, 255, .14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 Manrope, sans-serif; }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.wrap { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 20; background: var(--accent); padding: 8px 12px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 80px; }
.brand img { width: 164px; height: auto; }
.header-inner nav { display: flex; gap: 34px; align-items: center; }
.header-inner nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
.header-inner nav a:hover, .header-inner nav a[aria-current] { color: var(--text); }
.header-inner nav a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 8px; }
.header-contact { font-size: 13px; font-weight: 800; border: 1px solid var(--accent); padding: 11px 17px; }
.header-contact:hover { background: var(--accent); }
.portfolio-intro { padding: 68px 0 40px; }
.intro-label, .project-kind { color: var(--accent); font-size: 12px; font-weight: 800; margin: 0 0 18px; }
.portfolio-intro h1, .case-hero h1 { font-size: clamp(38px, 4.5vw, 66px); line-height: 1.08; margin: 0 0 22px; max-width: 840px; letter-spacing: 0; overflow-wrap: anywhere; }
.portfolio-intro>div>p:last-child, .case-hero>div>p:not(.intro-label) { color: var(--muted); font-size: 17px; max-width: 680px; margin: 0; }
.portfolio-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.portfolio-toolbar p { margin: 0; font-weight: 700; }
.portfolio-toolbar p span { color: var(--cool); margin-left: 5px; }
.portfolio-toolbar p .count-label { color: var(--text); margin-left: 0; }
.filter-group { display: inline-flex; border: 1px solid var(--line); padding: 4px; gap: 4px; }
.filter-group button { border: 0; background: transparent; color: var(--muted); min-width: 83px; padding: 7px 13px; font-weight: 700; font-size: 13px; }
.filter-group button:hover { color: var(--text); }
.filter-group button.is-active { background: var(--surface-2); color: var(--text); }
.project-row { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: min(7vw, 80px); padding: 68px 0; border-bottom: 1px solid var(--line); }
.project-row.is-reversed { grid-template-columns: .85fr 1.15fr; }
.project-row.is-reversed .project-visual { order: 2; }
.project-visual { display: block; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.project-visual img { width: 100%; height: 360px; object-fit: contain; }
.project-visual:hover { border-color: var(--accent); }
.project-copy h2 { font-size: clamp(27px, 2.8vw, 38px); line-height: 1.2; margin: 0 0 18px; overflow-wrap: anywhere; }
.project-kind { margin-bottom: 18px; }
.project-kind span { color: var(--cool); padding: 0 8px; }
.project-summary { color: var(--muted); margin: 0 0 22px; }
.feature-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; }
.feature-list li { border: 1px solid var(--line); font-size: 12px; padding: 5px 10px; color: var(--cool); }
.project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; font-weight: 800; font-size: 13px; }
.project-actions a:first-child { background: var(--accent); padding: 11px 17px; }
.project-actions a:first-child:hover { background: #e55a0d; }
.project-actions a:not(:first-child) { color: var(--muted); }
.project-actions a:not(:first-child):hover { color: var(--text); }
.filter-empty { color: var(--muted); padding: 40px 0; }
.contact-band { border-top: 1px solid var(--line); padding: 72px 0 82px; background: var(--surface); }
.contact-band h2 { font-size: clamp(28px, 3.5vw, 48px); line-height: 1.15; margin: 0 0 16px; }
.contact-band p { color: var(--muted); margin: 0 0 28px; }
.contact-band a, .primary-link { display: inline-flex; align-items: center; gap: 12px; background: var(--accent); padding: 12px 18px; font-size: 14px; font-weight: 800; }
.contact-band a:hover, .primary-link:hover { background: #e55a0d; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-main { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; padding: 54px 0; }
.footer-main img { width: 160px; height: auto; }
.footer-main p { max-width: 270px; }
.footer-main nav { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; font-size: 14px; }
.footer-main nav h2 { font-size: 15px; color: var(--text); margin: 0 0 7px; }
.footer-main a:hover, .footer-bottom a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); font-size: 12px; }
.project-dialog { width: min(980px, calc(100% - 24px)); max-height: min(90vh, 980px); background: var(--surface); color: var(--text); border: 1px solid var(--line); padding: 0; overflow: auto; }
.project-dialog::backdrop { background: rgba(0, 0, 0, .83); }
.dialog-inner { padding: 35px; position: relative; }
.dialog-close { position: absolute; top: 15px; right: 20px; border: 0; background: transparent; color: var(--text); font-size: 36px; line-height: 1; width: 40px; height: 40px; }
.dialog-kind { color: var(--accent); font-size: 12px; font-weight: 800; margin: 0 48px 10px 0; }
.project-dialog h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.14; margin: 0 48px 12px 0; }
.dialog-summary { color: var(--muted); margin: 0 0 26px; }
.dialog-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; border-top: 1px solid var(--line); padding: 24px 0; }
.dialog-details h3 { color: var(--cool); font-size: 13px; margin: 0 0 8px; }
.dialog-details p { color: var(--muted); font-size: 13px; margin: 0; }
.dialog-gallery { display: grid; grid-template-columns: 42px 1fr 42px; gap: 12px; align-items: center; }
.dialog-gallery>button { width: 42px; height: 42px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 28px; }
.dialog-gallery>button:disabled { opacity: .35; cursor: default; }
.dialog-gallery figure { margin: 0; min-width: 0; }
.dialog-gallery img { width: 100%; height: min(44vh, 430px); object-fit: contain; background: var(--bg); }
.dialog-gallery figcaption { font-size: 12px; color: var(--muted); padding-top: 8px; }
.dialog-bottom { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding-top: 22px; font-size: 13px; }
.dialog-bottom span { color: var(--muted); }
.dialog-bottom a { color: var(--accent); font-weight: 800; }
.case-breadcrumb { display: flex; gap: 12px; padding: 22px 0; font-size: 13px; color: var(--muted); }
.case-breadcrumb a:hover { color: var(--accent); }
.case-hero { padding: 35px 0 70px; }
.case-hero-actions { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; margin: 28px 0 42px; font-weight: 800; font-size: 13px; }
.case-hero-actions a:not(.primary-link):hover { color: var(--accent); }
.case-cover { width: 100%; height: min(56vw, 510px); object-fit: contain; background: var(--surface); border: 1px solid var(--line); }
.case-story, .case-screens, .case-related { padding: 66px 0; border-top: 1px solid var(--line); }
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.story-grid h2 { color: var(--cool); font-size: 17px; margin: 0 0 12px; }
.story-grid p { color: var(--muted); margin: 0; }
.case-screens h2, .case-related h2 { font-size: clamp(27px, 3vw, 38px); margin: 0 0 28px; }
.screens-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
.screens-grid figure { margin: 0; border-top: 1px solid var(--line); padding-top: 22px; }
.screens-grid img { width: 100%; height: 300px; object-fit: contain; background: var(--surface); }
.screens-grid figcaption { display: grid; gap: 6px; margin-top: 14px; }
.screens-grid figcaption strong { font-size: 15px; }
.screens-grid figcaption span { font-size: 13px; color: var(--muted); }
.case-related>div>div { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.case-related>div>div a { border: 1px solid var(--line); padding: 10px 15px; font-weight: 700; }
.case-related>div>div a:hover { border-color: var(--accent); }
.all-projects { color: var(--accent); font-weight: 800; }
@media (max-width: 800px) {
  .wrap { width: min(100% - 32px, 620px); }
  .header-inner { min-height: 68px; gap: 12px; }
  .brand img { width: 124px; }
  .header-inner nav { gap: 14px; }
  .header-inner nav a { font-size: 12px; }
  .header-inner nav a:nth-child(n+3), .header-contact { display: none; }
  .portfolio-intro { padding: 48px 0 28px; }
  .portfolio-intro h1, .case-hero h1 { font-size: clamp(34px, 9vw, 48px); }
  .portfolio-intro>div>p:last-child { font-size: 15px; }
  .portfolio-toolbar { align-items: flex-start; flex-direction: column; }
  .filter-group { width: 100%; }
  .filter-group button { flex: 1; min-width: 0; }
  .project-row, .project-row.is-reversed { grid-template-columns: 1fr; gap: 24px; padding: 42px 0; }
  .project-row.is-reversed .project-visual { order: 0; }
  .project-visual img { height: 245px; }
  .project-copy h2 { margin-bottom: 10px; }
  .project-summary { margin-bottom: 16px; }
  .footer-main { grid-template-columns: repeat(2, 1fr); }
  .footer-main>div { grid-column: 1/-1; }
  .dialog-inner { padding: 24px 16px; }
  .dialog-details, .story-grid { grid-template-columns: 1fr; gap: 18px; }
  .dialog-gallery { grid-template-columns: 30px 1fr 30px; gap: 5px; }
  .dialog-gallery>button { width: 30px; height: 36px; }
  .dialog-gallery img { height: 260px; }
  .case-hero { padding: 25px 0 46px; }
  .case-cover { height: 280px; }
  .screens-grid { grid-template-columns: 1fr; }
  .screens-grid img { height: 240px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
