/* ============================================================
   CITIZEN INFOTECH — DESIGN SYSTEM
   Light · Trustworthy · Innovative
   Inspired by Linear, Thoughtbot, Ramotion
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Color — surfaces */
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-alt: #F4F3EE;
  --surface-sunken: #EFEEE8;

  /* Color — ink */
  --ink: #0B0D12;
  --ink-soft: #4B5261;
  --ink-muted: #8A8F98;
  --ink-inverse: #FFFFFF;

  /* Color — lines */
  --line: #E7E5E0;
  --line-soft: #F0EEE9;
  --line-strong: #D6D3CC;

  /* Color — accent (electric royal blue) */
  --accent: #2D5BFF;
  --accent-hover: #1E47E6;
  --accent-active: #1838BF;
  --accent-soft: #EEF2FF;
  --accent-tint: #DCE5FF;
  --accent-ink: #0B2D9F;

  /* Color — warm accent (sparingly) */
  --warm: #FF5E3A;
  --warm-soft: #FFEDE6;

  /* Color — semantic */
  --success: #0E8A5F;
  --success-soft: #E4F5EE;
  --warning: #B8690A;
  --warning-soft: #FBF0DF;
  --danger: #C62A2A;
  --danger-soft: #FBE7E7;

  /* Typography */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Fluid type scale */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 17px;
  --fs-lg: clamp(18px, 1.2vw, 20px);
  --fs-xl: clamp(20px, 1.5vw, 24px);
  --fs-2xl: clamp(24px, 2vw, 30px);
  --fs-3xl: clamp(28px, 3vw, 40px);
  --fs-4xl: clamp(34px, 4.5vw, 56px);
  --fs-5xl: clamp(44px, 6vw, 80px);
  --fs-6xl: clamp(54px, 8vw, 104px);

  /* Spacing (4px scale) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-10: 64px;
  --space-12: 96px;
  --space-14: 128px;
  --space-16: 160px;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(11, 13, 18, 0.04);
  --shadow-sm: 0 1px 3px rgba(11, 13, 18, 0.06), 0 1px 2px rgba(11, 13, 18, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 13, 18, 0.06), 0 2px 4px rgba(11, 13, 18, 0.04);
  --shadow-lg: 0 12px 32px rgba(11, 13, 18, 0.08), 0 4px 8px rgba(11, 13, 18, 0.04);
  --shadow-xl: 0 24px 60px rgba(11, 13, 18, 0.10), 0 8px 16px rgba(11, 13, 18, 0.04);
  --shadow-accent: 0 8px 24px rgba(45, 91, 255, 0.24);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms;
  --dur: 240ms;
  --dur-slow: 420ms;

  /* Layout */
  --container: 1200px;
  --container-wide: 1320px;
  --container-narrow: 880px;
  --container-pad: clamp(20px, 4vw, 40px);
  --header-h: 72px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  font-feature-settings: 'ss01', 'cv01', 'cv11';
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--ink-inverse); }

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

/* ---------- Typography ---------- */
.display,
h1.display, h2.display, h3.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
  color: var(--ink);
}

h1 { font-size: var(--fs-5xl); font-weight: 600; letter-spacing: -0.03em; line-height: 1.04; }
h2 { font-size: var(--fs-4xl); font-weight: 600; letter-spacing: -0.025em; line-height: 1.08; }
h3 { font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h4 { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
h5 { font-size: var(--fs-xl); font-weight: 600; line-height: 1.35; }
h6 { font-size: var(--fs-lg); font-weight: 600; line-height: 1.4; }

p { color: var(--ink-soft); line-height: 1.7; }

.lede { font-size: var(--fs-lg); line-height: 1.6; color: var(--ink-soft); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  padding: 6px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-full);
}

.eyebrow--plain {
  background: transparent;
  padding: 0;
  color: var(--ink-muted);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

.eyebrow--plain::before { display: none; }

.muted { color: var(--ink-muted); }
.soft { color: var(--ink-soft); }

.text-gradient {
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.serif { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; }
.italic { font-style: italic; }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section {
  padding-block: clamp(64px, 10vw, 128px);
  position: relative;
}

.section--sm { padding-block: clamp(48px, 7vw, 80px); }
.section--alt { background: var(--surface-alt); }
.section--dark { background: var(--ink); color: var(--ink-inverse); }
.section--dark p { color: rgba(255,255,255,0.7); }

.section-head {
  max-width: 720px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head .eyebrow { margin-bottom: var(--space-4); }
.section-head h2 { margin-bottom: var(--space-4); }
.section-head .lede { max-width: 620px; }
.section-head--center .lede { margin-inline: auto; }

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.row--between { justify-content: space-between; }
.row--center { justify-content: center; }
.row--end { justify-content: flex-end; }

/* ---------- Buttons ---------- */
.btn {
  --_bg: var(--ink);
  --_fg: var(--ink-inverse);
  --_br: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 22px;
  min-height: 46px;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--_fg);
  background: var(--_bg);
  border: 1px solid var(--_br);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn--primary {
  --_bg: var(--accent);
  --_fg: var(--ink-inverse);
  --_br: var(--accent);
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover { --_bg: var(--accent-hover); --_br: var(--accent-hover); }

.btn--ghost {
  --_bg: transparent;
  --_fg: var(--ink);
  --_br: var(--line-strong);
}
.btn--ghost:hover { --_bg: var(--surface); --_br: var(--ink); }

.btn--soft {
  --_bg: var(--surface);
  --_fg: var(--ink);
  --_br: var(--line);
}
.btn--soft:hover { --_bg: var(--ink); --_fg: var(--ink-inverse); --_br: var(--ink); }

.btn--link {
  --_bg: transparent;
  --_fg: var(--ink);
  --_br: transparent;
  padding: 4px 0;
  min-height: 0;
  border-radius: 0;
  gap: var(--space-2);
}
.btn--link:hover { transform: translateX(2px); box-shadow: none; color: var(--accent); }
.btn--link .btn-arrow { transition: transform var(--dur) var(--ease); }
.btn--link:hover .btn-arrow { transform: translateX(3px); }

.btn--lg { min-height: 54px; padding: 14px 28px; font-size: var(--fs-base); }
.btn--sm { min-height: 38px; padding: 8px 16px; font-size: var(--fs-xs); }
.btn--block { width: 100%; }

.btn-arrow { width: 16px; height: 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.card--hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

.card--feature {
  padding: var(--space-7);
  position: relative;
  overflow: hidden;
}

.card--dark {
  background: var(--ink);
  color: var(--ink-inverse);
  border-color: var(--ink);
}
.card--dark p { color: rgba(255,255,255,0.7); }

.card--plain { background: transparent; border: 0; padding: 0; }

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: var(--space-4);
}

.card-icon--warm { background: var(--warm-soft); color: var(--warm); }
.card-icon--dark { background: var(--ink); color: var(--ink-inverse); }

.card h3, .card h4 { margin-bottom: var(--space-3); }
.card p { font-size: var(--fs-sm); }

/* ---------- Chips / Tags ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
}

.chip--accent { background: var(--accent-soft); border-color: var(--accent-tint); color: var(--accent-ink); }
.chip--warm { background: var(--warm-soft); border-color: var(--warm-soft); color: var(--warm); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }

.label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 14px 16px;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.textarea { resize: vertical; min-height: 140px; font-family: inherit; }

.input::placeholder,
.textarea::placeholder { color: var(--ink-muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(250, 250, 247, 0.92);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-h);
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.site-header__logo img {
  height: 36px;
  width: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav a {
  padding: 8px 14px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-full);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.site-nav a:hover { color: var(--ink); background: var(--surface); }
.site-nav a.is-active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-xs); }

.site-header__cta { display: flex; align-items: center; gap: var(--space-3); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), top var(--dur) var(--ease);
}

.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 24px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-header__cta .btn:not(.nav-toggle) { display: none; }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    padding: var(--space-5) var(--container-pad) var(--space-6);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    transition: transform var(--dur-slow) var(--ease);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  .site-nav.is-open { transform: translateY(0); }

  .site-nav a {
    padding: 14px 16px;
    font-size: var(--fs-md);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
  }

  .site-nav a.is-active { background: var(--surface); border-color: var(--line); }

  .site-nav .btn {
    margin-top: var(--space-3);
    justify-content: center;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.72);
  padding-block: clamp(64px, 8vw, 96px) var(--space-6);
  margin-top: clamp(64px, 8vw, 96px);
}

.site-footer a { transition: color var(--dur) var(--ease); }
.site-footer a:hover { color: #fff; }

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 900px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

.site-footer__brand { max-width: 380px; }
.site-footer__brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: #fff;
  margin-bottom: var(--space-4);
}
.site-footer__brand-mark img { height: 40px; width: auto; filter: brightness(0) invert(1); }
.site-footer__brand p { color: rgba(255,255,255,0.6); font-size: var(--fs-sm); line-height: 1.7; }

.site-footer__col h5 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.site-footer__col ul { display: flex; flex-direction: column; gap: var(--space-3); }
.site-footer__col a { color: rgba(255,255,255,0.75); font-size: var(--fs-sm); }

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-5);
  flex-wrap: wrap;
}

.site-footer__bottom p { color: rgba(255,255,255,0.5); font-size: var(--fs-xs); }

.site-footer__social { display: flex; gap: var(--space-2); }
.site-footer__social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

.site-footer__social a:hover {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: var(--ink-inverse);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 90;
}

.to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.to-top:hover { background: var(--accent); }

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal][data-reveal-delay="1"] { transition-delay: 60ms; }
[data-reveal][data-reveal-delay="2"] { transition-delay: 120ms; }
[data-reveal][data-reveal-delay="3"] { transition-delay: 180ms; }
[data-reveal][data-reveal-delay="4"] { transition-delay: 240ms; }

@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;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Decorative ---------- */
.dot-grid {
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hair-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- Utility ---------- */
.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;
}

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.mx-auto { margin-inline: auto; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.w-full { width: 100%; }

/* ---------- Page hero (reusable) ---------- */
.page-hero {
  position: relative;
  padding-block: clamp(80px, 12vw, 160px) clamp(48px, 8vw, 96px);
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}

.page-hero__content { position: relative; max-width: 820px; }
.page-hero__content .eyebrow { margin-bottom: var(--space-5); }
.page-hero h1 { margin-bottom: var(--space-5); }
.page-hero .lede { max-width: 640px; }

.page-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px 400px at 90% 10%, var(--accent-soft), transparent 60%),
              radial-gradient(500px 300px at 10% 80%, var(--warm-soft), transparent 70%);
  opacity: 0.8;
}
