/* ========================================
   Xonatec - Minimal
   ======================================== */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

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

:root {
  color-scheme: dark light;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: 0.3s ease;
}

[data-theme="dark"] {
  --bg: #09090b;
  --fg: #e4e4e7;
  --muted: #71717a;
  --line: #1a1a1f;
  --accent: #fafafa;
  --btn-bg: #fafafa;
  --btn-fg: #09090b;
  --glow-1: rgba(0, 180, 120, 0.07);
  --glow-2: rgba(40, 200, 140, 0.04);
  --highlight: #9caf88;
  --error: #c0392b;
}

[data-theme="light"] {
  --bg: #fafafa;
  --fg: #18181b;
  --muted: #a1a1aa;
  --line: #e4e4e7;
  --accent: #09090b;
  --btn-bg: #09090b;
  --btn-fg: #fafafa;
  --glow-1: rgba(0, 160, 100, 0.12);
  --glow-2: rgba(40, 180, 120, 0.08);
  --highlight: #6b7f5a;
  --error: #c0392b;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}



body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  z-index: 0;
  isolation: isolate;
}

/* Smooth theme transition on all elements */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 0.5s ease,
              color 0.5s ease,
              border-color 0.5s ease,
              box-shadow 0.5s ease,
              fill 0.5s ease,
              stroke 0.5s ease !important;
}

/* Paper grain texture — light mode only */
[data-theme="light"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
  mix-blend-mode: multiply;
}

a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ========================================
   NAV
   ======================================== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}

.nav-logo {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

nav.scrolled .nav-logo {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.nav-logo svg { height: 16px; width: auto; color: var(--accent); }

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

.theme-btn,
.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  transition: color var(--ease), border-color var(--ease);
}

.theme-btn:hover,
.contact-btn:hover {
  color: var(--fg);
  border-color: var(--muted);
}

.theme-btn svg,
.contact-btn svg { width: 15px; height: 15px; }

.icon-sun, .icon-moon, .icon-system { display: none; }

/* Show icon for current mode */
[data-theme-mode="dark"] .icon-moon { display: block; }
[data-theme-mode="light"] .icon-sun { display: block; }
[data-theme-mode="system"] .icon-system { display: block; }

/* Theme button tooltip */
.theme-btn {
  position: relative;
}

.theme-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.theme-btn:hover::after {
  opacity: 1;
}

/* ========================================
   FLOATING GRADIENT BLOBS (full page)
   ======================================== */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0;
  animation: blob-fade-in 2s ease forwards;
  will-change: transform;
}

.bg-blob-1 {
  width: 500px; height: 500px;
  top: 8%; left: -5%;
  background: var(--glow-1);
  animation: blob-drift-1 25s ease-in-out infinite, blob-fade-in 2s ease forwards;
}

.bg-blob-2 {
  width: 380px; height: 380px;
  top: 35%; right: -8%;
  background: var(--glow-2);
  animation: blob-drift-2 30s ease-in-out infinite, blob-fade-in 2s ease 0.3s forwards;
}

.bg-blob-3 {
  width: 420px; height: 420px;
  top: 60%; left: 15%;
  background: var(--glow-1);
  animation: blob-drift-3 28s ease-in-out infinite, blob-fade-in 2s ease 0.6s forwards;
}

.bg-blob-4 {
  width: 320px; height: 320px;
  top: 80%; right: 10%;
  background: var(--glow-2);
  animation: blob-drift-4 22s ease-in-out infinite, blob-fade-in 2s ease 0.9s forwards;
}

.bg-blob-5 {
  width: 300px; height: 300px;
  top: 45%; left: 50%;
  background: var(--glow-1);
  animation: blob-drift-5 32s ease-in-out infinite, blob-fade-in 2s ease 1.2s forwards;
}

@keyframes blob-fade-in {
  to { opacity: 1; }
}

@keyframes blob-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(60px, 40px) scale(1.05); }
  50% { transform: translate(20px, 80px) scale(0.95); }
  75% { transform: translate(-30px, 30px) scale(1.02); }
}

@keyframes blob-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-50px, 60px) scale(0.97); }
  50% { transform: translate(-80px, 20px) scale(1.04); }
  75% { transform: translate(-20px, -30px) scale(0.98); }
}

@keyframes blob-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -50px) scale(1.03); }
  50% { transform: translate(-30px, -20px) scale(0.96); }
  75% { transform: translate(50px, 30px) scale(1.01); }
}

@keyframes blob-drift-4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-40px, -30px) scale(1.06); }
  50% { transform: translate(30px, -60px) scale(0.94); }
  75% { transform: translate(60px, 20px) scale(1.02); }
}

@keyframes blob-drift-5 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-60px, 40px) scale(0.98); }
  50% { transform: translate(40px, 60px) scale(1.05); }
  75% { transform: translate(30px, -40px) scale(0.97); }
}

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 32px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  transition: background var(--ease);
}

.hero-glow-1 {
  width: 500px; height: 500px;
  top: 20%; left: 50%;
  transform: translateX(-70%);
  background: var(--glow-1);
}

.hero-glow-2 {
  width: 400px; height: 400px;
  top: 30%; left: 50%;
  transform: translateX(20%);
  background: var(--glow-2);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero-logo {
  margin-bottom: 36px;
  will-change: transform, opacity;
}
.hero-logo svg {
  height: 68px;
  width: auto;
  margin: 0 auto;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero .amp {
  color: var(--highlight);
  font-weight: 300;
  font-style: italic;
}

.hero p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 480px;
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.4s ease;
}

.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scroll-down 2s ease-in-out infinite;
}

@keyframes scroll-down {
  0% { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
  30% { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
  70% { opacity: 1; transform: scaleY(1); transform-origin: top; }
  100% { opacity: 0; transform: scaleY(0); transform-origin: top; }
}

.hero-divider {
  height: 1px;
  max-width: 1080px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--highlight), transparent);
  opacity: 0.25;
}

/* ========================================
   ANIMATIONS
   ======================================== */
.anim {
  opacity: 0;
  transform: translateY(16px);
  animation: enter 0.7s ease forwards;
}
.anim-d1 { animation-delay: 0.15s; }
.anim-d2 { animation-delay: 0.3s; }
.anim-d3 { animation-delay: 0.45s; }
.anim-d4 { animation-delay: 0.7s; }

@keyframes enter {
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity var(--ease), transform var(--ease);
}
.btn:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--highlight);
  background: transparent;
  border: 1px solid var(--highlight);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.4s ease;
  opacity: 0.7;
}
.btn-ghost:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--highlight) 8%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--highlight) 10%, transparent);
}

/* ========================================
   QUOTE
   ======================================== */
.quote {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 48px;
  text-align: center;
}

.quote blockquote {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.7;
  font-style: italic;
  max-width: 640px;
  margin: 0 auto;
  letter-spacing: -0.01em;
}

/* ========================================
   SECTION SPLIT (Sticky Label + Content)
   ======================================== */
.section-split {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 48px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
}

.section-label {
  position: sticky;
  top: 80px;
  align-self: start;
}

.section-label h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-label p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ========================================
   SERVICES
   ======================================== */
.service {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.service:first-child { padding-top: 0; }
.service:last-child { border-bottom: none; }

.service-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font);
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: inherit;
}

.service-head h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
  transition: color var(--ease);
}
.service:hover .service-head h3 { color: var(--highlight); }

.chevron {
  width: 15px; height: 15px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.3s ease, color var(--ease);
}

.service-head[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}
.service:hover .chevron { color: var(--highlight); }

.service > p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.75;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  transition: color var(--ease);
}
.service:hover > p { color: var(--fg); }

.service-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.service-details.open { opacity: 1; }

.service-details ul {
  list-style: none;
  padding: 10px 0 4px 0;
}

.service-details li {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 4px 0 4px 16px;
  position: relative;
  transition: color var(--ease);
}
.service:hover .service-details li { color: var(--fg); }

.service-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--highlight);
  transform: translateY(-50%);
}

/* ========================================
   ABOUT ITEMS
   ======================================== */
.about-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.about-item:first-child { padding-top: 0; }
.about-item:last-child { border-bottom: none; }

.about-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  transition: color var(--ease);
}
.about-item:hover h3 { color: var(--highlight); }

.about-item p {
  font-size: 0.85rem;
  color: var(--fg);
  line-height: 1.85;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.about-note {
  margin-top: 16px;
  padding-top: 16px;
}

.about-note h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.about-note p {
  font-size: 0.8rem;
  color: var(--fg);
  line-height: 1.7;
  opacity: 0.8;
}

/* ========================================
   PROJECTS
   ======================================== */
.projects {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 48px;
}

.projects-header {
  margin-bottom: 40px;
}

.projects-header h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-bottom: 8px;
}

.projects-header p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

.projects-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px;
  margin: -12px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .project-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
  margin-bottom: 12px;
}

.project-card h3 + p {
  margin-top: 4px;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.03);
}

.project-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  transition: color var(--ease);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-card:hover h3 {
  color: var(--highlight);
}

.project-card-soon {
  pointer-events: none;
  cursor: default;
  position: relative;
  opacity: 0.65;
}

.project-card-soon .project-image {
  position: relative;
  overflow: hidden;
}

.project-card-soon .project-image::after {
  content: 'In Entwicklung';
  position: absolute;
  top: 32px;
  right: -50px;
  width: 200px;
  background: var(--error);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 6px 0;
  transform: rotate(45deg);
  z-index: 1;
  text-align: center;
  text-indent: 10px;
  line-height: 1;
}

.project-card p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.project-phase-link {
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.3s ease;
}
.project-phase-link:hover {
  opacity: 1;
}

.project-phase {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--highlight);
  border: 1px solid var(--highlight);
  border-radius: 3px;
  padding: 2px 6px;
  opacity: 0.6;
  white-space: nowrap;
}

/* ========================================
   SECTION DIVIDER
   ======================================== */
.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--muted), transparent);
  opacity: 0.15;
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   CONTACT
   ======================================== */
.contact {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 48px 120px;
}

/* Backdrop overlay for expanded contact card */
.contact-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.contact-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.contact-card {
  position: relative;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 56px 56px 48px;
  background: color-mix(in srgb, var(--fg) 3%, var(--bg));
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.04);
}

.contact-card.expanded {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 92vw;
  max-width: 1080px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: visible;
  padding: 64px 64px 56px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 32px 80px rgba(0, 0, 0, 0.12);
}

/* Placeholder to preserve layout space when card is expanded */
.contact-card-placeholder {
  visibility: hidden;
}

.contact-card-close {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color var(--ease), background var(--ease);
  z-index: 1;
}

.contact-card-close:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.contact-card-close svg {
  width: 100%;
  height: 100%;
}

.contact-card.expanded .contact-card-close {
  display: block;
}

[data-theme="dark"] .contact-card {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 16px 48px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .contact-card.expanded {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 32px 80px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.contact-header {
  margin-bottom: 40px;
}

.contact-header h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 10px;
}

.contact-header p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 600px;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.contact-fields {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0 32px;
  align-items: stretch;
}

.contact-fields textarea,
.contact-fields > .contact-fields-right > input {
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--fg);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  outline: none;
  transition: border-color 0.4s ease;
  resize: none;
  letter-spacing: -0.01em;
  width: 100%;
}

.textarea-wrap {
  position: relative;
  min-height: 100%;
}

.textarea-wrap textarea {
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.char-count {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 11px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.char-count.visible {
  opacity: 1;
}

.char-count.warn {
  color: #e5a00d;
}

.contact-fields textarea {
  line-height: 1.6;
}

.contact-fields-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.contact-fields input::placeholder,
.contact-fields textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.contact-fields > .contact-fields-right > input:focus,
.contact-fields textarea:focus {
  border-color: var(--highlight);
  outline: none;
}

/* Phone field with country picker */
.phone-field {
  display: flex;
  align-items: stretch;
  border: 1px dashed var(--line);
  border-radius: 8px;
  transition: border-color 0.4s ease;
}

.phone-field.focused {
  border-color: var(--highlight);
}

.phone-prefix-wrap {
  position: relative;
  flex-shrink: 0;
}

.phone-prefix-trigger {
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--fg);
  background: transparent;
  border: none;
  border-right: 1px dashed var(--line);
  padding: 16px 14px 16px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease;
  height: 100%;
}

.phone-prefix-trigger:hover {
  color: var(--highlight);
}

.phone-prefix-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: -1px;
  width: 260px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  z-index: 100;
  overflow: hidden;
}

.phone-prefix-dropdown.open {
  display: flex;
  flex-direction: column;
}

.phone-prefix-search,
.phone-prefix-search:focus {
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--fg);
  background: transparent;
  border: none !important;
  border-bottom: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 12px 14px;
}

.phone-prefix-search::placeholder {
  color: var(--muted);
}

.phone-prefix-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.phone-prefix-item {
  font-family: var(--font);
  font-size: 0.8rem;
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.15s ease;
}

.phone-prefix-item:hover,
.phone-prefix-item.highlighted {
  background: color-mix(in srgb, var(--highlight) 12%, transparent);
}

.phone-prefix-item.active {
  color: var(--highlight);
}

.phone-prefix-separator {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.phone-prefix-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-prefix-item-dial {
  color: var(--muted);
  flex-shrink: 0;
}

.phone-field input[type="tel"] {
  flex: 1;
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--fg);
  background: transparent;
  border: none;
  padding: 16px 18px;
  outline: none;
  letter-spacing: -0.01em;
  min-width: 0;
}

.phone-field input[type="tel"]::placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* Turnstile challenge (only visible when needed) */
.cf-turnstile {
  display: flex;
  justify-content: flex-start;
  margin-top: 24px;
}

.cf-turnstile iframe {
  border-radius: 10px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  animation: turnstile-in 0.4s ease;
}

@keyframes turnstile-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  gap: 16px;
}

.form-footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.form-status {
  font-size: 0.82rem;
  font-weight: 400;
  min-height: 1.2em;
}

.form-status-success {
  color: var(--highlight);
}

.form-status-error {
  color: var(--error);
}

#contact-submit:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

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

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  transition: color var(--ease);
}
.email-link::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  transition: background var(--ease);
}
.email-link:hover { color: var(--highlight); }
.email-link:hover::before { background: var(--highlight); }

/* ========================================
   FOOTER
   ======================================== */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 48px;
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-logo {
  height: 20px;
  color: var(--line);
}

.footer-credit {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.6;
}

.footer-credit a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-credit a:hover {
  color: var(--fg);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
  .section-split {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 64px 32px;
  }
  .section-label {
    position: static;
  }
  .quote { padding: 64px 32px; }
  .projects { padding: 64px 32px; }
  .projects-track { grid-template-columns: repeat(2, 1fr); }
  .contact { padding: 48px 32px 80px; }
  .contact-card { padding: 40px 40px 36px; }
  .contact-fields { grid-template-columns: 1fr; }
  footer { padding: 24px 32px; }
}

@media (max-width: 600px) {
  nav { padding: 0 20px; }
  .hero {
    padding: 80px 20px 60px;
    min-height: 100svh;
  }
  .hero-glow-1 {
    width: 350px; height: 350px;
    top: 10%; left: 30%;
    transform: translateX(-50%);
  }
  .hero-glow-2 {
    width: 280px; height: 280px;
    top: 25%; left: 60%;
    transform: translateX(-30%);
  }
  .hero-logo {
    margin-bottom: 28px;
    position: relative;
  }
  .hero-logo::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, var(--highlight), transparent);
    margin: 16px auto 0;
    border-radius: 1px;
    opacity: 0.6;
  }
  .hero-logo svg {
    height: 56px;
    filter: drop-shadow(0 0 40px var(--glow-1));
  }
  .hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 16px;
  }
  .hero p {
    font-size: 0.92rem;
    margin-bottom: 32px;
  }
  .hero-actions { flex-direction: column; align-items: center; gap: 10px; margin-top: 12px; }
  .hero-actions .btn { display: none; }
  .hero-actions .btn-ghost { width: auto; text-align: center; }
  .quote { padding: 48px 20px; }
  .section-split { padding: 48px 20px; }
  .projects { padding: 48px 20px; }
  .projects-track { grid-template-columns: 1fr; gap: 48px; }
  .service:hover > p { color: var(--muted); }
  .service:hover .service-head h3 { color: var(--accent); }
  .service:hover .service-details li { color: var(--muted); }
  .about-item:hover h3 { color: var(--accent); }
  .contact { padding: 32px 20px 64px; }
  .contact-card { padding: 32px 24px 28px; border-radius: 12px; }
  .contact-fields { grid-template-columns: 1fr; gap: 16px 0; }
  .textarea-wrap textarea { min-height: 160px; }
  /* Prevent iOS auto-zoom on input focus (requires >= 16px) */
  .contact-fields textarea,
  .contact-fields input,
  .phone-field input[type="tel"],
  .phone-prefix-search { font-size: 16px !important; }
  .cf-turnstile { margin-top: 20px; }
  .form-footer { flex-direction: column; align-items: stretch; gap: 20px; padding-top: 24px; }
  .form-footer-left { align-items: stretch; }
  .form-footer-left .btn { width: 100%; text-align: center; }
  .form-footer .email-link { justify-content: center; }
  footer { padding: 20px; flex-direction: column; gap: 4px; }
  .scroll-hint { bottom: 24px; }
}

/* ========================================
   FOCUS & ACCESSIBILITY
   ======================================== */
:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

::selection {
  background: var(--highlight);
  color: #fff;
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .scroll-hint { display: none; }
  .bg-blob { display: none; }
}
