:root {
  color-scheme: dark;
  font-family: Manrope, Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #0f1214;
  --bg-soft: #1e2225;
  --surface: rgba(30, 34, 37, 0.88);
  --surface-strong: #12161a;
  --text: #ffffff;
  --muted: rgba(252, 252, 255, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #ff3b2e;
  --accent-hot: #e4212e;
  --accent-warm: #e65522;
  --shadow: 16px 16px 42px rgba(0, 0, 0, 0.34), -10px -10px 32px rgba(255, 255, 255, 0.03);
  --devstack-red: #ff3b2e;
  --devstack-success: #44c209;
  --devstack-warning: #ff8313;
  --devstack-ink: #1e2225;
  --devstack-frame: #0f1214;
  --nav-shell-bg: rgba(30, 34, 37, 0.9);
  --nav-shell-bg-elevated: rgba(30, 34, 37, 0.96);
  --nav-item-bg: transparent;
  --nav-item-border: rgba(255, 255, 255, 0.13);
  --nav-item-hover: rgba(255, 255, 255, 0.06);
  --nav-item-active: rgba(255, 59, 46, 0.12);
  --nav-item-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
  --nav-text: rgba(252, 252, 255, 0.74);
  --nav-accent: var(--devstack-red);
  --radius: 8px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf1fa;
  --bg-soft: #f8fbff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #223650;
  --muted: rgba(34, 54, 80, 0.66);
  --line: rgba(34, 54, 80, 0.14);
  --accent: #1991ee;
  --accent-hot: #ff4352;
  --accent-warm: #19eea5;
  --shadow: 16px 16px 42px rgba(30, 34, 37, 0.12), -10px -10px 30px rgba(255, 255, 255, 0.88);
  --devstack-red: #1991ee;
  --devstack-success: #19eea5;
  --devstack-warning: #ffcd19;
  --devstack-ink: #223650;
  --devstack-frame: #edf1fa;
  --nav-shell-bg: rgba(237, 241, 250, 0.9);
  --nav-shell-bg-elevated: rgba(255, 255, 255, 0.96);
  --nav-item-bg: transparent;
  --nav-item-border: rgba(34, 54, 80, 0.14);
  --nav-item-hover: rgba(25, 145, 238, 0.08);
  --nav-item-active: rgba(25, 145, 238, 0.13);
  --nav-item-shadow: 0 14px 28px rgba(34, 54, 80, 0.11);
  --nav-text: rgba(34, 54, 80, 0.78);
  --nav-accent: var(--accent);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent-hot) 16%, transparent), transparent 22%, transparent 78%, color-mix(in srgb, var(--accent-warm) 14%, transparent)),
    linear-gradient(180deg, var(--bg-soft), var(--bg) 380px),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: clamp(360px, 86vmin, 980px);
  height: clamp(360px, 86vmin, 980px);
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 48%),
    url("assets/portfolio-bg-dark.svg") center / contain no-repeat;
  opacity: 0.42;
  filter: blur(4px) saturate(1.2) contrast(1.08);
  transform: translate(-50%, -46%);
}

:root[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 50%),
    url("assets/portfolio-bg-light.svg") center / contain no-repeat;
  opacity: 0.46;
  filter: blur(4px) saturate(1.16) contrast(1.04);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 36%, transparent), color-mix(in srgb, var(--bg) 54%, transparent)),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 1.5%, transparent) 0 1px, transparent 1px 120px);
}

body.nav-open {
  overflow: hidden;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

main {
  transition: opacity 240ms ease, transform 240ms ease, filter 240ms ease;
}

body.page-loading main {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(12px);
}

@keyframes pg-enter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

main.page-entering {
  animation: pg-enter 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Loading spinner */
.page-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 40px;
  height: 40px;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.page-spinner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
}

.page-spinner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  animation: page-spin 700ms linear infinite;
  animation-play-state: paused;
}

body.page-loading .page-spinner {
  opacity: 1;
  transition: opacity 200ms ease 120ms;
}

body.page-loading .page-spinner::after {
  animation-play-state: running;
}

@keyframes page-spin {
  to { transform: rotate(360deg); }
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 92px;
  padding: 12px clamp(18px, 4%, 56px);
  border-bottom: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.site-header[data-elevated="true"],
body.nav-open .site-header {
  background: var(--nav-shell-bg-elevated);
  border-bottom-color: var(--nav-item-border);
  box-shadow: var(--nav-item-shadow);
  backdrop-filter: blur(24px) saturate(1.2);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-strong);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18), inset 1px 1px 1px rgba(255, 255, 255, 0.12);
}

.brand-logo {
  width: 72px;
  height: 72px;
}

.brand-logo-light {
  display: none;
}

:root[data-theme="light"] .brand-logo-dark {
  display: none;
}

:root[data-theme="light"] .brand-logo-light {
  display: block;
}

.brand-copy {
  display: grid;
  gap: 1px;
  max-width: 180px;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 0.82rem;
  letter-spacing: 0;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.68rem;
}

.nav-links {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--nav-item-border);
  border-radius: var(--radius);
  background: var(--nav-shell-bg);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px) saturate(1.18);
}

.chip-button,
.filter-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.08);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.nav-links a {
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--nav-text);
  text-decoration: none;
  background: var(--nav-item-bg);
  padding: 10px 13px;
  font-size: 0.92rem;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  border-color: color-mix(in srgb, var(--nav-accent) 42%, var(--nav-item-border));
  background: var(--nav-item-hover);
  box-shadow: inset 0 -2px 0 var(--nav-accent), 0 10px 20px rgba(0, 0, 0, 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.nav-links a.active {
  background: var(--nav-item-active);
}

.chip-button:hover,
.filter-button:hover,
.filter-button.active {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent) 68%, transparent), 0 14px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-actions .chip-button {
  border-color: var(--nav-item-border);
  color: var(--nav-text);
  background: var(--nav-item-bg);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.07);
}

.header-actions .chip-button:hover,
.nav-toggle:hover {
  border-color: color-mix(in srgb, var(--nav-accent) 42%, var(--nav-item-border));
  background: var(--nav-item-hover);
  box-shadow: inset 0 -2px 0 var(--nav-accent), 0 10px 20px rgba(0, 0, 0, 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.chip-button,
.filter-button {
  min-height: 38px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 750;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--nav-item-border);
  border-radius: var(--radius);
  background: var(--nav-item-bg);
  color: var(--nav-text);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: 760px;
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-ambient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--bg) 78%, transparent), transparent 58%),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 5%, transparent) 0 1px, transparent 1px 108px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--text) 4%, transparent) 0 1px, transparent 1px 108px);
  mask-image: linear-gradient(to bottom, black 78%, transparent);
  opacity: 0.8;
}

.hero-inner,
.page-hero,
.section,
.feature-band,
.site-footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(380px, 1.08fr);
  gap: 44px;
  align-items: center;
  padding: 130px 0 66px;
}

.hero-copy-block {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-warm);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

.hero h1,
.page-hero h1,
.section-heading h2,
.contact-hero h1 {
  max-width: 900px;
  margin: 0;
  font-weight: 900;
  line-height: 1.08;
}

.hero h1 {
  font-size: 2.4rem;
}

.page-hero h1,
.contact-hero h1 {
  font-size: 2.1rem;
}

.contact-hero {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  gap: 14px;
  max-width: none;
}

.contact-hero h1 {
  max-width: 760px;
  font-size: 2.35rem;
  line-height: 1.08;
}

.contact-hero .lead {
  max-width: 700px;
  margin-top: 4px;
}

.section-heading h2 {
  font-size: 2.15rem;
}

.lead,
.section-heading p,
.card p,
.process-list p,
.contact-card p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.lead {
  max-width: 760px;
  margin: 24px 0 0;
}

.hero-actions,
.filter-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.secondary-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 12px 18px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 850;
  letter-spacing: 0;
  border: 1px solid transparent;
  isolation: isolate;
  box-shadow:
    10px 10px 26px rgba(0, 0, 0, 0.14),
    -8px -8px 24px color-mix(in srgb, var(--accent) 9%, transparent),
    inset 1px 1px 1px rgba(255, 255, 255, 0.18),
    inset -1px -1px 1px rgba(0, 0, 0, 0.1);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-link::after,
.secondary-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-120%);
  transition: transform 420ms ease;
  z-index: -1;
}

.primary-link:hover,
.secondary-link:hover {
  transform: translateY(-2px);
  box-shadow:
    14px 14px 34px rgba(0, 0, 0, 0.2),
    -8px -8px 28px color-mix(in srgb, var(--accent) 12%, transparent),
    inset 1px 1px 1px rgba(255, 255, 255, 0.22);
}

.primary-link:hover::after,
.secondary-link:hover::after {
  transform: translateX(120%);
}

.primary-link {
  background:
    linear-gradient(51deg, var(--accent-hot) 0%, var(--accent) 42%, var(--accent-warm) 100%),
    color-mix(in srgb, var(--surface) 60%, transparent);
  color: #ffffff;
  border-color: color-mix(in srgb, var(--accent) 72%, #ffffff);
  box-shadow:
    0 13px 34px color-mix(in srgb, var(--accent) 26%, transparent),
    inset 2px 2px 3px rgba(255, 255, 255, 0.45),
    inset -3px -3px 9px rgba(0, 0, 0, 0.18);
}

.primary-link:hover {
  box-shadow:
    0 18px 42px color-mix(in srgb, var(--accent) 34%, transparent),
    inset 2px 2px 4px rgba(255, 255, 255, 0.5),
    inset -3px -3px 10px rgba(0, 0, 0, 0.2);
}

.secondary-link {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 44%),
    color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 18%, var(--line));
  backdrop-filter: blur(14px) saturate(1.12);
  box-shadow:
    10px 10px 26px rgba(0, 0, 0, 0.12),
    -8px -8px 24px rgba(255, 255, 255, 0.04),
    inset 1px 1px 1px rgba(255, 255, 255, 0.12);
}

.secondary-link:hover {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--text) 8%, transparent), transparent 44%),
    color-mix(in srgb, var(--surface) 88%, transparent);
}

.secondary-link::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius) - 1px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.hero-showcase {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: 0;
}

.hero-panel {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 48%),
    color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.16);
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.panel-topline strong {
  color: var(--accent-warm);
}

.panel-screens {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.panel-screens img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.panel-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 48%, transparent);
  box-shadow: inset 2px 2px 8px rgba(255, 255, 255, 0.04), inset -5px -5px 16px rgba(0, 0, 0, 0.14);
}

.panel-row > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #ffffff;
  font-weight: 900;
}

.panel-row div {
  display: grid;
  gap: 5px;
}

.panel-row strong {
  font-size: 1.05rem;
}

.panel-row small,
.panel-note {
  color: var(--muted);
  line-height: 1.55;
}

.panel-note {
  padding: 4px 2px 0;
}

.hero-showcase::before {
  content: "";
  position: absolute;
  inset: 24px 18px 70px 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  transform: rotate(-1deg);
  opacity: 0.42;
}

.browser-frame,
.preview-stack article {
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.16);
}

.browser-frame {
  position: relative;
  overflow: hidden;
  transform: rotate(-0.7deg);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.browser-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-hot);
}

.browser-bar span:nth-child(2) {
  background: var(--accent-warm);
}

.browser-bar span:nth-child(3) {
  background: var(--accent);
}

.browser-bar strong {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.browser-frame img,
.site-preview {
  width: 100%;
  height: 360px;
  object-fit: cover;
  filter: saturate(0.92) contrast(0.98);
}

.site-preview {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), transparent 44%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent-warm) 24%, transparent), transparent 42%),
    var(--devstack-ink);
}

.villa-preview::before {
  content: "";
  position: absolute;
  inset: 58px 48px 72px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: skewY(-5deg);
}

.villa-preview span {
  position: absolute;
  display: block;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
}

.villa-preview span:nth-child(1) {
  left: 58px;
  top: 76px;
  width: 54%;
  height: 18px;
}

.villa-preview span:nth-child(2) {
  left: 58px;
  top: 112px;
  width: 34%;
  height: 10px;
}

.villa-preview span:nth-child(3),
.villa-preview span:nth-child(4) {
  width: 18px;
  height: 18px;
  background: var(--accent-warm);
}

.villa-preview span:nth-child(3) {
  right: 34%;
  top: 46%;
}

.villa-preview span:nth-child(4) {
  right: 22%;
  top: 58%;
}

.preview-stack {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.preview-stack article {
  display: grid;
  grid-template-rows: 78px auto;
  gap: 8px;
  overflow: hidden;
  padding: 10px;
}

.preview-stack img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--devstack-frame);
}

.preview-stack article:nth-child(1) img,
.preview-stack article:nth-child(2) img,
.preview-stack article:nth-child(4) img {
  object-fit: contain;
  padding: 10px;
}

.preview-stack span {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: rgba(10, 12, 10, 0.58);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
}

.hero-stats,
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 740px;
  margin: 46px 0 0;
}

.hero-stats div,
.mini-stats div {
  border-left: 3px solid var(--accent-hot);
  padding: 4px 14px;
}

.hero-stats dt,
.mini-stats dt {
  font-size: 1.6rem;
  font-weight: 900;
}

.hero-stats dd,
.mini-stats dd {
  margin: 4px 0 0;
  color: var(--muted);
}

.feature-band {
  padding: 26px 0;
}

.feature-band p {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 760;
  line-height: 1.7;
}

.section,
.page-hero,
.contact-hero {
  padding: 104px 0 64px;
}

.page-hero,
.contact-hero {
  padding-top: 150px;
}

.section-heading {
  display: grid;
  gap: 12px;
  max-width: 820px;
  margin-bottom: 30px;
}

.section-heading p {
  margin: 0;
}

.grid-3,
.work-grid,
.services-grid,
.case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card,
.work-card,
.service-card,
.case-panel,
.contact-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.12);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover,
.service-card:hover,
.case-panel:hover,
.contact-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  box-shadow: 12px 12px 34px rgba(0, 0, 0, 0.24), -8px -8px 24px color-mix(in srgb, var(--accent) 8%, transparent);
}

.card.is-filtered-out {
  display: none;
}

.card {
  display: grid;
  grid-template-rows: 220px 1fr;
  overflow: hidden;
}

.card-media {
  margin: 0;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-media img {
  object-position: top center;
  filter: saturate(0.96) contrast(0.98);
}

.logo-media img,
.dark-media img {
  object-fit: contain;
  padding: 28px;
}

.dark-media {
  background: var(--devstack-frame);
}

.card-body,
.service-card,
.case-panel,
.contact-card {
  display: grid;
  gap: 13px;
  padding: 22px;
}

.case-type {
  color: var(--accent-warm);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card h3,
.service-card h3,
.case-panel h3 {
  margin: 0;
  font-size: 1.35rem;
}

.card p,
.service-card p,
.case-panel p,
.contact-card p {
  margin: 0;
}

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

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 780;
  white-space: nowrap;
  align-self: center;
}

.mock-media {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 36%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent-warm) 16%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface-strong) 90%, transparent);
}

.case-symbol {
  display: grid;
  place-items: center;
  width: min(80%, 260px);
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 46%),
    color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 900;
}

.terminal-shot,
.dashboard-shot {
  width: min(100%, 340px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--devstack-frame);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}

.terminal-shot {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.terminal-shot span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.terminal-shot strong {
  font-size: 1.2rem;
}

.terminal-shot code {
  color: var(--devstack-warning);
  white-space: normal;
}

.dashboard-shot {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.dashboard-shot span {
  font-weight: 900;
}

.dashboard-shot div {
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--devstack-success), var(--devstack-warning) 58%, var(--accent));
}

.dashboard-shot div:nth-child(3) {
  width: 78%;
}

.dashboard-shot div:nth-child(4) {
  width: 58%;
}

.villa-mini-preview {
  width: min(100%, 340px);
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 38%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent-warm) 16%, transparent), transparent 45%),
    var(--devstack-frame);
  color: #ffffff;
}

.villa-mini-preview span {
  font-weight: 900;
}

.villa-mini-preview div {
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.76);
}

.villa-mini-preview div:nth-child(3) {
  width: 72%;
}

.villa-mini-preview div:nth-child(4) {
  width: 48%;
  background: var(--accent-warm);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 28px;
  align-items: start;
}

.sticky-note {
  position: sticky;
  top: 110px;
}

.process-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-list li {
  display: grid;
  gap: 12px;
  min-height: 250px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.process-list span {
  color: var(--accent);
  font-weight: 900;
}

.showcase-img {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.showcase-img img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
}

.contact-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
  padding-top: 24px;
}

.contact-form {
  display: grid;
  gap: 12px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: 12px;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto auto auto;
  }

  .nav-toggle {
    display: block;
    justify-self: end;
  }

  .nav-links {
    position: fixed;
    top: 92px;
    left: 0;
    right: 0;
    display: none;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px;
    border-radius: 0;
    background: var(--nav-shell-bg-elevated);
    border: 0;
    border-top: 1px solid var(--nav-item-border);
    border-bottom: 1px solid var(--nav-item-border);
    box-shadow: var(--nav-item-shadow);
  }

  body.nav-open .nav-links {
    display: grid;
  }

  .header-actions {
    justify-self: end;
  }

  .hero h1 {
    font-size: 2.45rem;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 118px;
  }

  .hero-copy-block {
    max-width: 760px;
  }

  .hero-showcase {
    max-width: 760px;
  }

  .browser-frame img,
  .site-preview {
    height: 300px;
  }

  .grid-3,
  .work-grid,
  .services-grid,
  .case-grid,
  .split,
  .process-list,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .sticky-note {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header {
    gap: 10px;
    padding: 12px 14px;
  }

  .brand-copy {
    display: none;
  }

  .chip-button {
    min-height: 36px;
    padding: 8px 9px;
    font-size: 0.82rem;
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .page-hero h1,
  .contact-hero h1,
  .section-heading h2 {
    font-size: 1.75rem;
  }

  .contact-hero h1 {
    font-size: 1.7rem;
    line-height: 1.12;
  }

  .preview-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browser-frame img,
  .site-preview {
    height: 220px;
  }

  .lead,
  .section-heading p,
  .card p,
  .process-list p,
  .contact-card p {
    font-size: 1rem;
  }

  .hero-stats,
  .mini-stats {
    grid-template-columns: 1fr;
    margin-top: 30px;
  }

  .section,
  .page-hero,
  .contact-hero {
    padding: 86px 0 50px;
  }

  .page-hero,
  .contact-hero {
    padding-top: 124px;
  }

  .card {
    grid-template-rows: 190px 1fr;
  }
}

/* ============================================================
   Lightbox
   ============================================================ */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.80);
  backdrop-filter: blur(10px) saturate(1.2);
  opacity: 0;
  transition: opacity 220ms ease;
}

.lb-overlay[hidden] { display: none; }
.lb-overlay.lb-visible { opacity: 1; }

.lb-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  max-height: 780px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: scale(0.93) translateY(18px);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lb-overlay.lb-visible .lb-dialog {
  transform: scale(1) translateY(0);
}

/* Header bar */
.lb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: color-mix(in srgb, var(--bg) 72%, var(--bg-soft));
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  user-select: none;
}

.lb-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.lb-dots i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  font-style: normal;
}

.lb-dots i:nth-child(1) { background: #ff5f57; }
.lb-dots i:nth-child(2) { background: #febc2e; }
.lb-dots i:nth-child(3) { background: #28c840; }

.lb-head-title {
  flex: 1;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-counter {
  font-size: 0.76rem;
  color: var(--muted);
  min-width: 34px;
  text-align: center;
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 10;
  width: 52px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 180ms, color 180ms, border-color 180ms;
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-prev:disabled,
.lb-next:disabled {
  opacity: 0.15;
  cursor: default;
  pointer-events: none;
}

.lb-prev:not(:disabled):hover,
.lb-next:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: white;
}

.lb-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  transition: background 150ms, color 150ms, border-color 150ms;
  flex-shrink: 0;
}

.lb-close:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  color: var(--text);
}

/* Stage: screenshot left + details right */
.lb-stage {
  display: grid;
  grid-template-columns: 1fr 310px;
  flex: 1;
  min-height: 0;
}

.lb-left {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.lb-screenshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.lb-spin {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 2;
}

.lb-spin[hidden] { display: none; }

.lb-spin span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: page-spin 700ms linear infinite;
}

/* Details panel */
.lb-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 20px 20px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--surface-strong);
}

.lb-case-type {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lb-name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.18;
  color: var(--text);
}

.lb-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.68;
  flex: 1;
}

.lb-tags {
  flex-shrink: 0;
}

.lb-foot {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.lb-visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: opacity 160ms, transform 160ms;
}

.lb-visit-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.lb-visit-btn[hidden] { display: none; }

.card-clickable { cursor: pointer; }

.focus-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
  transition: gap 150ms ease;
}

.focus-link:hover {
  gap: 7px;
}

@media (max-width: 680px) {
  .lb-stage {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
  }

  .lb-left {
    border-bottom: 1px solid var(--line);
  }

  .lb-right {
    border-left: none;
    overflow-y: auto;
  }
}

body.lb-open {
  overflow: hidden;
}
