/* Ahmedonics public site. One file, no build step, no framework.
   Tokens first, then base, layout, components. Mobile-first. */

:root {
  --navy: #0c274a;
  --navy-700: #123a6b;
  --blue: #1d5fa5;
  --blue-600: #17508c;
  --orange: #e8901c;
  --orange-600: #c9780f;
  --ink: #1b2432;
  --ink-2: #4a5568;
  --ink-3: #718096;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-2: #f5f7fa;
  --bg-3: #eaf0f7;
  --ok: #1f8a4c;
  --err: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(12, 39, 74, .06), 0 4px 16px rgba(12, 39, 74, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 70ch;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); margin-top: 1.6em; }
h3 { font-size: 1.15rem; margin-top: 1.2em; }
p, ul, ol, table { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--mono); font-size: .92em; }
pre { background: var(--bg-2); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--navy); font-weight: 600; background: var(--bg-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: .5rem 1rem; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Layout */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 860px; }
.section { padding-top: 2.5rem; padding-bottom: 2.5rem; } /* vertical only: must not wipe the .wrap gutter */
.section--alt { background: var(--bg-2); }
.section__head { max-width: var(--measure); margin-bottom: 1.5rem; }
.section__head p { color: var(--ink-2); font-size: 1.05rem; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--4 { grid-template-columns: repeat(4, 1fr); } }
.two-col { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }

/* Header */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; height: 64px; }
.brand img { height: 44px; width: auto; }
.nav-toggle { display: inline-flex; align-items: center; gap: .5rem; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; min-height: 44px; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close, .nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }
.site-nav { display: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.site-nav li + li { border-top: 1px solid var(--line); }
.site-nav a { display: block; padding: .85rem .9rem; border-radius: 8px; color: var(--navy); font-weight: 500; font-size: 1.05rem; }
.site-nav a:hover { background: var(--bg-2); text-decoration: none; }
.site-nav a[aria-current="page"], .site-nav a.is-active { background: var(--bg-3); }
.site-nav .nav-cta { border-top: 0; margin-top: .75rem; }
.site-nav .nav-cta a { background: var(--orange); color: #fff; text-align: center; font-weight: 600; }
.site-nav .nav-cta a:hover { background: var(--orange-600); }
.site-header.nav-open .site-nav { display: block; position: absolute; left: 0; right: 0; top: 64px; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1rem; box-shadow: var(--shadow); }
@media (min-width: 840px) {
  .nav-toggle { display: none; }
  .site-nav { display: block !important; position: static !important; }
  .site-nav ul { flex-direction: row; align-items: center; gap: .15rem; }
  .site-nav li + li { border-top: 0; }
  .site-nav a { padding: .6rem .8rem; font-size: 1rem; }
  .site-nav .nav-cta { margin-top: 0; }
}

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-700) 55%, var(--blue) 100%); color: #fff; padding: 2.5rem 0 2.25rem; }
@media (min-width: 640px) { .hero { padding: 3.5rem 0 3rem; } }
.hero h1 { color: #fff; max-width: 22ch; }
.hero p { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); max-width: 60ch; color: rgba(255, 255, 255, .88); }
.hero .btn-row { margin-top: 1.5rem; }
.hero__kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--orange); margin-bottom: .75rem; }
.hero--sub { padding: 1.75rem 0 1.6rem; }
@media (min-width: 640px) { .hero--sub { padding: 2.25rem 0 2rem; } }
.hero--sub h1 { max-width: 30ch; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.2rem; min-height: 44px; border-radius: 8px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font: inherit; line-height: 1.2; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-600); }
.btn--secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn--secondary:hover { background: rgba(255, 255, 255, .1); }
.btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--outline:hover { background: var(--bg-3); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 419px) { .btn-row .btn { flex: 1 1 100%; } }

/* Cards */
.card { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; font-size: 1.1rem; }
.card p { color: var(--ink-2); margin-bottom: .75rem; flex: 1; }
.card .more { font-weight: 600; }
.card--link { transition: transform .15s ease, box-shadow .15s ease; }
.card--link:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(12, 39, 74, .12); }
.card__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--bg-3); color: var(--blue); display: grid; place-items: center; margin-bottom: .75rem; }
.card__icon svg { width: 22px; height: 22px; }
.card--soft { background: var(--bg-2); box-shadow: none; }

/* Breadcrumbs */
.breadcrumbs { font-size: .85rem; color: var(--ink-3); padding: .75rem 0 0; }
@media (min-width: 640px) { .breadcrumbs { font-size: .9rem; padding-top: .9rem; } }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--ink-3); }
.breadcrumbs a { color: var(--ink-2); }

/* Prose */
.prose { max-width: var(--measure); }
.prose h2 { scroll-margin-top: 80px; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: .35rem; }
.prose .lead { font-size: 1.15rem; color: var(--ink-2); }
/* Authored tables scroll sideways on phones rather than crushing their columns. */
@media (max-width: 639px) {
  .prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prose table th, .prose table td { min-width: 7rem; }
}
.prose blockquote { margin: 1.5rem 0; padding: .5rem 1rem; border-left: 4px solid var(--orange); background: var(--bg-2); color: var(--ink-2); }
.prose .note { background: var(--bg-3); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; }
.prose .formula { background: var(--bg-2); border-radius: var(--radius); padding: 1rem 1.25rem; font-family: var(--mono); overflow-x: auto; margin: 1rem 0; }
.meta { color: var(--ink-3); font-size: .9rem; }
.meta dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.meta dt { font-weight: 600; color: var(--ink-2); }
.meta dd { margin: 0; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); padding: .75rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--ink-3); }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding-top: .5rem; color: var(--ink-2); max-width: var(--measure); }

/* Sidebar */
.aside h2 { font-size: 1.05rem; margin-top: 0; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.aside ul { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.aside li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.aside li small { display: block; color: var(--ink-3); }
.aside .cta { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.25rem; }
.aside .cta h2 { color: var(--orange); }
.aside .cta p { color: rgba(255, 255, 255, .85); }
.aside .cta .btn { width: 100%; }

/* Forms */
.form { display: grid; gap: 1rem; max-width: 640px; }
.form .row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form .row { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; color: var(--navy); }
.field .hint { color: var(--ink-3); font-size: .85rem; margin-top: .25rem; }
.field input, .field select, .field textarea { width: 100%; padding: .65rem .75rem; border: 1px solid #cbd5e0; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: 3px solid rgba(29, 95, 165, .2); outline-offset: 0; }
.field textarea { min-height: 150px; resize: vertical; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err); }
.field .error { color: var(--err); font-size: .9rem; margin-top: .3rem; }
.alert { border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert--error { background: #fdecea; border-color: #f5c6c2; color: #7a1f16; }
.alert--success { background: #e6f5ec; border-color: #b9e2c8; color: #155d33; }
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }

/* Tool */
.tool { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1.25rem 0; }
@media (min-width: 640px) { .tool { padding: 1.25rem; margin: 1.5rem 0; } }
.tool__grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .tool__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.tool fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .8rem; }
.tool legend { font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.tool .field label { font-weight: 600; font-size: .95rem; }
.tool .with-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.tool .with-unit select { width: auto; }
.results { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; scroll-margin-top: 80px; }
@media (min-width: 800px) { .results { min-height: 200px; } }
.results h3 { margin-top: 0; }
.results .stat { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.results .stat:last-child { border-bottom: 0; }
.results .stat b { font-variant-numeric: tabular-nums; }
.results .stat--primary { font-size: 1.15rem; }
.results .stat--primary b { color: var(--blue); font-size: 1.35rem; }
.results .verdict { margin-top: .75rem; padding: .6rem .8rem; border-radius: 8px; font-weight: 600; }
.results .verdict--ok { background: #e6f5ec; color: #155d33; }
.results .verdict--warn { background: #fff4e0; color: #7a4a00; }
.results .verdict--bad { background: #fdecea; color: #7a1f16; }
.results .empty { color: var(--ink-3); }
.tool .actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
@media (max-width: 419px) { .tool .actions .btn { flex: 1 1 auto; } }
.tool noscript p { background: #fff4e0; padding: .75rem 1rem; border-radius: 8px; }

/* Ads: fixed-height slots reserve space so nothing shifts when a unit loads. */
.ad-slot { min-height: 280px; margin: 1.5rem 0; display: grid; place-items: center; background: var(--bg-2); border-radius: var(--radius); color: var(--ink-3); font-size: .85rem; }
.ad-slot:empty { display: none; }

/* CTA band */
.cta-band { background: var(--navy); color: #fff; padding: 2.5rem 0; }
.cta-band h2 { color: #fff; margin-top: 0; }
.cta-band p { color: rgba(255, 255, 255, .85); max-width: 60ch; }

/* Footer */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 2.5rem 0 2rem; margin-top: 3rem; color: var(--ink-2); font-size: .95rem; }
.site-footer .cols { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 .5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--ink-2); }
.site-footer .legal { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; color: var(--ink-3); font-size: .85rem; }

/* Error pages */
.error-page { padding: 4rem 0; text-align: center; }
.error-page .code { font-size: 5rem; font-weight: 800; color: var(--bg-3); line-height: 1; }
.error-page .links { margin-top: 1.5rem; }

@media print {
  .site-header, .site-footer, .cta-band, .aside .cta, .nav-toggle { display: none !important; }
  a { color: inherit; }
}

/* Utilities. Inline style attributes are blocked by the CSP (style-src 'self'), so templates use these. */
.mt-1 { margin-top: .75rem; } .mt-2 { margin-top: 1.25rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.center { justify-content: center; }
.tl { text-align: left; }
.self-center { align-self: center; }
