/* =========================================================
   THEMES — three design directions, switch with data-theme
   ========================================================= */

/* 1. NIGHT — dark, confident, amber accent */
:root, [data-theme="night"] {
  --bg: #0e1116;
  --bg-alt: #151a21;
  --surface: #1a2029;
  --text: #e8ecf1;
  --muted: #9aa5b1;
  --accent: #f5a524;
  --accent-hover: #e08e0b;
  --on-accent: #16120a;
  --border: #262e3a;
  --radius: 14px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: var(--font-body);
  --head-weight: 750;
  --head-tracking: -0.02em;
  --eyebrow-font: var(--font-body);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --mock-bg: #f4f6f9;
  --grid-bg: none;
}

/* 2. PAPER — light, editorial, serif headlines, terracotta */
[data-theme="paper"] {
  --bg: #f6f2ea;
  --bg-alt: #efe8dc;
  --surface: #fffdf8;
  --text: #1f1b16;
  --muted: #6b6257;
  --accent: #c2532d;
  --accent-hover: #a6431f;
  --on-accent: #fff;
  --border: #ddd3c3;
  --radius: 4px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --head-weight: 600;
  --head-tracking: -0.01em;
  --eyebrow-font: var(--font-body);
  --shadow: 0 18px 40px rgba(60, 40, 20, 0.14);
  --mock-bg: #fff;
  --grid-bg: none;
}

/* 3. BLUEPRINT — technical, grid paper, deep blue, mono labels */
[data-theme="blueprint"] {
  --bg: #f3f6fb;
  --bg-alt: #e8eef8;
  --surface: #ffffff;
  --text: #0f1e3d;
  --muted: #55627a;
  --accent: #1f4fd8;
  --accent-hover: #173db0;
  --on-accent: #fff;
  --border: #cfd9ea;
  --radius: 2px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: var(--font-body);
  --head-weight: 700;
  --head-tracking: -0.025em;
  --eyebrow-font: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --shadow: 0 12px 30px rgba(15, 30, 61, 0.12);
  --mock-bg: #fff;
  --grid-bg:
    linear-gradient(rgba(31, 79, 216, 0.06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(31, 79, 216, 0.06) 1px, transparent 1px) 0 0 / 28px 28px;
}

/* =========================================================
   BASE
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-tracking); line-height: 1.15; }
.muted { color: var(--muted); }
.container { width: min(1160px, 90%); margin: 0 auto; }
.narrow { width: min(760px, 90%); }
.center { text-align: center; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 8px; }

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

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.logo-mark { width: 26px; height: 26px; color: var(--accent); }
.nav-links { display: flex; gap: 1.75rem; list-style: none; align-items: center; font-size: 0.95rem; }
.nav-links a:not(.btn) { color: var(--muted); transition: color 0.2s; }
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; flex-direction: column; justify-content: center; gap: 5px; align-items: center; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  cursor: pointer;
  font: inherit; font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-small { padding: 0.45rem 1.05rem; font-size: 0.9rem; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-alt); }

/* =========================================================
   HERO
   ========================================================= */
.hero { padding: 5.5rem 0 3.5rem; background: var(--grid-bg); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3.5rem; align-items: center; }
.eyebrow {
  font-family: var(--eyebrow-font);
  color: var(--accent); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.8rem; margin-bottom: 0.9rem;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin-bottom: 1.25rem; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.hero-note { margin-top: 1.1rem; color: var(--muted); font-size: 0.88rem; }

/* Device mockup */
.hero-visual { position: relative; padding: 0 2.5rem 2.5rem 0; }
.browser { background: var(--mock-bg); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); }
.browser-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #e6e9ee; }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #c9ced6; }
.browser-bar i:first-child { background: #ff6159; } .browser-bar i:nth-child(2) { background: #ffbd2e; } .browser-bar i:nth-child(3) { background: #28c941; }
.browser-bar span { margin-left: 12px; background: #fff; color: #7a8391; font-size: 11px; padding: 3px 12px; border-radius: 6px; flex: 1; max-width: 220px; }
.browser-body { padding: 18px 20px 24px; }
.mock-nav { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.mock-nav b { width: 54px; height: 10px; border-radius: 4px; background: #1d2433; margin-right: auto; }
.mock-nav span { width: 34px; height: 7px; border-radius: 4px; background: #cfd5de; }
.mock-hero { display: grid; grid-template-columns: 1fr 0.9fr; gap: 16px; margin-bottom: 18px; }
.mock-lines { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.mock-lines em { height: 12px; border-radius: 4px; background: #1d2433; }
.mock-lines em.thin { height: 7px; background: #cfd5de; }
.mock-lines .w80 { width: 90%; } .mock-lines .w60 { width: 65%; } .mock-lines .w40 { width: 80%; }
.mock-lines strong { width: 70px; height: 22px; border-radius: 6px; background: var(--accent); margin-top: 8px; }
.mock-img { height: 96px; border-radius: 8px; background: url("https://images.unsplash.com/photo-1499951360447-b19be8fe80f5?auto=format&fit=crop&w=500&q=60") center/cover, #dfe4ea; }
.mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-cards div { height: 52px; border-radius: 8px; background: #eef1f5; border: 1px solid #e1e6ec; }

.phone {
  position: absolute; right: 0; bottom: 0; width: 190px;
  background: #0b0d12; border-radius: 28px; padding: 10px; box-shadow: var(--shadow);
  border: 1px solid #2a2f3a;
}
.phone-notch { width: 60px; height: 14px; background: #000; border-radius: 0 0 10px 10px; margin: -2px auto 8px; }
.chat { background: #f3f5f8; border-radius: 18px 18px 6px 6px; padding: 12px 10px; display: flex; flex-direction: column; gap: 7px; min-height: 200px; }
.msg { font-size: 11px; line-height: 1.35; padding: 7px 10px; border-radius: 12px; max-width: 85%; color: #1d2433; }
.msg.them { background: #fff; align-self: flex-start; border: 1px solid #e3e7ed; }
.msg.us { background: var(--accent); color: var(--on-accent); align-self: flex-end; }
.phone-input { margin-top: 6px; background: #1a1e27; color: #7d8594; font-size: 11px; padding: 8px 12px; border-radius: 6px 6px 18px 18px; }

.tech {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; justify-content: center;
  margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.92rem; font-family: var(--eyebrow-font);
}

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 5.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin-bottom: 0.9rem; }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-lead { color: var(--muted); font-size: 1.08rem; }

/* Services */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.service {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.service img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--bg-alt); }
.service-body { padding: 1.5rem 1.6rem 1.75rem; }
.service h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.service p { color: var(--muted); margin-bottom: 1rem; }
.ticks { list-style: none; display: grid; gap: 0.35rem; font-size: 0.93rem; }
.ticks li { padding-left: 1.5rem; position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 0.8em; height: 0.45em;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

/* Examples */
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.example { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; display: flex; flex-direction: column; }
.example h3 { font-size: 1.12rem; margin: 0.9rem 0 0.6rem; }
.example p { color: var(--muted); font-size: 0.95rem; }
.example .meta { margin-top: auto; padding-top: 1.2rem; color: var(--text); font-weight: 600; font-size: 0.88rem; font-family: var(--eyebrow-font); }
.tag {
  align-self: flex-start; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.25rem 0.65rem; border-radius: 999px; font-family: var(--eyebrow-font);
}

/* Split / why */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.split-img { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; box-shadow: var(--shadow); background: var(--bg-alt); }
.reasons { display: grid; gap: 1.5rem; margin-top: 1.75rem; }
.reasons div { border-left: 3px solid var(--accent); padding-left: 1.1rem; }
.reasons dt { font-weight: 650; font-size: 1.08rem; margin-bottom: 0.2rem; }
.reasons dd { color: var(--muted); }

/* Steps */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.75rem; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 0.35rem; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--eyebrow-font); font-weight: 700; color: var(--accent); font-size: 0.95rem;
  border-top: 2px solid var(--accent); padding-top: 0.8rem; margin-bottom: 0.25rem;
}
.steps strong { font-size: 1.08rem; }
.steps span { color: var(--muted); font-size: 0.95rem; }

/* FAQ */
.faq { display: grid; gap: 0.75rem; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.4rem; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin-top: 0.75rem; }

/* CTA */
.cta { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--bg)), var(--bg)); border-block: 1px solid var(--border); }
.cta .section-lead { margin-bottom: 2rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 4rem; align-items: start; }
.contact-info { list-style: none; display: grid; gap: 1rem; margin-top: 2rem; }
.contact-info li { display: flex; align-items: center; gap: 0.8rem; }
.contact-info svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.contact-info a:hover { color: var(--accent); }

.contact-form { display: grid; gap: 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.contact-form label { display: grid; gap: 0.4rem; font-weight: 550; font-size: 0.93rem; }
.contact-form input, .contact-form textarea, .contact-form select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: calc(var(--radius) * 0.6 + 2px);
  padding: 0.75rem 0.9rem; font: inherit; font-weight: 400;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.contact-form .btn { justify-self: start; }
.form-note { color: var(--accent); min-height: 1.5em; font-size: 0.93rem; }
.form-note.error { color: #e5484d; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form { position: relative; }
.contact-form .btn[disabled] { opacity: 0.6; cursor: wait; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 3.5rem 0 1.5rem; font-size: 0.93rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 2rem; }
.footer-grid .muted { margin-top: 0.75rem; max-width: 260px; }
.footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.9rem; font-family: var(--eyebrow-font); }
.footer ul { list-style: none; display: grid; gap: 0.5rem; }
.footer ul a { color: var(--muted); }
.footer ul a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }
.footer-bottom a { text-decoration: underline; }

/* =========================================================
   BLOG
   ========================================================= */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform 0.25s, box-shadow 0.25s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--bg-alt); }
.post-card-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.post-card h3 { font-size: 1.15rem; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card p { color: var(--muted); font-size: 0.94rem; }
.post-meta { color: var(--muted); font-size: 0.82rem; font-family: var(--eyebrow-font); margin-top: auto; }
.more-link { margin-top: 2rem; font-weight: 600; }
.more-link a { color: var(--accent); }

.blog-hero { padding: 4.5rem 0 2.5rem; background: var(--grid-bg); }
.blog-hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); margin-bottom: 0.8rem; }

.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.25rem; font-family: var(--eyebrow-font); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 0.4rem; opacity: 0.6; }

.article-head { padding: 4rem 0 2rem; }
.article-head h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin: 0.6rem 0 1rem; }
.article-head .lead { max-width: none; margin-bottom: 1rem; }
.article-cover { width: min(1000px, 92%); margin: 0 auto 3rem; }
.article-cover img { border-radius: var(--radius); aspect-ratio: 2 / 1; object-fit: cover; width: 100%; background: var(--bg-alt); }

.prose { font-size: 1.07rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { font-size: 1.6rem; margin-top: 2.6rem; }
.prose h3 { font-size: 1.22rem; margin-top: 2rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.45rem; }
.prose strong { color: var(--text); }
.prose code { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; background: var(--bg-alt); border: 1px solid var(--border); padding: 0.1em 0.35em; border-radius: 4px; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 1.1rem; color: var(--muted); font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); }
.prose th { font-family: var(--eyebrow-font); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table-wrap { overflow-x: auto; }

.post-cta {
  margin: 3.5rem 0 1rem; padding: 2rem; border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
}
.post-cta h2 { font-size: 1.4rem; margin: 0 0 0.5rem; }
.prose a.btn { color: var(--on-accent); text-decoration: none; }
.prose a.btn-ghost { color: var(--text); }
.post-cta p { color: var(--muted); margin-bottom: 1.25rem; }

/* Theme switcher */
.theme-switch {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  display: flex; align-items: center; gap: 4px; padding: 6px;
  background: #111; color: #fff; border-radius: 999px; font-size: 0.8rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3); font-family: system-ui, sans-serif;
}
.theme-switch span { padding: 0 6px 0 10px; opacity: 0.7; }
.theme-switch button { background: transparent; color: #fff; border: 0; padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; }
.theme-switch button.active { background: #fff; color: #111; }

/* =========================================================
   THEME-SPECIFIC TOUCHES
   ========================================================= */
[data-theme="paper"] .hero h1 { font-weight: 500; font-size: clamp(2.5rem, 5.4vw, 4rem); }
[data-theme="paper"] .service img { filter: saturate(0.85) sepia(0.08); }
[data-theme="paper"] .eyebrow { letter-spacing: 0.14em; }
[data-theme="paper"] .section-head { border-top: 1px solid var(--text); padding-top: 1.25rem; }

[data-theme="blueprint"] .service, [data-theme="blueprint"] .example, [data-theme="blueprint"] .faq details, [data-theme="blueprint"] .contact-form { box-shadow: 4px 4px 0 color-mix(in srgb, var(--accent) 18%, transparent); }
[data-theme="blueprint"] .eyebrow::before { content: "// "; opacity: 0.6; }
[data-theme="blueprint"] .btn { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.85rem; }
[data-theme="blueprint"] .section-alt { background: var(--bg-alt); background-image: var(--grid-bg); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .hero-grid, .split, .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .hero-visual { max-width: 520px; }
  .split-img { aspect-ratio: 16 / 10; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 1.1rem;
    background: var(--bg); padding: 1.5rem 5%; border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .hero { padding-top: 3.5rem; }
  .section { padding: 4rem 0; }
  .services { grid-template-columns: 1fr; }
  .contact-form .row { grid-template-columns: 1fr; }
  .contact-form { padding: 1.4rem; }
  .phone { width: 150px; }
  .hero-visual { padding: 0 1.5rem 2rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
