/* -------------------------------------------------------
   THEME VARIABLES
------------------------------------------------------- */
:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --card-shadow: rgba(2,6,23,0.06);
  --text: #071022;
  --muted: #475569;
  --accent: #0ea5b7;
  --accent-contrast: #021022;
  --maxw: 1100px;
  --radius: 10px;
  --gap: 18px;
  --glass: rgba(255,255,255,0.6);
  --transition-fast: 180ms ease;
  --header-height: 72px;

  --surface-1: var(--panel);
  --surface-2: rgba(2,6,23,0.02);
  --border: rgba(2,6,23,0.06);
  --input-bg: rgba(0,0,0,0.02);
}

:root.dark {
  --bg: linear-gradient(180deg,#071025 0%, #0f1724 100%);
  --panel: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  --card-shadow: rgba(2,6,23,0.6);
  --text: #e6eef6;
  --muted: #94a3b8;
  --accent: #06b6d4;
  --accent-contrast: #021022;
  --glass: rgba(255,255,255,0.02);

  --surface-1: var(--panel);
  --surface-2: rgba(255,255,255,0.02);
  --border: rgba(255,255,255,0.06);
  --input-bg: rgba(255,255,255,0.02);
}

/* -------------------------------------------------------
   BASE
------------------------------------------------------- */
* {
  box-sizing: border-box;
  transition: color var(--transition-fast),
              background-color var(--transition-fast),
              border-color var(--transition-fast);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--header-height) + 80px) 28px 28px;
}

/* -------------------------------------------------------
   FIXED HEADER
------------------------------------------------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px var(--card-shadow);
  z-index: 1000;
  overflow: visible;
}

/* Dark mode solid header */
:root.dark header {
  background-color: #0f1724 !important;
}

/* -------------------------------------------------------
   BRAND BLOCK
------------------------------------------------------- */
header .brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

header .brand > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

header h1 {
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

header .muted {
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

/* Photo */
header .photo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--glass);
  flex-shrink: 0;
}

header .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -------------------------------------------------------
   NAVIGATION (THIRD LINE)
------------------------------------------------------- */
header nav {
  position: absolute;
  bottom: -40px;
  left: 0;
  width: 100%;
  padding: 8px 28px;
  display: flex;
  gap: 14px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 12px var(--card-shadow);
  height: 40px;
  line-height: 40px;
  overflow: hidden;
}

/* Dark mode solid nav */
:root.dark header nav {
  background-color: #0f1724 !important;
}

.nav-links {
  display: flex;
  gap: 14px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0 8px;
  line-height: normal;
  white-space: nowrap;
}

.nav-links a:hover {
  background: var(--surface-2);
}

/* Theme toggle */
header .theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.theme-toggle .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
}

/* -------------------------------------------------------
   SCROLL OFFSET FOR ANCHORS
------------------------------------------------------- */
#services,
#cases,
#about,
#contact {
  scroll-margin-top: 120px;
}

/* -------------------------------------------------------
   HERO
------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  margin-top: 20px;
  align-items: stretch;
}

.card {
  background: var(--surface-1);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 6px 18px var(--card-shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.lead {
  font-size: 20px;
  margin: 0 0 12px 0;
}

.sub {
  color: var(--muted);
  margin: 0 0 18px 0;
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
}

/* -------------------------------------------------------
   SERVICES & CASES
------------------------------------------------------- */
.services {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  margin-top: 18px;
}

.service {
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-2);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.case {
  padding: 16px;
  border-radius: 10px;
  background: var(--surface-2);
}

/* -------------------------------------------------------
   ABOUT & CONTACT
------------------------------------------------------- */
.about,
.contact {
  margin-top: 18px;
}

.card-body {
  flex: 1;
}

/* -------------------------------------------------------
   CONTACT FORM
------------------------------------------------------- */
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  margin-top: 8px;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(0,0,0,0.35);
}

:root.dark .contact-form input::placeholder,
:root.dark .contact-form textarea::placeholder {
  color: rgba(255,255,255,0.25);
}

.contact-form button {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
}

/* reCAPTCHA wrapper */
.recaptcha-wrap {
  background: var(--surface-2);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: inline-block;
}

.recaptcha-wrap iframe {
  display: block;
  border-radius: 6px;
}

/* Honeypot */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* -------------------------------------------------------
   FOOTER
------------------------------------------------------- */
footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.skill {
  background: var(--surface-2);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* -------------------------------------------------------
   RESPONSIVE
------------------------------------------------------- */
@media (max-width:900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .services {
    grid-template-columns: 1fr 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:520px) {
  header {
    padding: 0 14px;
  }
  header nav {
    padding: 8px 14px;
  }
  .services {
    grid-template-columns: 1fr;
  }
}