:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-2: #1c2026;
  --panel-3: #242a32;
  --line: #2c323a;
  --line-bright: #46505d;
  --text: #f4f6f8;
  --muted: #9da6b2;
  --accent: #f4f6f8;
  --green: #4ed68c;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -5%, rgba(65, 74, 90, .58) 0, transparent 31rem),
    radial-gradient(circle at 105% 30%, rgba(34, 42, 51, .38) 0, transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
body.dialog-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(244, 246, 248, .9);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(44, 50, 58, .82);
  background: rgba(13, 15, 18, .82);
  backdrop-filter: blur(18px) saturate(130%);
}
.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand span { display: grid; line-height: 1.15; }
.brand strong { font-size: .95rem; letter-spacing: .01em; }
.brand small { margin-top: .24rem; color: var(--muted); font-size: .72rem; }
.topbar-actions { display: flex; align-items: center; gap: .7rem; }
.nav-link { padding: .6rem .75rem; color: var(--muted); text-decoration: none; font-weight: 650; }
.nav-link:hover { color: var(--text); }

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: .7rem 1rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: #101216; background: var(--accent); }
.button-primary:hover { background: #dfe4e9; }
.button-secondary { color: var(--text); background: #303741; border-color: #444e5b; }
.button-secondary:hover { background: #3a424e; }
.button-ghost { color: var(--text); background: transparent; border-color: var(--line); }
.button-ghost:hover { border-color: var(--line-bright); background: rgba(255, 255, 255, .04); }

.page-shell {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2.8rem);
}
.hero {
  min-height: min(690px, calc(100vh - 110px));
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .7fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 7rem);
  padding: clamp(3rem, 8vw, 7rem) clamp(0rem, 2vw, 2rem);
}
.hero-copy { max-width: 820px; }
.eyebrow {
  margin-bottom: .55rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 14ch;
  margin-bottom: 1.4rem;
  font-size: clamp(3rem, 7.2vw, 7rem);
  font-weight: 780;
  letter-spacing: -.065em;
  line-height: .94;
}
.hero h1 span { color: #aeb7c4; }
.hero-intro {
  max-width: 660px;
  margin-bottom: 2rem;
  color: #bdc5cf;
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-stats { display: grid; gap: .8rem; }
.stat-card {
  display: grid;
  gap: .14rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(31, 36, 44, .9), rgba(18, 21, 26, .96));
  box-shadow: 0 15px 50px rgba(0, 0, 0, .14);
}
.stat-card strong { font-size: 1.35rem; letter-spacing: -.025em; }
.stat-card span { color: var(--muted); font-size: .82rem; }
.projects-section { scroll-margin-top: 95px; padding: clamp(3rem, 7vw, 6rem) 0; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.section-heading h2, .contact-panel h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.section-heading > p { max-width: 410px; margin-bottom: .35rem; color: var(--muted); }
.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 210px) auto;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(21, 24, 29, .88);
}
.search-field { position: relative; }
.search-field svg {
  position: absolute;
  left: .9rem;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}
.search-field input, .year-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #0f1216;
  outline: none;
}
.search-field input { padding: .75rem .9rem .75rem 2.8rem; }
.year-field select { padding: .75rem 2.3rem .75rem .85rem; }
.search-field input:focus, .year-field select:focus { border-color: #8b97a8; box-shadow: 0 0 0 3px rgba(168, 180, 196, .14); }
.result-count { min-width: 80px; padding-right: .45rem; color: var(--muted); font-size: .82rem; text-align: right; }
.portfolio-status { padding: 4rem 1rem; color: var(--muted); text-align: center; }
.portfolio-status.is-error { color: #ffb4b4; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
}
.project-card {
  grid-column: span 4;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 24, 29, .94);
  box-shadow: 0 15px 50px rgba(0, 0, 0, .13);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.project-card:nth-child(5n + 1), .project-card:nth-child(5n + 2) { grid-column: span 6; }
.project-card:hover {
  transform: translateY(-5px);
  border-color: #46505d;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
}
.project-open {
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.project-media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #282e37; }
.project-media img, .project-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.project-card:hover .project-media img { transform: scale(1.045); }
.project-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #252a32, #39414d);
  color: rgba(255, 255, 255, .78);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 750;
}
.project-index {
  position: absolute;
  top: .8rem;
  left: .8rem;
  padding: .34rem .55rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  color: #fff;
  background: rgba(10, 12, 15, .65);
  backdrop-filter: blur(10px);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.project-body { display: grid; align-content: space-between; gap: 1.3rem; padding: 1.25rem; }
.project-body h3 { margin-bottom: .45rem; font-size: 1.28rem; letter-spacing: -.02em; }
.project-summary { margin-bottom: 0; color: var(--muted); font-size: .92rem; }
.project-footer { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.project-meta { display: flex; flex-wrap: wrap; gap: .45rem; }
.meta-pill {
  padding: .3rem .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c7ced7;
  background: rgba(255, 255, 255, .025);
  font-size: .7rem;
  font-weight: 700;
}
.project-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  transition: transform .2s ease, background .2s ease;
}
.project-card:hover .project-arrow { transform: translate(2px, -2px); background: var(--panel-3); }
.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .5rem;
  padding: 2rem;
  border: 1px dashed var(--line-bright);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}
.empty-state span { color: var(--text); font-size: 1.2rem; font-weight: 750; }
.empty-state p { margin-bottom: .7rem; }

.contact-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: clamp(2rem, 7vw, 6rem) 0 2rem;
  padding: clamp(1.6rem, 5vw, 3.8rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(35, 40, 49, .96), rgba(18, 21, 26, .97));
  box-shadow: var(--shadow);
}
.contact-panel > div { max-width: 780px; }
.contact-panel-actions { display: grid; justify-items: end; gap: .9rem; flex: 0 0 auto; }
.business-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem 1rem; color: var(--muted); font-size: .84rem; }
.business-links a { text-decoration: none; }
.business-links a:hover { color: var(--text); }
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem clamp(1rem, 4vw, 3rem) 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}
.site-footer div { display: flex; gap: 1.1rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); }

.project-dialog {
  width: min(1120px, calc(100vw - 2rem));
  max-height: min(900px, calc(100vh - 2rem));
  padding: 0;
  overflow: hidden auto;
  border: 1px solid var(--line-bright);
  border-radius: 24px;
  color: var(--text);
  background: #12151a;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .72);
}
.project-dialog::backdrop { background: rgba(4, 5, 7, .84); backdrop-filter: blur(10px); }
.dialog-close {
  position: sticky;
  float: right;
  top: 1rem;
  z-index: 5;
  width: 42px;
  height: 42px;
  margin: 1rem 1rem -58px 0;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 12, 15, .75);
  backdrop-filter: blur(12px);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.dialog-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); min-height: 660px; }
.dialog-media { min-width: 0; padding: 1rem; border-right: 1px solid var(--line); background: #0d0f12; }
.dialog-main { overflow: hidden; min-height: 460px; border-radius: 15px; background: #242a32; }
.dialog-main img, .dialog-main .project-placeholder { width: 100%; height: 100%; min-height: 460px; object-fit: contain; }
.dialog-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 110px;
  gap: .6rem;
  margin-top: .8rem;
  padding-bottom: .25rem;
  overflow-x: auto;
}
.gallery-thumb {
  overflow: hidden;
  width: 110px;
  height: 76px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #242a32;
  cursor: pointer;
}
.gallery-thumb:hover, .gallery-thumb.is-active { border-color: #a6b0bd; }
.gallery-thumb img, .gallery-thumb .project-placeholder { width: 100%; height: 100%; object-fit: cover; font-size: 1.5rem; }
.dialog-details { padding: clamp(1.6rem, 4vw, 3rem); }
.dialog-details h2 { margin-bottom: .75rem; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1; letter-spacing: -.05em; }
.dialog-lead { margin-bottom: 1.7rem; color: #c5cbd4; font-size: 1.05rem; }
.dialog-meta { display: grid; gap: .75rem; margin: 0 0 2rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.dialog-meta div { display: grid; grid-template-columns: 90px 1fr; gap: .8rem; }
.dialog-meta dt { color: var(--muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.dialog-meta dd { margin: 0; color: #dde2e8; }
.dialog-description { color: #b6bec8; white-space: pre-line; }
.dialog-description-title { margin: 1.8rem 0 .5rem; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; }
.noscript { position: fixed; inset: auto 1rem 1rem; z-index: 60; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }

@media (max-width: 1050px) {
  .project-card { grid-column: span 6; }
  .project-card:nth-child(5n + 1), .project-card:nth-child(5n + 2) { grid-column: span 6; }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .dialog-main, .dialog-main img, .dialog-main .project-placeholder { min-height: 360px; max-height: 65vh; }
}

@media (max-width: 780px) {
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 2.5rem; padding-block: 4.5rem; }
  .hero h1 { font-size: clamp(3rem, 14vw, 5.6rem); }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .stat-card { padding: 1rem; }
  .stat-card strong { font-size: 1.05rem; }
  .section-heading { align-items: start; flex-direction: column; gap: .8rem; }
  .filter-bar { grid-template-columns: 1fr 160px; }
  .result-count { grid-column: 1 / -1; min-width: 0; padding: 0 .2rem; text-align: left; }
  .contact-panel { align-items: flex-start; flex-direction: column; }
  .contact-panel-actions { justify-items: start; }
  .business-links { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .topbar { align-items: center; }
  .brand small, .nav-link { display: none; }
  .topbar-actions .button { min-height: 38px; padding: .58rem .72rem; font-size: .78rem; }
  .page-shell { padding-inline: 1rem; }
  .hero { padding-block: 3.6rem; }
  .hero h1 { letter-spacing: -.055em; }
  .hero-stats { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .result-count { grid-column: auto; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .project-card, .project-card:nth-child(5n + 1), .project-card:nth-child(5n + 2) { grid-column: 1; }
  .contact-panel { border-radius: 18px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .project-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .dialog-media { padding: .65rem; }
  .dialog-main, .dialog-main img, .dialog-main .project-placeholder { min-height: 280px; max-height: 48vh; }
  .dialog-details { padding: 1.5rem 1.1rem 3rem; }
}

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