/* =========================================================
   Code Doxie — styles.css
   Dark, calm, technical. Mobile-first.
   ========================================================= */

:root {
  /* Surfaces — cool near-black */
  --bg:        #0A0D12;
  --bg-alt:    #0C1017;
  --surface:   #11161E;
  --surface-2: #151B25;
  --border:    #1E2632;
  --border-2:  #283242;

  /* Text */
  --text:      #E7ECF2;
  --text-soft: #AEB9C7;
  --text-dim:  #6B7888;

  /* Accents — same L/C, varied hue */
  --accent:    oklch(0.82 0.12 188);  /* teal */
  --accent-2:  oklch(0.82 0.12 255);  /* blue, graphics only */
  --accent-ink: #06201E;

  /* Type */
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1140px;
  --gutter: clamp(20px, 5vw, 40px);
  --radius: 14px;

  --shadow: 0 20px 50px -24px rgba(0,0,0,0.7);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

::selection { background: oklch(0.82 0.12 188 / 0.3); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; z-index: 200;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Type helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 18px;
}
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; color: #F4F7FA; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.7rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.18rem; letter-spacing: -0.01em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  padding: 13px 22px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 30px -12px oklch(0.82 0.12 188 / 0.6);
}
.btn-primary:hover { transform: translateY(-2px); background: oklch(0.86 0.12 188); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border-2);
}
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.btn-ghost .arrow { transition: transform 0.2s ease; }
.btn-ghost:hover .arrow { transform: translateX(4px); }

/* ===================== HEADER ===================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: oklch(0.16 0.012 250 / 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: oklch(0.13 0.012 250 / 0.82);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.nav-right { display: flex; align-items: center; gap: 16px; }

/* Language switcher */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); }
.lang-switch button { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.04em; padding: 5px 9px; border: 0; border-radius: 999px; background: transparent; color: var(--text-dim); cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--accent); color: var(--accent-ink); font-weight: 500; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; flex-shrink: 0; }
.brand-logo { height: 32px; width: auto; display: block; flex-shrink: 0; }
.brand-name { color: #F4F7FA; white-space: nowrap; }

.nav-links { display: flex; gap: 30px; }
.nav-links a { color: var(--text-soft); font-size: 0.96rem; position: relative; padding: 4px 0; transition: color 0.2s ease; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1.5px; background: var(--accent); transition: width 0.25s ease; }
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { display: none; flex-direction: column; gap: 4px; padding: 8px var(--gutter) 24px; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.mobile-menu a { padding: 14px 4px; color: var(--text-soft); border-bottom: 1px solid var(--border); font-size: 1.05rem; }
.mobile-menu a.btn { margin-top: 14px; justify-content: center; border-bottom: 0; color: var(--accent-ink); }

/* ===================== HERO ===================== */
.hero { position: relative; min-height: clamp(540px, 84vh, 800px); display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: #07090d url("assets/hero-doxie.jpg") no-repeat; background-size: 118% auto; background-position: 38% 26%; }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, #0A0D12 0%, rgba(10,13,18,0) 17%),
    linear-gradient(90deg, rgba(8,11,16,0.97) 0%, rgba(8,11,16,0.9) 34%, rgba(8,11,16,0.55) 60%, rgba(8,11,16,0.18) 100%),
    linear-gradient(0deg, rgba(8,11,16,0.5) 0%, rgba(8,11,16,0) 46%);
}
.hero-inner { position: relative; padding-block: clamp(64px, 10vw, 120px); }
.hero-copy { max-width: 600px; }
.hero-copy h1 { margin-bottom: 22px; max-width: 16ch; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--text-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.hero-meta { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 30px 44px; margin-top: 46px; padding-top: 32px; border-top: 1px solid var(--border); }
.hero-meta li { display: flex; flex-direction: column; gap: 3px; }
.hero-meta strong { font-family: var(--font-display); font-size: 1.35rem; color: #F4F7FA; letter-spacing: -0.01em; }
.hero-meta span { font-size: 0.85rem; color: var(--text-dim); }

@keyframes ping { 0% { box-shadow: 0 0 0 0 oklch(0.82 0.12 188 / 0.5); } 70%, 100% { box-shadow: 0 0 0 9px oklch(0.82 0.12 188 / 0); } }

/* ===================== SECTIONS ===================== */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 620px; margin-bottom: clamp(40px, 5vw, 60px); }
.section-head h2 { margin-bottom: 16px; }
.section-lede { color: var(--text-soft); font-size: 1.08rem; }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  position: relative; padding: 30px 28px 32px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-2); background: var(--surface-2); }
.card-num { display: block; color: var(--accent); font-size: 0.85rem; margin-bottom: 16px; letter-spacing: 0.05em; }
.card h3 { margin-bottom: 10px; color: #F4F7FA; }
.card p { color: var(--text-soft); font-size: 0.97rem; }

/* Experience */
.exp-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(40px, 6vw, 72px); align-items: center; }
.exp-copy .section-lede { margin-bottom: 36px; }
.exp-points { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 32px; }
.exp-points li { position: relative; padding-left: 18px; }
.exp-points li::before { content: ""; position: absolute; left: 0; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.exp-points h3 { margin-bottom: 7px; font-size: 1.05rem; }
.exp-points p { color: var(--text-soft); font-size: 0.94rem; }

.pipeline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 26px 14px; box-shadow: var(--shadow); }
.pipeline-title { color: var(--text-dim); font-size: 0.82rem; margin-bottom: 18px; }
.pipeline-steps { list-style: none; padding: 0; counter-reset: step; }
.pipeline-steps li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); position: relative; }
.pipeline-steps li:last-child { border-bottom: 0; }
.step-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--border-2); flex-shrink: 0; position: relative; }
.pipeline-steps li:not(:last-child) .step-dot::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); width: 2px; height: 28px; background: var(--border); }
.pipeline-steps li.done .step-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 10px oklch(0.82 0.12 188 / 0.6); }
.step-label { flex: 1; color: var(--text); font-size: 0.98rem; }
.step-tag { color: var(--text-dim); font-size: 0.78rem; }
.pipeline-steps li.done .step-label { color: #fff; font-weight: 500; }

/* Optimization & analytics */
.opt-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(40px, 6vw, 72px); align-items: center; }
.opt-copy .section-lede { margin-bottom: 32px; }
.opt-points { list-style: none; padding: 0; display: grid; gap: 22px; }
.opt-points li { position: relative; padding-left: 18px; }
.opt-points li::before { content: ""; position: absolute; left: 0; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.opt-points h3 { margin-bottom: 6px; font-size: 1.05rem; }
.opt-points p { color: var(--text-soft); font-size: 0.94rem; }

.dash { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 18px; box-shadow: var(--shadow); }
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dash-head .mono { color: var(--text-dim); font-size: 0.82rem; }
.dash-live { display: inline-flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 0.74rem; }
.dash-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 oklch(0.82 0.12 188 / 0.5); animation: ping 2.4s ease-out infinite; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .area { fill: url(#chartArea); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .end-dot { fill: var(--accent); filter: drop-shadow(0 0 6px oklch(0.82 0.12 188 / 0.9)); }
.dash-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.tile { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt); }
.tile-label { font-size: 0.82rem; color: var(--text-soft); }
.tile-trend { font-family: var(--font-mono); font-size: 1.05rem; line-height: 1; color: var(--accent); }

/* Working style */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 48px; }
.principle { position: relative; padding-top: 22px; border-top: 1px solid var(--border); }
.principle-mark { color: var(--accent); font-size: 0.82rem; letter-spacing: 0.04em; }
.principle h3 { margin: 12px 0 8px; }
.principle p { color: var(--text-soft); font-size: 0.98rem; max-width: 42ch; }

/* Contact */
.contact { position: relative; text-align: center; overflow: hidden; }
.contact-glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, oklch(0.82 0.12 188 / 0.12), transparent 55%); pointer-events: none; }
.contact-inner { position: relative; max-width: 660px; }
.contact-inner .eyebrow { display: inline-block; }
.contact-inner h2 { margin-bottom: 16px; }
.contact-inner .section-lede { margin-inline: auto; }
.contact-email { display: inline-block; margin-top: 30px; font-family: var(--font-display); font-size: clamp(1.4rem, 3.4vw, 2rem); color: var(--accent); letter-spacing: -0.01em; border-bottom: 1px solid transparent; transition: border-color 0.2s ease; }
.contact-email:hover { border-bottom-color: var(--accent); }
.contact-actions { margin-top: 32px; }

/* ===================== FOOTER ===================== */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; background: var(--bg-alt); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 600; color: #F4F7FA; }
.footer-brand .brand-logo { height: 30px; }
.footer-meta { display: flex; gap: 10px; color: var(--text-dim); font-size: 0.92rem; }
.footer-meta a:hover { color: var(--accent); }
.footer-copy { width: 100%; color: var(--text-dim); font-size: 0.85rem; padding-top: 8px; }

/* ===================== REVEAL ANIMATION ===================== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.22,0.61,0.36,1), transform 0.7s cubic-bezier(0.22,0.61,0.36,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .hero-bg { background-size: cover; background-position: 60% 20%; }
  .exp-grid { grid-template-columns: 1fr; }
  .opt-grid { grid-template-columns: 1fr; }
  .opt-copy { order: 1; }
  .opt-visual { order: 2; max-width: 460px; }
}

@media (max-width: 920px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav-right { gap: 12px; }
  .mobile-menu:not([hidden]) { display: flex; }
}

@media (max-width: 720px) {
  .hero { min-height: 0; }
  .hero-bg { background-position: 45% 16%; }
  .hero-scrim {
    background:
      linear-gradient(0deg, #0A0D12 0%, rgba(10,13,18,0) 14%),
      linear-gradient(90deg, rgba(8,11,16,0.88) 0%, rgba(8,11,16,0.58) 58%, rgba(8,11,16,0.26) 100%),
      linear-gradient(0deg, rgba(8,11,16,0.5) 0%, rgba(8,11,16,0) 52%);
  }
  .hero-inner { padding-block: clamp(64px, 16vw, 96px); }
  .services-grid { grid-template-columns: 1fr; }
  .exp-points { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; gap: 28px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .hero-meta { gap: 22px 30px; }
}
