/* ==========================================================================
   AnointTech — site stylesheet
   One file, layered: tokens → base → layout → components → pages → utilities.
   Breakpoints: 640px (sm), 860px (nav), 1024px (lg). Mobile-first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --navy-900: #0B2545;
  --navy-700: #13315C;
  --gold-500: #D4AF37;

  /* Light theme (default) */
  --bg: #FFFFFF;
  --bg-subtle: #F7F7F4;
  --bg-muted: #EFEEE9;
  --surface: #FFFFFF;
  --text: #0E1726;
  --text-2: #3D4757;
  --text-3: #5D6878;
  --border: #E5E4DF;
  --border-strong: #CFCDC4;
  --accent: #D4AF37;            /* decorative gold: rules, dots, fills */
  --accent-text: #85690F;       /* gold for text on light bg — 5.1:1 on white */
  --accent-soft: rgba(212, 175, 55, 0.12);
  --btn-bg: #0B2545;
  --btn-fg: #FFFFFF;
  --btn-bg-hover: #13315C;
  --header-bg: rgba(255, 255, 255, 0.82);
  --success: #15803D;
  --success-soft: rgba(21, 128, 61, 0.08);
  --error: #B91C1C;
  --shadow-sm: 0 1px 2px rgba(14, 23, 38, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(14, 23, 38, 0.14);

  /* Type */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-h2: clamp(1.75rem, 1.3rem + 2vw, 2.75rem);
  --fs-h1: clamp(2.25rem, 1.5rem + 3.5vw, 4rem);
  --fs-hero: clamp(2.5rem, 1.4rem + 5vw, 5.25rem);

  /* Space (4px grid) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.25rem;
  --s-6: 1.5rem; --s-8: 2rem; --s-10: 2.5rem; --s-12: 3rem; --s-16: 4rem;
  --s-20: 5rem; --s-24: 6rem;
  --section-y: clamp(3.5rem, 2.5rem + 4vw, 6rem);

  /* Shape & motion */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 200ms;

  --container: 1200px;
  --container-narrow: 780px;
  --header-h: 68px;

  color-scheme: light;
}

/* Dark theme tokens. Applied when explicitly chosen, or when the OS prefers
   dark and no explicit choice exists (covers the no-JS case too). */
[data-theme="dark"] {
  --bg: #0A1220;
  --bg-subtle: #0F1A2C;
  --bg-muted: #16233A;
  --surface: #111D31;
  --text: #EEF1F5;
  --text-2: #B9C2CF;
  --text-3: #8D99AA;
  --border: #1F2D45;
  --border-strong: #2C3D5C;
  --accent: #D4AF37;
  --accent-text: #E3C45C;
  --accent-soft: rgba(212, 175, 55, 0.14);
  --btn-bg: #D4AF37;
  --btn-fg: #0B2545;
  --btn-bg-hover: #E3C45C;
  --header-bg: rgba(10, 18, 32, 0.8);
  --success: #4ADE80;
  --success-soft: rgba(74, 222, 128, 0.1);
  --error: #F87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0A1220;
    --bg-subtle: #0F1A2C;
    --bg-muted: #16233A;
    --surface: #111D31;
    --text: #EEF1F5;
    --text-2: #B9C2CF;
    --text-3: #8D99AA;
    --border: #1F2D45;
    --border-strong: #2C3D5C;
    --accent-text: #E3C45C;
    --accent-soft: rgba(212, 175, 55, 0.14);
    --btn-bg: #D4AF37;
    --btn-fg: #0B2545;
    --btn-bg-hover: #E3C45C;
    --header-bg: rgba(10, 18, 32, 0.8);
    --success: #4ADE80;
    --success-soft: rgba(74, 222, 128, 0.1);
    --error: #F87171;
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1; }
main:focus { outline: none; }

h1, h2, h3, h4 {
  margin: 0 0 var(--s-4);
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
a:hover { color: var(--accent-text); }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

ul, ol { margin: 0 0 var(--s-4); padding-inline-start: 1.25rem; }
li + li { margin-top: var(--s-2); }

strong { font-weight: 600; color: var(--text); }
address { font-style: normal; }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-12) 0; }

::selection { background: var(--accent-soft); color: var(--text); }

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

.skip-link {
  position: absolute;
  inset-inline-start: var(--s-4);
  top: -100px;
  z-index: 1000;
  padding: var(--s-3) var(--s-4);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--s-4); color: var(--btn-fg); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 0.5rem + 2.5vw, 2rem);
}
.container-narrow > * { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section-subtle { background: var(--bg-subtle); }
.section-bordered { border-top: 1px solid var(--border); }

.grid-3 {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

/* --------------------------------------------------------------------------
   4. Header & navigation
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.header.scrolled { border-bottom-color: var(--border); }

.navbar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.navbar-brand { margin-inline-end: auto; }
.logo-link { display: inline-flex; align-items: center; text-decoration: none; }
.logo { width: auto; height: 40px; }

/* Theme-aware logos: both are in the markup, CSS shows the right one. */
.logo-for-dark { display: none; }
[data-theme="dark"] .logo-for-light { display: none; }
[data-theme="dark"] .logo-for-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-for-light { display: none; }
  :root:not([data-theme]) .logo-for-dark { display: block; }
}

.navbar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.navbar-menu li + li { margin-top: 0; }

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
}
.nav-link:hover { color: var(--text); background: var(--bg-muted); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: '';
  display: block;
  width: 4px; height: 4px;
  margin-inline-start: var(--s-2);
  border-radius: 50%;
  background: var(--accent);
}

.nav-actions { display: flex; align-items: center; gap: var(--s-2); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-muted); }
.icon-btn svg { width: 18px; height: 18px; }

/* Theme toggle shows the icon of the theme you would switch TO. */
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

.mobile-menu-toggle { display: none; }
.hamburger {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.hamburger + .hamburger { margin-top: 4px; }
.mobile-menu-toggle { flex-direction: column; justify-content: center; align-items: center; }
.mobile-menu-toggle[aria-expanded="true"] .hamburger:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] .hamburger:nth-child(2) { opacity: 0; }
.mobile-menu-toggle[aria-expanded="true"] .hamburger:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 859px) {
  .mobile-menu-toggle { display: inline-flex; }
  .navbar-menu {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--s-2) var(--s-4) var(--s-6);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
  }
  .navbar-menu.active {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }
  .nav-link {
    width: 100%;
    padding: var(--s-4) var(--s-2);
    font-size: var(--fs-lg);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  .nav-link:hover { background: transparent; }
}

/* --------------------------------------------------------------------------
   5. Footer
   -------------------------------------------------------------------------- */
.footer {
  margin-top: auto;
  padding-top: var(--s-16);
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.footer-content {
  display: grid;
  gap: var(--s-10) var(--s-8);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: var(--s-12);
}
.footer-section:first-child { grid-column: 1 / -1; }

@media (min-width: 1024px) {
  .footer-content { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); }
  .footer-section:first-child { grid-column: auto; }
}

.footer-logo img { height: 44px; width: auto; margin-bottom: var(--s-4); }
.footer-tagline { max-width: 32ch; color: var(--text-3); }

.footer-heading {
  margin-bottom: var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li + li, .footer-contact li + li { margin-top: var(--s-3); }
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--text); }

.footer-contact li { display: flex; gap: var(--s-2); align-items: flex-start; }
.footer-contact svg { flex-shrink: 0; margin-top: 3px; color: var(--text-3); }

.social-links { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-6); }
.social-link {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
}
.footer .social-link:hover { color: var(--text); border-color: var(--border-strong); }
.social-link svg { width: 16px; height: 16px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-6);
  justify-content: space-between;
  align-items: center;
  padding-block: var(--s-6);
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.copyright { margin: 0; }
.footer-links-inline { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; }
.footer-links-inline .separator { color: var(--border-strong); }
.footer-links-inline a { color: var(--text-3); }

/* --------------------------------------------------------------------------
   6. Components
   -------------------------------------------------------------------------- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: var(--s-3) var(--s-6);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { background: var(--btn-bg-hover); color: var(--btn-fg); }

.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-muted); color: var(--text); border-color: var(--text-3); }

.btn-lg { min-height: 52px; padding: var(--s-4) var(--s-8); font-size: var(--fs-base); }

.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text-2);
  text-decoration: none;
}
.text-link:hover { color: var(--text); }
.text-link svg { width: 18px; height: 18px; }

/* Eyebrow label (mono, uppercase) */
.eyebrow {
  display: block;
  margin-bottom: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-2);
}
.pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

/* Section heading block */
.section-head { max-width: 720px; margin-bottom: var(--s-12); }
.section-head h2 { margin-bottom: var(--s-4); }
.lead { font-size: var(--fs-lg); color: var(--text-2); line-height: 1.6; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: 0; }
.tag-list li + li { margin-top: 0; }
.tag {
  display: inline-block;
  padding: 2px var(--s-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* Cards */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--s-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card h2, .card h3 { font-size: var(--fs-2xl); margin-bottom: var(--s-3); }
.card p { color: var(--text-2); }
.card .card-body { flex: 1; margin-bottom: var(--s-6); }
.card .tag-list { margin-bottom: var(--s-6); }
.card-index {
  margin-bottom: var(--s-6);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  color: var(--accent-text);
}
.card-more {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}
.card-more .arrow { transition: transform var(--dur) var(--ease); }

a.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
a.card:hover .card-more .arrow { transform: translateX(4px); }
.section-subtle .card { background: var(--surface); }

/* Stat strip */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-10);
  list-style: none;
  margin: 0;
  padding: var(--s-6) 0 0;
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.stat-strip li + li { margin-top: 0; }
.stat-strip strong { color: var(--text); font-weight: 600; }

/* CTA box */
.cta-box {
  padding: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  background-image: radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%);
}
.cta-box h2 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem); margin-bottom: var(--s-3); }
.cta-box p { color: var(--text-2); max-width: 60ch; margin-bottom: var(--s-8); }
.cta-box:not(:first-child) { margin-top: var(--s-12); }
.cta-box-center { text-align: center; }
.cta-box-center p { margin-inline: auto; }
.cta-box-center .actions { justify-content: center; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }

/* Breadcrumb */
.breadcrumb { margin-bottom: var(--s-6); font-size: var(--fs-sm); color: var(--text-3); }
.breadcrumb a { color: var(--text-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { color: var(--text-2); }

/* Prose (long-form copy) */
.prose { max-width: 70ch; color: var(--text-2); font-size: 1.0625rem; }
.prose > * + * { margin-top: 0; }
.prose h2 { margin: var(--s-12) 0 var(--s-4); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.prose h3 { margin: var(--s-8) 0 var(--s-3); font-size: var(--fs-xl); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin-bottom: var(--s-5); }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--text); }
.prose a:hover { color: var(--accent-text); }

/* Alerts */
.alert {
  margin-bottom: var(--s-8);
  padding: var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.alert-title { font-weight: 600; color: var(--text); margin-bottom: var(--s-2); }
.alert .ticket { font-family: var(--font-mono); color: var(--accent-text); }
.alert .muted { font-size: var(--fs-sm); color: var(--text-3); }

/* Forms */
.form-card {
  max-width: 640px;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: var(--s-6); }
.form-group label { display: block; margin-bottom: var(--s-2); font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], textarea, select {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem; /* 16px prevents iOS zoom on focus */
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.error, textarea.error { border-color: var(--error); }
.field-error { display: block; margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--error); }

/* Toasts (used by JS) */
.toast-container {
  position: fixed;
  inset-inline-end: var(--s-4);
  bottom: var(--s-4);
  z-index: 500;
  display: grid;
  gap: var(--s-2);
}

/* Scroll reveal — content is visible without JS; only hidden once JS opts in */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.js .reveal.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   7. Page sections
   -------------------------------------------------------------------------- */

/* Home hero */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) var(--section-y);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  /* faint engineering grid, fades out toward the bottom */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 70% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 70% 0%, #000 0%, transparent 75%);
  opacity: 0.6;
}
.hero-content { max-width: 940px; }
.hero .pill { margin-bottom: var(--s-8); }
.hero-title { font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: var(--s-6); }
.hero-accent { display: block; color: var(--accent-text); }
.hero-subtitle { max-width: 640px; margin-bottom: var(--s-10); font-size: var(--fs-xl); color: var(--text-2); line-height: 1.55; }
.hero-actions { margin-bottom: var(--s-12); }

/* Delivery process */
.process {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin: var(--s-16) 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--border);
  gap: 1px;
  overflow: hidden;
}
.process li { margin: 0; padding: var(--s-6) var(--s-6) var(--s-8); background: var(--surface); }
.process-num { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent-text); letter-spacing: 0.1em; margin-bottom: var(--s-4); }
.process-title { font-weight: 600; color: var(--text); margin-bottom: var(--s-1); }
.process-desc { font-size: var(--fs-sm); color: var(--text-3); margin: 0; }

/* Principles (values) */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--s-8);
  margin: 0;
  padding: 0;
  list-style: none;
}
.principles li { margin: 0; padding-top: var(--s-6); border-top: 2px solid var(--text); }
.principles li:nth-child(1) { border-top-color: var(--accent); }
.principles h3 { margin-bottom: var(--s-2); }
.principles p { color: var(--text-2); }

/* Work cards (home "recent work") */
.work-card .work-meta { display: flex; gap: var(--s-2); align-items: center; margin-bottom: var(--s-6); font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.work-card .work-meta::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }

/* Split long-form: sticky heading column + prose */
.split-row {
  display: grid;
  gap: var(--s-4) var(--s-12);
  padding-block: var(--s-12);
  border-top: 1px solid var(--border);
}
.split-row:first-child { border-top: 0; padding-top: 0; }
.split-row h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.split-row .prose { max-width: none; }
@media (min-width: 860px) {
  .split-row { grid-template-columns: 1fr 2fr; }
  .split-row h2 { position: sticky; top: calc(var(--header-h) + var(--s-8)); align-self: start; }
}

/* Interior page header */
.page-header {
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(2rem, 1.5rem + 2vw, 3.5rem);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.page-title { max-width: 22ch; margin-bottom: var(--s-4); }
.page-description, .page-subtitle { max-width: 62ch; font-size: var(--fs-lg); color: var(--text-2); margin: 0; }
.page-header .stat-strip { margin-top: var(--s-8); }

/* About */
.value-grid { margin-block: var(--s-12); }
.value-card { padding: var(--s-6); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.value-card h3 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.value-card p { font-size: var(--fs-sm); color: var(--text-2); }
.founder { margin-top: var(--s-12); padding-top: var(--s-12); border-top: 1px solid var(--border); }
.founder-role { color: var(--text-3); }

/* Portfolio */
.portfolio-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-bottom: var(--s-10);
  padding: var(--s-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.portfolio-filter-btn {
  padding: var(--s-2) var(--s-4);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}
.portfolio-filter-btn:hover { color: var(--text); }
.portfolio-filter-btn.active, .portfolio-filter-btn[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-fg); }

.portfolio-projects-grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.portfolio-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.portfolio-card.hidden { display: none; }

/* Media area: phone or browser mock on a tinted stage.
   To use a real screenshot, put an <img> inside .portfolio-phone-screen /
   .portfolio-browser-content — it fills the frame automatically. */
.portfolio-media {
  --tint-a: #0B2545;
  --tint-b: #1B4173;
  display: grid;
  place-items: center;
  height: 240px;
  padding: var(--s-6) var(--s-6) 0;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tint-b) 22%, transparent), transparent 70%),
    var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.portfolio-media.is-browser { place-items: end center; padding-bottom: 0; }
.tint-tripura    { --tint-a: #0B3B2E; --tint-b: #1F7A55; }
.tint-joyfullips { --tint-a: #4A1D3F; --tint-b: #B4467A; }
.tint-ekuber     { --tint-a: #0B2545; --tint-b: #2F6FB5; }
.tint-biblediary { --tint-a: #3B2A12; --tint-b: #B08A2E; }
.tint-mudragen   { --tint-a: #13315C; --tint-b: #3A6FD8; }
.tint-joyfulweb  { --tint-a: #3A1840; --tint-b: #9D4EB5; }

.portfolio-phone-mockup {
  align-self: end;
  width: 150px;
  height: 230px;
  padding: 8px 8px 0;
  border-radius: 26px 26px 0 0;
  background: #0E1726;
  box-shadow: 0 20px 40px -12px rgba(14, 23, 38, 0.45);
}
.portfolio-phone-screen, .portfolio-browser-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  height: 100%;
  background: linear-gradient(160deg, var(--tint-b), var(--tint-a));
  color: #fff;
  overflow: hidden;
}
.portfolio-phone-screen { border-radius: 19px 19px 0 0; }
.portfolio-phone-screen::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  width: 44px; height: 5px;
  margin-left: -22px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.35);
}
.portfolio-phone-screen img, .portfolio-browser-content img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
}
.portfolio-phone-screen svg, .portfolio-browser-content svg { opacity: 0.95; }
.app-label, .site-label { font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600; letter-spacing: -0.01em; }

.portfolio-browser-mockup {
  width: min(100%, 320px);
  height: 210px;
  border-radius: 10px 10px 0 0;
  background: #0E1726;
  overflow: hidden;
  box-shadow: 0 20px 40px -12px rgba(14, 23, 38, 0.45);
}
.portfolio-browser-titlebar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s-3); }
.portfolio-browser-dot { width: 8px; height: 8px; border-radius: 50%; background: #3A4558; }
.portfolio-browser-url {
  flex: 1;
  margin-inline-start: var(--s-2);
  padding: 2px var(--s-2);
  border-radius: 4px;
  background: #1A2436;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #9AA6B8;
  text-align: center;
}
.portfolio-browser-content { height: calc(100% - 30px); }

.portfolio-card-content { flex: 1; padding: var(--s-6) var(--s-6) var(--s-4); }
.portfolio-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.portfolio-platform-badge svg { width: 14px; height: 14px; }
.portfolio-card-content h3 { font-size: var(--fs-xl); margin-bottom: var(--s-2); }
.portfolio-card-content p { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--s-4); }
.portfolio-card-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: 0 var(--s-6) var(--s-6); }
.portfolio-card-actions .btn { min-height: 38px; padding: var(--s-2) var(--s-4); }

/* Contact */
.contact-info-grid { margin-bottom: var(--s-12); }
.contact-card { padding: var(--s-8); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.contact-card h2 { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.contact-card p, .contact-card address { color: var(--text-2); margin-bottom: var(--s-1); }
.contact-icon {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: var(--s-6);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-text);
}
.contact-icon svg { width: 22px; height: 22px; }

/* Policy pages */
.policy-content { padding-block: var(--section-y); }
.policy-content .container > * { max-width: var(--container-narrow); }
.policy-intro { font-size: var(--fs-lg); color: var(--text-2); padding-bottom: var(--s-8); margin-bottom: var(--s-8); border-bottom: 1px solid var(--border); }
.policy-section { margin-bottom: var(--s-10); color: var(--text-2); }
.policy-section h2 { font-size: var(--fs-2xl); margin-bottom: var(--s-4); }
.policy-section h3 { font-size: var(--fs-lg); margin: var(--s-6) 0 var(--s-2); }
.policy-section li::marker { color: var(--accent); }
.policy-footer { margin-top: var(--s-12); padding: var(--s-6); border-radius: var(--radius); background: var(--bg-subtle); color: var(--text-2); font-size: var(--fs-sm); }

/* Error pages */
.error-content { padding-block: var(--section-y); }
.error-wrapper { max-width: 640px; }
.error-code { font-family: var(--font-mono); font-size: var(--fs-sm); letter-spacing: 0.14em; color: var(--accent-text); margin-bottom: var(--s-4); }
.error-message { font-size: var(--fs-lg); color: var(--text-2); }
.error-url { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-3); word-break: break-all; }
.error-actions { margin-block: var(--s-8) var(--s-12); }
.error-help { padding-top: var(--s-8); border-top: 1px solid var(--border); color: var(--text-2); }
.error-help h2 { font-size: var(--fs-xl); }
.error-details { margin-top: var(--s-6); }
.error-details pre { overflow: auto; padding: var(--s-4); border-radius: var(--radius-sm); background: var(--bg-muted); font-size: var(--fs-xs); }

/* --------------------------------------------------------------------------
   8. Print
   -------------------------------------------------------------------------- */
@media print {
  .header, .footer, .cookie-banner, .skip-link, .hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}

@media (min-width: 640px) { .nowrap { white-space: nowrap; } }
