/* ============================================================
   alextafoya.com — design system
   No external dependencies. Dark by default, light via toggle.
   ============================================================ */

:root {
  --bg:            #0b0e13;
  --bg-elev:       #11161d;
  --bg-elev-2:     #161c25;
  --surface-line:  #222b38;
  --surface-line-2:#2c3746;

  --text:          #e8eef6;
  --text-muted:    #9aa8b9;
  --text-dim:      #6f7d8f;

  --accent:        #4fb3ff;
  --accent-strong: #2e9bf0;
  --accent-soft:   rgba(79, 179, 255, .12);
  --accent-2:      #58e2c2;
  --warn:          #f0b34f;
  --danger:        #ff6b6b;
  --ok:            #4fd995;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 4px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 60px rgba(0,0,0,.5);

  --maxw: 1160px;
  --gutter: clamp(20px, 5vw, 48px);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.22,.61,.36,1);
}

[data-theme="light"] {
  --bg:            #f7f9fc;
  --bg-elev:       #ffffff;
  --bg-elev-2:     #f0f4f9;
  --surface-line:  #dde5ef;
  --surface-line-2:#c9d5e3;
  --text:          #10171f;
  --text-muted:    #4d5c6e;
  --text-dim:      #6d7c8d;
  --accent:        #0b74d4;
  --accent-strong: #095fae;
  --accent-soft:   rgba(11, 116, 212, .09);
  --accent-2:      #0d9b7d;
  --shadow-sm: 0 1px 2px rgba(16,23,31,.07);
  --shadow:    0 4px 20px rgba(16,23,31,.08);
  --shadow-lg: 0 18px 50px rgba(16,23,31,.13);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 {
  line-height: 1.18;
  letter-spacing: -0.022em;
  margin: 0 0 .55em;
  font-weight: 700;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }
h3 { font-size: clamp(1.16rem, 2vw, 1.4rem); }
p  { margin: 0 0 1.05em; }

::selection { background: var(--accent); color: #fff; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------ layout */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }
.section--alt { background: var(--bg-elev); border-block: 1px solid var(--surface-line); }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.stack > * + * { margin-top: 14px; }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: .875rem; }
.tiny { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }

.section-head { max-width: 720px; margin-bottom: clamp(30px, 4vw, 48px); }
.section-head.center { margin-inline: auto; }
.section-head p { color: var(--text-muted); font-size: 1.06rem; margin-bottom: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 22%, transparent);
}

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--surface-line); }
.header-inner {
  display: flex; align-items: center; gap: 18px;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 750; letter-spacing: -.02em; font-size: 1.06rem; color: var(--text);
  margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #04121d; font-weight: 800; font-size: .92rem; letter-spacing: -.03em;
}
.brand-sub { display: block; font-size: .68rem; font-weight: 500; color: var(--text-dim);
  letter-spacing: .07em; text-transform: uppercase; margin-top: -3px; }

.nav { display: flex; align-items: center; gap: 3px; }
.nav a {
  color: var(--text-muted); font-size: .93rem; font-weight: 550;
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--bg-elev-2); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--surface-line); color: var(--text-muted);
}
.theme-toggle:hover { color: var(--text); border-color: var(--surface-line-2); }
.theme-toggle svg { width: 17px; height: 17px; }
[data-theme="light"] .icon-moon { display: none; }
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }

.menu-btn { display: none; width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--surface-line); color: var(--text);
  cursor: pointer; place-items: center; }
.menu-btn svg { width: 19px; height: 19px; }

/* dropdown */
.has-menu { position: relative; }
.has-menu > summary {
  list-style: none; cursor: pointer;
  color: var(--text-muted); font-size: .93rem; font-weight: 550;
  padding: 8px 12px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; gap: 5px;
}
.has-menu > summary::-webkit-details-marker { display: none; }
.has-menu > summary:hover, .has-menu[open] > summary { color: var(--text); background: var(--bg-elev-2); }
.has-menu > summary svg { width: 13px; height: 13px; transition: transform .2s var(--ease); }
.has-menu[open] > summary svg { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 9px); left: 0; z-index: 95;
  min-width: 290px; padding: 8px;
  background: var(--bg-elev); border: 1px solid var(--surface-line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.dropdown a {
  display: block; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text); font-size: .9rem; font-weight: 550;
}
.dropdown a span { display: block; font-size: .78rem; color: var(--text-dim); font-weight: 400; }
.dropdown a:hover { background: var(--bg-elev-2); }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: var(--radius);
  font-weight: 650; font-size: .95rem; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .16s var(--ease), background .16s var(--ease),
              border-color .16s var(--ease), box-shadow .16s var(--ease);
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

.btn-primary { background: var(--accent); color: #04121d; box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn-primary:hover { background: var(--accent-strong); color: #04121d; }
[data-theme="light"] .btn-primary { color: #fff; }

.btn-ghost { background: transparent; border-color: var(--surface-line-2); color: var(--text); }
.btn-ghost:hover { background: var(--bg-elev-2); border-color: var(--accent); color: var(--text); }

.btn-soft { background: var(--bg-elev-2); border-color: var(--surface-line); color: var(--text); }
.btn-soft:hover { border-color: var(--surface-line-2); color: var(--text); }

.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.btn-sm { padding: 8px 14px; font-size: .85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; padding: clamp(64px, 10vw, 120px) 0 clamp(48px, 7vw, 88px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 620px; z-index: 0;
  background:
    radial-gradient(52% 60% at 22% 18%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 68%),
    radial-gradient(46% 52% at 82% 8%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 66%);
  filter: blur(14px); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--surface-line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--surface-line) 55%, transparent) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(72% 62% at 50% 22%, #000 0%, transparent 78%);
  opacity: .5;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(30px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: .4em; }
.hero h1 .hl {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--text-muted); max-width: 58ch; }

.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat {
  background: var(--bg-elev); border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.stat-value {
  font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 780; letter-spacing: -.035em;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1.1;
}
.stat-label { font-size: .82rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

.availability {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 22px;
  font-size: .87rem; color: var(--text-muted);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ------------------------------------------------------------ marquee of skills */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: .8rem; padding: 5px 12px; border-radius: 999px;
  background: var(--bg-elev-2); border: 1px solid var(--surface-line);
  color: var(--text-muted); white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--accent); }

/* ------------------------------------------------------------ cards */
.card {
  background: var(--bg-elev); border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg); padding: 26px;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
  display: flex; flex-direction: column; height: 100%;
}
a.card { color: inherit; }
a.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--text-muted); font-size: .95rem; margin-bottom: 1em; }
.card .card-foot { margin-top: auto; padding-top: 6px; font-size: .87rem; font-weight: 650; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
a.card:hover .card-foot svg { transform: translateX(3px); }
.card-foot svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }

.icon-badge {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.icon-badge svg { width: 21px; height: 21px; }

/* numbered process */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 58px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-elev-2); border: 1px solid var(--surface-line);
  font-weight: 750; color: var(--accent); font-size: .98rem;
}
.step h3 { margin-bottom: .3em; font-size: 1.06rem; }
.step p { color: var(--text-muted); font-size: .93rem; margin: 0; }

/* ------------------------------------------------------------ prose */
.prose { font-size: 1.03rem; line-height: 1.75; color: var(--text); max-width: 74ch; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin-top: 2em; font-size: 1.5rem; }
.prose h3 { margin-top: 1.7em; font-size: 1.17rem; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--text-muted)); }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.15em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 680; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose code {
  font-family: var(--mono); font-size: .88em; padding: 2px 6px; border-radius: 5px;
  background: var(--bg-elev-2); border: 1px solid var(--surface-line);
}
.prose pre {
  background: var(--bg-elev-2); border: 1px solid var(--surface-line);
  border-radius: var(--radius); padding: 16px; overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote {
  margin: 1.4em 0; padding: 2px 0 2px 20px;
  border-left: 3px solid var(--accent); color: var(--text-muted);
}
.prose hr { border: 0; border-top: 1px solid var(--surface-line); margin: 2.2em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .93rem; }
.prose th, .prose td { border: 1px solid var(--surface-line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--bg-elev-2); font-weight: 650; }

/* ------------------------------------------------------------ page header */
.page-head { padding: clamp(46px, 6vw, 78px) 0 clamp(28px, 3vw, 40px); border-bottom: 1px solid var(--surface-line); position: relative; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; inset: -60% 30% auto -10%; height: 460px;
  background: radial-gradient(50% 55% at 30% 30%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.page-head .wrap { position: relative; }
.page-head h1 { max-width: 20ch; }
.page-head .lede { font-size: 1.08rem; color: var(--text-muted); max-width: 65ch; margin-bottom: 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 7px; font-size: .82rem; color: var(--text-dim); margin-bottom: 18px; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent); }
.crumbs span::after { content: "/"; margin-left: 7px; color: var(--surface-line-2); }

/* article layout */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(30px, 5vw, 60px); align-items: start; }
.sidebar { position: sticky; top: 92px; display: grid; gap: 18px; }
.side-card {
  background: var(--bg-elev); border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg); padding: 22px;
}
.side-card h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); margin-bottom: 12px; font-weight: 700; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-list a { display: block; padding: 7px 10px; margin: 0 -10px; border-radius: var(--radius-sm); font-size: .9rem; color: var(--text-muted); }
.side-list a:hover, .side-list a.active { background: var(--bg-elev-2); color: var(--text); }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.checklist li { position: relative; padding-left: 30px; color: var(--text-muted); font-size: .96rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 16px; height: 16px; border-radius: 5px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.checklist li::after {
  content: ""; position: absolute; left: 5px; top: .62em;
  width: 5px; height: 9px; border: solid var(--accent); border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

/* FAQ */
.faq { border-top: 1px solid var(--surface-line); }
.faq details { border-bottom: 1px solid var(--surface-line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative;
  font-weight: 620; font-size: 1.02rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 15px;
  font-size: 1.5rem; font-weight: 400; color: var(--accent); line-height: 1;
  transition: transform .22s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 40px 20px 0; color: var(--text-muted); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ forms */
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 620; color: var(--text-muted); }
.field label .req { color: var(--accent); }
.field .hint { font-size: .78rem; color: var(--text-dim); }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; font-size: .96rem;
  padding: 11px 13px; border-radius: var(--radius);
  background: var(--bg-elev-2); color: var(--text);
  border: 1px solid var(--surface-line);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7d8f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 15px;
  padding-right: 38px;
}
.field.error input, .field.error textarea, .field.error select { border-color: var(--danger); }
.err-text { color: var(--danger); font-size: .8rem; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.checkbox { display: flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--text-muted); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--accent); }

.alert {
  padding: 13px 16px; border-radius: var(--radius); font-size: .92rem;
  border: 1px solid var(--surface-line); background: var(--bg-elev-2); color: var(--text-muted);
}
.alert-error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); }
.alert-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); color: var(--ok); }
.alert-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); color: var(--warn); }

/* ------------------------------------------------------------ CTA band */
.cta-band {
  border-radius: var(--radius-xl); padding: clamp(32px, 5vw, 56px);
  background:
    radial-gradient(90% 130% at 8% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%),
    var(--bg-elev);
  border: 1px solid var(--surface-line);
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; align-items: center;
}
.cta-band h2 { margin-bottom: .35em; }
.cta-band p { color: var(--text-muted); margin: 0; max-width: 56ch; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--surface-line); background: var(--bg-elev); margin-top: 0; }
.footer-grid {
  display: grid; gap: 34px; padding: clamp(40px, 5vw, 60px) 0 30px;
  grid-template-columns: minmax(0, 1.5fr) repeat(auto-fit, minmax(150px, 1fr));
}
.footer-grid h5 { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-dim); margin: 0 0 13px; font-weight: 700; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { color: var(--text-muted); font-size: .91rem; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--surface-line); padding: 18px 0 28px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: .83rem; color: var(--text-dim);
}

/* ------------------------------------------------------------ admin */
.admin-body { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.admin-side {
  background: var(--bg-elev); border-right: 1px solid var(--surface-line);
  padding: 20px 16px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .brand { margin: 0 0 18px; padding: 0 6px; }
.admin-nav { display: grid; gap: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: var(--radius-sm); color: var(--text-muted); font-size: .91rem; font-weight: 550;
}
.admin-nav a:hover { background: var(--bg-elev-2); color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent); }
.admin-nav svg { width: 16px; height: 16px; flex: 0 0 auto; }
.admin-nav .badge {
  margin-left: auto; background: var(--accent); color: #04121d;
  font-size: .7rem; font-weight: 750; padding: 1px 7px; border-radius: 999px;
}
.admin-side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--surface-line); font-size: .8rem; color: var(--text-dim); }
.admin-main { padding: clamp(20px, 3vw, 34px); min-width: 0; }
.admin-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 26px; }
.admin-head h1 { font-size: 1.6rem; margin: 0; margin-right: auto; }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tile { background: var(--bg-elev); border: 1px solid var(--surface-line); border-radius: var(--radius-lg); padding: 18px 20px; }
.tile .n { font-size: 1.9rem; font-weight: 760; letter-spacing: -.03em; line-height: 1.1; }
.tile .l { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

.panel { background: var(--bg-elev); border: 1px solid var(--surface-line); border-radius: var(--radius-lg); overflow: hidden; }
.panel-head { padding: 15px 20px; border-bottom: 1px solid var(--surface-line); display: flex; align-items: center; gap: 12px; }
.panel-head h3 { margin: 0; font-size: 1rem; margin-right: auto; }
.panel-body { padding: 20px; }

.table { width: 100%; border-collapse: collapse; font-size: .91rem; }
.table th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); font-weight: 700; padding: 11px 16px;
  border-bottom: 1px solid var(--surface-line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--surface-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-elev-2); }
.table .strong { font-weight: 620; color: var(--text); }
.table-wrap { overflow-x: auto; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 650;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--surface-line);
  background: var(--bg-elev-2); color: var(--text-muted); white-space: nowrap; }
.pill-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pill-off { color: var(--text-dim); }
.pill-new { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.editor-grid textarea.code { font-family: var(--mono); font-size: .87rem; min-height: 460px; line-height: 1.6; }
.sticky-actions { position: sticky; top: 20px; display: grid; gap: 14px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; position: relative; overflow: hidden; }
.login-page::before {
  content: ""; position: absolute; inset: -40% -20% auto -20%; height: 700px;
  background: radial-gradient(48% 55% at 30% 25%, var(--accent-soft), transparent 70%),
              radial-gradient(42% 50% at 75% 10%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%);
}
.login-card {
  position: relative; width: 100%; max-width: 420px;
  background: var(--bg-elev); border: 1px solid var(--surface-line);
  border-radius: var(--radius-xl); padding: 34px; box-shadow: var(--shadow-lg);
}
.otp-input {
  font-family: var(--mono); font-size: 1.7rem; letter-spacing: .5em;
  text-align: center; padding: 14px 10px 14px 20px;
}

/* ------------------------------------------------------------ misc */
.divider { height: 1px; background: var(--surface-line); border: 0; margin: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .84rem; color: var(--text-dim); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Content is visible by default; only animated in when JS is present. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .editor-grid { grid-template-columns: 1fr; }
  .sticky-actions { position: static; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; }
  .menu-btn { display: grid; }
  .nav {
    position: fixed; inset: 68px 0 auto 0; z-index: 89;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-elev); border-bottom: 1px solid var(--surface-line);
    padding: 14px var(--gutter) 22px; box-shadow: var(--shadow-lg);
    display: none; max-height: calc(100vh - 68px); overflow-y: auto;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; font-size: .98rem; }
  .has-menu { position: static; }
  .has-menu > summary { width: 100%; justify-content: space-between; padding: 11px 12px; font-size: .98rem; }
  .dropdown { position: static; box-shadow: none; margin: 4px 0 8px; background: var(--bg-elev-2); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--surface-line); }
  .admin-nav { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); display: grid; }
}

@media (max-width: 520px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .btn-row .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  .site-header, .site-footer, .cta-band, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
