/* ================================================
   DOMIT SOLUTIONS — Design Tokens & Component Styles
   Editorial tech palette: Warm ivory, graphite, restrained blue
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ─── TYPE SCALE ─── */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);
}

/* ─── SPACING ─── */
:root {
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

/* ─── FONTS ─── */
:root {
  --font-display: 'Space Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Helvetica Neue', sans-serif;
}

/* ─── LIGHT MODE ─── */
:root, [data-theme="light"] {
  /* Surfaces */
  --color-bg:             #f4efe8;
  --color-surface:        #efe8dd;
  --color-surface-2:      #faf6f0;
  --color-surface-offset: #e5dccf;
  --color-divider:        #d5c9b8;
  --color-border:         #c8bba8;

  /* Text */
  --color-text:           #191510;
  --color-text-muted:     #695f54;
  --color-text-faint:     #9a8e81;
  --color-text-inverse:   #faf6f0;

  /* Primary — restrained ink blue */
  --color-primary:        #324d7b;
  --color-primary-hover:  #243c63;
  --color-primary-active: #1a2d4a;
  --color-primary-highlight: #dde5f0;

  /* Accent — warm stone */
  --color-accent:         #8a7358;
  --color-accent-hover:   #6e5d49;

  /* Semantic */
  --color-success:        #4c7a55;
  --color-warning:        #9d6a2f;
  --color-error:          #b04d41;

  /* UI */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-2xl:  1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(34, 24, 15, 0.05);
  --shadow-md: 0 10px 24px rgba(34, 24, 15, 0.08);
  --shadow-lg: 0 20px 48px rgba(34, 24, 15, 0.11);
  --shadow-xl: 0 32px 72px rgba(34, 24, 15, 0.14);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* ─── DARK MODE ─── */
[data-theme="dark"], @media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #14110f;
    --color-surface:        #1c1815;
    --color-surface-2:      #25201c;
    --color-surface-offset: #2b2520;
    --color-divider:        #3a322b;
    --color-border:         #4a4037;
    --color-text:           #f3ece3;
    --color-text-muted:     #c2b4a4;
    --color-text-faint:     #7d7267;
    --color-text-inverse:   #171310;
    --color-primary:        #d7c1a0;
    --color-primary-hover:  #e6d1b2;
    --color-primary-active: #f1e3cd;
    --color-primary-highlight: #2b2520;
    --color-accent:         #9aacc4;
    --color-accent-hover:   #c2d0e3;
    --color-success:        #9ec29d;
    --color-warning:        #d3ac73;
    --color-error:          #de8d84;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.26);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.34);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.42);
    --shadow-xl: 0 32px 72px rgba(0, 0, 0, 0.5);
  }
}

[data-theme="dark"] {
  --color-bg:             #14110f;
  --color-surface:        #1c1815;
  --color-surface-2:      #25201c;
  --color-surface-offset: #2b2520;
  --color-divider:        #3a322b;
  --color-border:         #4a4037;
  --color-text:           #f3ece3;
  --color-text-muted:     #c2b4a4;
  --color-text-faint:     #7d7267;
  --color-text-inverse:   #171310;
  --color-primary:        #d7c1a0;
  --color-primary-hover:  #e6d1b2;
  --color-primary-active: #f1e3cd;
  --color-primary-highlight: #2b2520;
  --color-accent:         #9aacc4;
  --color-accent-hover:   #c2d0e3;
  --color-success:        #9ec29d;
  --color-warning:        #d3ac73;
  --color-error:          #de8d84;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.26);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.42);
  --shadow-xl: 0 32px 72px rgba(0, 0, 0, 0.5);
}

/* ================================================
   LOGO SWITCHING (dark/light mode)
   ================================================ */

/* Generated logo image used in nav and footer */
.site-logo {
  display: block;
  width: auto;
  height: clamp(52px, 5.4vw, 58px);
  max-width: min(48vw, 360px);
  object-fit: contain;
  flex-shrink: 0;
  transform-origin: left center;
}

.site-logo--footer {
  height: clamp(40px, 4.4vw, 46px);
  max-width: min(42vw, 280px);
}

[data-theme="dark"] .logo-adaptive {
  filter: invert(1) brightness(1.18) contrast(1.08);
}

[data-theme="light"] .logo-adaptive {
  filter: contrast(1.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-adaptive {
    filter: invert(1) brightness(1.18) contrast(1.08);
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .logo-adaptive {
    filter: contrast(1.06);
  }
}

/* Legacy classes — hide unused */
.logo-dark { display: none !important; }
.logo-light { display: none !important; }

/* ================================================
   LAYOUT UTILITIES
   ================================================ */

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 5vw, var(--space-16));
}

.container--narrow {
  max-width: var(--content-default);
}

/* ================================================
   NAVIGATION
   ================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: 1rem;
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.nav--scrolled {
  background: transparent;
  box-shadow: none;
  border-bottom: none;
}

.nav__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1.35rem, 2vw, 2.4rem);
  min-height: 78px;
  padding: 0.72rem 1.15rem 0.72rem 1.25rem;
  background: color-mix(in srgb, var(--color-surface-2) 78%, rgba(255,255,255,0.45) 22%);
  border: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 42px rgba(39, 28, 17, 0.08);
}

.nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
  line-height: 1;
  min-width: 0;
}

.nav__logo .site-logo {
  flex-shrink: 0;
  height: clamp(32px, 3.1vw, 38px);
  max-width: min(20vw, 230px);
}

.nav__links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(1rem, 1.5vw, 1.75rem);
  list-style: none;
  min-width: 0;
  padding-left: clamp(0.3rem, 1vw, 1rem);
  overflow: hidden;
}

.nav__links a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  padding: 0.35rem 0;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-interactive);
  border-radius: var(--radius-full);
}

.nav__links a:hover {
  color: var(--color-text);
}

.nav__links a:hover::after {
  width: 100%;
}

.nav__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
  background: none;
  border: none;
  color: var(--color-text);
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: var(--radius-full);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
}

.nav__mobile.is-open {
  display: flex;
}

.nav__mobile a {
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
}

.nav__mobile a:hover {
  color: var(--color-primary);
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.9rem 1.45rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition-interactive);
  white-space: nowrap;
  line-height: 1.4;
}

.btn--primary {
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: #fff;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--color-primary) 26%, transparent);
}

.btn--primary:hover {
  background: linear-gradient(180deg, var(--color-primary-hover) 0%, var(--color-primary-active) 100%);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--color-primary) 32%, transparent);
}

[data-theme="dark"] .btn--primary {
  background: linear-gradient(180deg, #d7c1a0 0%, #c9b18f 100%);
  color: #221c17;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .btn--primary:hover {
  background: linear-gradient(180deg, #e3cfb2 0%, #d1bb9a 100%);
  color: #1c1713;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.btn--outline {
  background: color-mix(in srgb, var(--color-surface-2) 90%, transparent);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

.btn--ghost:hover {
  background: var(--color-primary-highlight);
}

.btn--lg {
  padding: 1rem 1.75rem;
  font-size: var(--text-base);
}

/* ================================================
   HERO SECTION
   ================================================ */

.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 96px;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 52% 42% at 78% 24%, color-mix(in srgb, var(--color-primary) 12%, transparent) 0%, transparent 64%),
    radial-gradient(ellipse 40% 50% at 20% 72%, color-mix(in srgb, var(--color-accent) 12%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface-2) 86%, transparent), transparent 35%),
    var(--color-bg);
}

.hero__grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--color-border) 34%, transparent) 0,
      color-mix(in srgb, var(--color-border) 34%, transparent) 1px,
      transparent 1px,
      transparent 96px
    );
  opacity: 0.45;
  mask-image: linear-gradient(180deg, black 0%, black 55%, transparent 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(340px, 0.78fr);
  align-items: center;
  gap: clamp(3rem, 5.4vw, 5.75rem);
  padding-block: var(--space-24);
  width: 100%;
}

.hero__text {
  max-width: 50rem;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: color-mix(in srgb, var(--color-surface-2) 88%, transparent);
  color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero__heading {
  font-family: var(--font-display);
  font-size: clamp(3.35rem, 5.8vw, 5.6rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  max-width: 12.2ch;
  text-wrap: balance;
}

.hero__heading .highlight {
  color: var(--color-primary);
  white-space: nowrap;
}

.hero__description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.8;
  max-width: 50ch;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
}

.hero__stats {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.hero__stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: var(--space-4);
  min-width: 128px;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
}

.hero__stat-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.hero__stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Hero visual — code card */
.hero__visual {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hero__card {
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  max-width: 36rem;
  margin-left: auto;
}

.hero__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--color-primary) 55%, transparent), color-mix(in srgb, var(--color-accent) 35%, transparent));
}

.hero__card-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--color-divider) 72%, transparent);
}

.hero__card-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.hero__card-dot:nth-child(1) { background: #ff5f57; }
.hero__card-dot:nth-child(2) { background: #febc2e; }
.hero__card-dot:nth-child(3) { background: #28c840; }

.hero__card-title {
  margin-left: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-family: 'Space Grotesk', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__code {
  font-family: 'Space Grotesk', 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--color-text-muted);
}

.hero__code .c-keyword { color: var(--color-primary); font-weight: 600; }
.hero__code .c-string  { color: var(--color-accent); }
.hero__code .c-comment { color: var(--color-text-faint); font-style: italic; }
.hero__code .c-fn      { color: color-mix(in srgb, var(--color-text) 82%, var(--color-primary) 18%); }
.hero__code .c-prop    { color: color-mix(in srgb, var(--color-primary) 78%, var(--color-accent) 22%); }

.hero__card--floating {
  position: absolute;
  bottom: -20px;
  right: -10px;
  width: 220px;
  padding: var(--space-4) var(--space-5);
  transform: rotate(2deg);
  box-shadow: var(--shadow-xl);
}

.hero__card--floating .metric {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hero__card--floating .metric__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.hero__card--floating .metric__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-success);
}

.hero__card--floating .metric__change {
  font-size: var(--text-xs);
  color: var(--color-success);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ================================================
   SERVICES SECTION
   ================================================ */

.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 56ch;
  margin-bottom: var(--space-12);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

.service-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  transition: all var(--transition-interactive);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 0%, transparent) 0%, color-mix(in srgb, var(--color-primary) 8%, transparent) 100%);
  opacity: 0;
  transition: opacity var(--transition-interactive);
  border-radius: inherit;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-primary) 22%, var(--color-border));
}

.service-card:hover::after {
  opacity: 1;
}

.service-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  background: color-mix(in srgb, var(--color-surface) 82%, var(--color-primary-highlight) 18%);
  color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  flex-shrink: 0;
}

.service-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.25;
}

.service-card__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: unset;
}

.service-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: color-mix(in srgb, var(--color-surface) 88%, var(--color-surface-offset) 12%);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
}

/* ================================================
   PROJECTS SECTION
   ================================================ */

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-6);
}

.project-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: all var(--transition-interactive);
  display: flex;
  flex-direction: column;
}

.project-card--placeholder {
  border: 1.5px dashed var(--color-border);
  background: transparent;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 320px;
  gap: var(--space-4);
  padding: var(--space-10);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-primary) 22%, var(--color-border));
}

.project-card__visual {
  height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.project-card__visual--certsentinel {
  background: linear-gradient(135deg, #ebe5dc 0%, #d7dde7 55%, #c3cfde 100%);
}

.project-card__visual--docextract {
  background: linear-gradient(135deg, #efe8de 0%, #ddd3c5 55%, #cbbda7 100%);
}

.project-card__visual--vinreport {
  background: linear-gradient(135deg, #ece6df 0%, #d3d9e1 52%, #b7c1cf 100%);
}

.project-card__visual--aicreator {
  background: linear-gradient(135deg, #efe9e1 0%, #d8d1c5 52%, #b7b09d 100%);
}

.project-card__badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: rgba(24, 21, 16, 0.66);
  backdrop-filter: blur(8px);
  border: 1px solid oklch(1 0 0 / 0.15);
  color: #fff;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.project-card__badge--active {
  background: oklch(from var(--color-success) l c h / 0.85);
}

.project-card__badge--dev {
  background: oklch(from var(--color-warning) l c h / 0.85);
}

.project-card__body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.project-card__category {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.project-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.25;
}

.project-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  flex: 1;
  max-width: unset;
}

.project-card__stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ================================================
   ABOUT / OWNER SECTION
   ================================================ */

.about__layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-16);
  align-items: center;
}

.about__photo-wrap {
  position: relative;
}

.about__photo-frame {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.about__photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-border) 62%, transparent);
}

.about__photo-frame img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.about__photo-badge {
  position: absolute;
  bottom: var(--space-6);
  left: var(--space-6);
  right: var(--space-6);
  background: color-mix(in srgb, var(--color-surface-2) 92%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-md);
}

.about__photo-badge-name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.about__photo-badge-role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.about__photo-decor {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--color-primary) 18%, transparent) 0%, transparent 70%);
  border: 1px solid color-mix(in srgb, var(--color-primary) 14%, transparent);
  z-index: -1;
}

.about__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.about__skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.about__skill-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  transition: all var(--transition-interactive);
}

.about__skill-item:hover {
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
  color: var(--color-text);
}

.about__skill-icon {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ================================================
   PROCESS SECTION
   ================================================ */

.process__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  position: relative;
}

.process__steps::before {
  content: '';
  position: absolute;
  top: 32px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--color-primary) 55%, transparent), color-mix(in srgb, var(--color-accent) 45%, transparent));
  z-index: 0;
}

.process__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

.process__step-number {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--color-surface-2);
  border: 1.5px solid color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary-hover);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-md), 0 0 0 8px var(--color-bg);
}

.process__step-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.process__step-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: unset;
}

/* ================================================
   TECHNOLOGIES SECTION
   ================================================ */

.tech__grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.tech__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
}

.tech__item:hover {
  background: color-mix(in srgb, var(--color-surface-2) 92%, white 8%);
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
  color: var(--color-text);
  transform: translateY(-2px);
}

.tech__item svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ================================================
   CTA SECTION
   ================================================ */

.cta-section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
  position: relative;
  overflow: hidden;
}

.cta-section__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 25% 50%, color-mix(in srgb, var(--color-primary) 12%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse 50% 70% at 80% 24%, color-mix(in srgb, var(--color-accent) 12%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface-2) 86%, transparent), var(--color-surface));
  z-index: 0;
}

.cta-section__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
  margin-inline: auto;
}

.cta-section__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.cta-section__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 50ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.cta-section__actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ================================================
   CONTACT SECTION
   ================================================ */

.contact__layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-16);
  align-items: start;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.contact__item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.contact__item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-surface-2) 82%, var(--color-primary-highlight) 18%);
  color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact__item-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.contact__item-value {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
}

.contact__item-value:hover {
  color: var(--color-primary);
}

/* Contact Form */
.contact__form {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form__group:last-of-type {
  margin-bottom: var(--space-6);
}

.form__group--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}

.form__input,
.form__textarea {
  background: color-mix(in srgb, var(--color-surface) 78%, white 22%);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text);
  width: 100%;
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
  font-family: var(--font-body);
}

.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}

.form__input::placeholder,
.form__textarea::placeholder {
  color: var(--color-text-faint);
}

.form__textarea {
  min-height: 140px;
  resize: vertical;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form__status {
  min-height: 1.5rem;
  margin: 0 0 var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.form__status.is-success {
  color: var(--color-success);
}

.form__status.is-error {
  color: var(--color-error);
}

/* ================================================
   AI CHAT
   ================================================ */

.ai-chat {
  position: fixed;
  right: clamp(1rem, 2vw, 1.5rem);
  bottom: clamp(1rem, 2vw, 1.5rem);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
  pointer-events: none;
}

.ai-chat__backdrop {
  display: none;
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(17, 13, 11, 0.4);
  backdrop-filter: blur(2px);
  z-index: 119;
  opacity: 0;
  pointer-events: none;
}

.ai-chat__toggle,
.ai-chat__panel {
  pointer-events: auto;
}

.ai-chat.is-open .ai-chat__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.ai-chat__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.05rem;
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 70%, black));
  color: white;
  box-shadow: 0 18px 34px oklch(from var(--color-primary) l c h / 0.2);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.ai-chat__toggle[hidden] {
  display: none;
}

.ai-chat.is-open .ai-chat__toggle {
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.4rem) scale(0.97);
}

.ai-chat__toggle-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, white 14%, transparent);
}

.ai-chat__panel {
  position: relative;
  z-index: 121;
  width: min(396px, calc(100vw - 2rem));
  max-height: min(84vh, 760px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 26px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 96%, white 4%), color-mix(in srgb, var(--color-surface-offset) 93%, white 7%));
  border: 1px solid color-mix(in srgb, var(--color-border) 82%, white 18%);
  box-shadow: 0 22px 52px rgba(21, 24, 31, 0.14);
  overflow: hidden;
}

.ai-chat__panel[hidden] {
  display: none;
}

.ai-chat__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 74%, white 26%);
}

.ai-chat__eyebrow {
  margin: 0 0 0.25rem;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  font-weight: 700;
}

.ai-chat__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.ai-chat__close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-surface-2) 90%, transparent);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ai-chat__intro {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.ai-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ai-chat__chip {
  border: 1px solid color-mix(in srgb, var(--color-border) 92%, white 8%);
  background: color-mix(in srgb, var(--color-surface-2) 88%, transparent);
  color: var(--color-text);
  border-radius: 999px;
  padding: 0.48rem 0.78rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.ai-chat__messages {
  min-height: 260px;
  max-height: 460px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.2rem 0.2rem 0.2rem 0;
}

.ai-chat__message {
  max-width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}

.ai-chat__message-body {
  max-width: min(82%, 290px);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.ai-chat__avatar {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--color-border) 78%, white 22%);
  background: color-mix(in srgb, white 74%, var(--color-surface-2) 26%);
  color: var(--color-text-muted);
}

.ai-chat__message-role {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}

.ai-chat__bubble {
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  font-size: 0.8rem;
  line-height: 1.45;
  box-shadow: 0 8px 18px rgba(18, 24, 38, 0.05);
  overflow-wrap: anywhere;
}

.ai-chat__bubble p,
.ai-chat__bubble ul {
  margin: 0;
}

.ai-chat__bubble p + p,
.ai-chat__bubble p + ul,
.ai-chat__bubble ul + p {
  margin-top: 0.65rem;
}

.ai-chat__bubble ul {
  padding-left: 1.1rem;
}

.ai-chat__bubble li + li {
  margin-top: 0.3rem;
}

.ai-chat__bubble strong {
  font-weight: 700;
  white-space: pre-wrap;
}

.ai-chat__message--assistant {
  align-self: flex-start;
}

.ai-chat__message--assistant .ai-chat__bubble {
  border-top-left-radius: 10px;
}

.ai-chat__message--assistant .ai-chat__bubble {
  background: linear-gradient(180deg, color-mix(in srgb, white 88%, var(--color-surface-2) 12%), color-mix(in srgb, var(--color-surface-2) 92%, white 8%));
  color: var(--color-text);
  border: 1px solid color-mix(in srgb, var(--color-border) 72%, white 28%);
}

.ai-chat__message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
  align-items: flex-end;
}

.ai-chat__message--user .ai-chat__message-body {
  align-items: flex-end;
}

.ai-chat__message--user .ai-chat__message-role {
  color: color-mix(in srgb, var(--color-primary) 72%, var(--color-text-faint));
}

.ai-chat__message--user .ai-chat__avatar {
  background: color-mix(in srgb, var(--color-primary) 16%, white 84%);
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 24%, white 76%);
}

.ai-chat__message--user .ai-chat__bubble {
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 92%, white 8%), color-mix(in srgb, var(--color-primary) 70%, black 30%));
  color: white;
  border: 0;
  border-top-right-radius: 10px;
  box-shadow: 0 14px 28px oklch(from var(--color-primary) l c h / 0.2);
}

.ai-chat__status {
  min-height: 1.3rem;
  margin: 0;
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

.ai-chat__status.is-success {
  color: var(--color-success);
}

.ai-chat__status.is-error {
  color: var(--color-error);
}

.ai-chat__form {
  display: grid;
  gap: var(--space-3);
}

.ai-chat__textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border-radius: 18px;
  border: 1.5px solid var(--color-border);
  background: color-mix(in srgb, var(--color-surface) 80%, white 20%);
  color: var(--color-text);
  padding: 0.85rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
}

.ai-chat__textarea::placeholder {
  color: color-mix(in srgb, var(--color-text-muted) 72%, transparent);
}

.ai-chat__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.14);
}

.ai-chat__submit {
  width: 100%;
  justify-content: center;
}

[data-theme="dark"] .ai-chat__panel {
  background: linear-gradient(180deg, #241f1b, #1d1916);
  border-color: #5a4f45;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] .ai-chat__header {
  border-bottom-color: #5a4f45;
}

[data-theme="dark"] .ai-chat__title {
  color: #f5ede3;
}

[data-theme="dark"] .ai-chat__intro,
[data-theme="dark"] .ai-chat__status {
  color: #d2c5b7;
}

[data-theme="dark"] .ai-chat__chip,
[data-theme="dark"] .ai-chat__close {
  background: #2b2520;
  border-color: #5a4f45;
  color: #f0e7dc;
}

[data-theme="dark"] .ai-chat__chip:hover,
[data-theme="dark"] .ai-chat__close:hover {
  background: #342d27;
  border-color: #6b5d52;
}

[data-theme="dark"] .ai-chat__avatar {
  background: #312a24;
  border-color: #5a4f45;
  color: #ddcfbf;
}

[data-theme="dark"] .ai-chat__message-role {
  color: #9f9182;
}

[data-theme="dark"] .ai-chat__message--assistant .ai-chat__bubble {
  background: #312a24;
  border-color: #5a4f45;
  color: #f3ece3;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .ai-chat__message--user .ai-chat__avatar {
  background: #cdb894;
  border-color: #d8c4a4;
  color: #2a241f;
}

[data-theme="dark"] .ai-chat__message--user .ai-chat__message-role {
  color: #d5c19f;
}

[data-theme="dark"] .ai-chat__message--user .ai-chat__bubble {
  background: #d7c1a0;
  color: #221c17;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .ai-chat__textarea {
  background: #2b2520;
  border-color: #5a4f45;
  color: #f3ece3;
}

[data-theme="dark"] .ai-chat__textarea::placeholder {
  color: #a99c8f;
}

[data-theme="dark"] .ai-chat__toggle {
  background: linear-gradient(180deg, #d7c1a0 0%, #c9b18f 100%);
  color: #221c17;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .ai-chat__toggle-icon {
  background: rgba(34, 28, 23, 0.12);
}

[data-theme="dark"] .ai-chat__submit {
  background: linear-gradient(180deg, #d7c1a0 0%, #c9b18f 100%);
  color: #221c17;
  box-shadow: none;
}

[data-theme="dark"] .ai-chat__submit:hover {
  background: linear-gradient(180deg, #e3cfb2 0%, #d1bb9a 100%);
}

/* ================================================
   FOOTER
   ================================================ */

.footer {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface) 80%, transparent), color-mix(in srgb, var(--color-surface-offset) 88%, transparent));
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-12);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer__brand-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 32ch;
}

.footer__col-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  letter-spacing: 0.02em;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
}

.footer__links a {
  text-decoration: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive);
}

.footer__links a:hover {
  color: var(--color-primary);
}

.footer__bottom {
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer__legal {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__legal a {
  color: inherit;
  text-decoration: none;
}

.footer__legal a:hover {
  color: var(--color-primary);
}

/* ================================================
   SCROLL ANIMATIONS
   ================================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }

/* ================================================
   DARK MODE TOGGLE
   ================================================ */

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--color-surface-2) 88%, transparent);
  border: 1.5px solid var(--color-border);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-interactive);
  flex-shrink: 0;
  position: relative;
  z-index: 4;
}

.theme-toggle:hover {
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-border));
  background: color-mix(in srgb, var(--color-surface-2) 96%, white 4%);
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 1320px) {
  .nav__inner {
    gap: 0.8rem;
    padding: 0.65rem 0.85rem 0.65rem 1rem;
  }

  .nav__links {
    gap: 0.7rem;
    padding-left: 0;
  }

  .nav__links a {
    font-size: 0.88rem;
  }

  .nav__links li:last-child {
    display: none;
  }

  .nav__actions {
    gap: 0.5rem;
  }

  .nav__cta-desktop {
    padding: 0.78rem 1.1rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 1120px) {
  .nav__inner {
    grid-template-columns: auto 1fr auto;
    min-height: 68px;
    padding: 0.65rem 0.85rem 0.65rem 1rem;
    border-radius: 22px;
  }

  .nav__links {
    display: none;
  }

  .nav__cta-desktop {
    display: none;
  }

  .nav__actions {
    gap: 0.55rem;
    margin-left: auto;
  }

  .nav__hamburger {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1.5px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface-2) 90%, transparent);
  }

  .nav__logo .site-logo {
    height: 38px;
    max-width: 210px;
  }

  .nav__mobile {
    padding: calc(var(--space-20) + 1rem) var(--space-5) var(--space-8);
    justify-content: flex-start;
    align-items: stretch;
    gap: var(--space-3);
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--color-surface-2) 94%, transparent), var(--color-bg));
  }

  .nav__mobile a {
    font-size: 1.15rem;
    font-weight: 600;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: color-mix(in srgb, var(--color-surface-2) 90%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
  }

  .nav__mobile a.btn {
    margin-top: var(--space-3);
    justify-content: center;
  }
}

@media (max-width: 1024px) {
  .nav__inner {
    grid-template-columns: auto 1fr auto;
    gap: 0.95rem;
    padding-inline: 1rem;
  }

  .nav__links {
    gap: 1rem;
    padding-left: 0;
  }

  .nav__logo .site-logo {
    height: 42px;
    max-width: 240px;
  }

  .hero__content {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .hero__visual {
    display: none;
  }

  .about__layout {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .about__photo-frame img {
    height: 380px;
  }

  .contact__layout {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }

  .process__steps {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .process__steps::before {
    display: none;
  }

  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav {
    padding-block: 0.8rem;
  }

  .nav__inner {
    grid-template-columns: auto 1fr auto;
    min-height: 68px;
    padding: 0.65rem 0.85rem 0.65rem 1rem;
    border-radius: 22px;
  }

  .nav__links {
    display: none;
  }

  .nav__cta-desktop {
    display: none;
  }

  .nav__actions {
    gap: 0.55rem;
  }

  .nav__hamburger {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1.5px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface-2) 90%, transparent);
  }

  .nav__logo .site-logo {
    height: 38px;
    max-width: 210px;
  }

  .nav__mobile {
    padding: calc(var(--space-20) + 1rem) var(--space-5) var(--space-8);
    justify-content: flex-start;
    align-items: stretch;
    gap: var(--space-3);
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--color-surface-2) 94%, transparent), var(--color-bg));
  }

  .nav__mobile a {
    font-size: 1.15rem;
    font-weight: 600;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: color-mix(in srgb, var(--color-surface-2) 90%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
  }

  .nav__mobile a.btn {
    margin-top: var(--space-3);
    justify-content: center;
  }

  .hero {
    min-height: auto;
    padding-top: 108px;
  }

  .hero__content {
    gap: var(--space-8);
    padding-block: var(--space-10) var(--space-12);
  }

  .hero__badge {
    margin-bottom: var(--space-4);
  }

  .hero__heading {
    font-size: clamp(2.4rem, 10vw, 3.4rem);
    line-height: 1.02;
    margin-bottom: var(--space-4);
  }

  .hero__description {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: var(--space-6);
  }

  .hero__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    align-items: start;
  }

  .hero__actions {
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
  }

  .hero__actions .btn {
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  .hero__stat {
    min-width: 0;
    padding-top: var(--space-3);
    gap: 0.2rem;
  }

  .hero__stat:last-child {
    grid-column: 1 / -1;
  }

  .hero__stat-number {
    font-size: 1.3rem;
  }

  .hero__stat-label {
    line-height: 1.45;
  }

  .section {
    padding-block: clamp(var(--space-12), 11vw, var(--space-16));
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: var(--space-8);
  }

  .services__grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .projects__grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .service-card,
  .project-card__body,
  .contact__form {
    padding: var(--space-5);
  }

  .project-card--placeholder {
    min-height: 260px;
    padding: var(--space-6);
  }

  .service-card__desc,
  .project-card__desc,
  .process__step-desc,
  .footer__brand-desc {
    font-size: 0.97rem;
    line-height: 1.6;
  }

  .project-card__visual {
    height: 172px;
  }

  .about__layout {
    gap: var(--space-8);
  }

  .about__photo-frame img {
    height: 320px;
  }

  .about__photo-badge {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
  }

  .about__skills {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .process__steps {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .process__step {
    align-items: flex-start;
    text-align: left;
    padding-left: 0.25rem;
  }

  .process__step-number {
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-4);
  }

  .tech__grid {
    gap: var(--space-2);
  }

  .tech__item {
    width: 100%;
    justify-content: flex-start;
    padding: 0.9rem 1rem;
  }

  .cta-section__actions {
    flex-direction: column;
  }

  .cta-section__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .form__row {
    grid-template-columns: 1fr;
  }

  .contact__layout {
    gap: var(--space-8);
  }

  .ai-chat {
    right: 0;
    bottom: 0;
    left: auto;
    top: auto;
    align-items: flex-end;
    gap: 0;
  }

  .ai-chat__backdrop {
    display: block;
  }

  .ai-chat__toggle {
    position: fixed;
    right: 0.85rem;
    bottom: 0.85rem;
    z-index: 122;
    justify-content: center;
    width: auto;
    max-width: min(180px, calc(100vw - 2.25rem));
    padding: 0.62rem 0.82rem;
    font-size: 0.84rem;
    box-shadow: 0 12px 24px rgba(16, 22, 36, 0.2);
  }

  .ai-chat__toggle-icon {
    width: 1.58rem;
    height: 1.58rem;
  }

  .ai-chat__panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    gap: 0.68rem;
    padding:
      calc(env(safe-area-inset-top, 0px) + 0.72rem)
      calc(env(safe-area-inset-right, 0px) + 0.72rem)
      calc(env(safe-area-inset-bottom, 0px) + 0.72rem)
      calc(env(safe-area-inset-left, 0px) + 0.72rem);
    border-radius: 0;
    border-inline: 0;
    border-bottom: 0;
  }

  .ai-chat__intro {
    font-size: 0.78rem;
  }

  .ai-chat__suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .ai-chat__suggestions::-webkit-scrollbar {
    display: none;
  }

  .ai-chat__chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ai-chat__messages {
    min-height: 0;
    max-height: none;
    gap: 0.6rem;
  }

  .ai-chat__message {
    gap: 0.42rem;
  }

  .ai-chat__avatar {
    display: none;
  }

  .ai-chat__message-body {
    max-width: 100%;
  }

  .ai-chat__bubble {
    font-size: 0.76rem;
    line-height: 1.38;
    padding: 0.68rem 0.76rem;
    box-shadow: none;
  }

  .ai-chat__message--assistant .ai-chat__bubble {
    border-width: 1px;
  }

  .ai-chat__message--user .ai-chat__bubble {
    border: 0;
    box-shadow: none;
  }

  .ai-chat__textarea {
    min-height: 64px;
    max-height: 140px;
    font-size: 16px;
    line-height: 1.42;
    border-radius: 14px;
  }

  .ai-chat__submit {
    min-height: 42px;
    font-size: 0.84rem;
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding-inline: 1rem;
  }

  .nav {
    padding-block: 0.7rem;
  }

  .nav__inner {
    min-height: 64px;
    padding: 0.55rem 0.7rem 0.55rem 0.85rem;
    border-radius: 20px;
  }

  .nav__logo .site-logo {
    height: 34px;
    max-width: 185px;
  }

  .theme-toggle,
  .nav__hamburger {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .hero__heading {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero__stats {
    grid-template-columns: 1fr;
  }

  .hero__stat:last-child {
    grid-column: auto;
  }

  .service-card,
  .project-card__body,
  .contact__form {
    padding: var(--space-4);
  }

  .project-card__visual {
    height: 156px;
  }

  .project-card--placeholder {
    min-height: 220px;
    padding: var(--space-5);
  }

  .about__photo-frame img {
    height: 280px;
  }

  .ai-chat__panel {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    padding:
      calc(env(safe-area-inset-top, 0px) + 0.6rem)
      calc(env(safe-area-inset-right, 0px) + 0.6rem)
      calc(env(safe-area-inset-bottom, 0px) + 0.6rem)
      calc(env(safe-area-inset-left, 0px) + 0.6rem);
    border-radius: 0;
  }

  .ai-chat__toggle {
    right: 0.65rem;
    bottom: 0.65rem;
    max-width: min(165px, calc(100vw - 1.8rem));
    padding: 0.55rem 0.75rem;
    font-size: 0.79rem;
  }

  .ai-chat__toggle-icon {
    width: 1.42rem;
    height: 1.42rem;
  }

  .ai-chat__messages {
    min-height: 0;
  }

  .ai-chat__message-body {
    max-width: 100%;
  }

  .ai-chat__bubble {
    font-size: 0.74rem;
    line-height: 1.4;
    padding: 0.62rem 0.7rem;
    box-shadow: none;
  }

  .ai-chat__message--user .ai-chat__bubble {
    border: 0;
    box-shadow: none;
  }

  .ai-chat__intro {
    display: none;
  }

  .ai-chat__header {
    padding-bottom: 0.55rem;
  }

  .ai-chat__close {
    width: 34px;
    height: 34px;
  }

  .ai-chat__textarea {
    min-height: 56px;
    max-height: 120px;
    font-size: 16px;
  }
}
