/* has-a.tech: graph paper, navy ink, one highlighter. */

:root {
  --paper: #ffffff;
  --grid: #e8eef7;
  --ink: #1b2a4a;
  --ink-soft: #4a5878;
  --line: #cbd5e5;
  --marker: #ffe45c;
  --marker-ink: #1b2a4a;
  --ok: #1d7a4b;
  --bad: #b3322a;
  --panel: #f5f8fc;
  --focus: #2f6fe4;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.5rem;
  --step-4: clamp(2.6rem, 7vw, 5rem);
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141c30;
    --grid: #1c2640;
    --ink: #e8edf7;
    --ink-soft: #aab6cf;
    --line: #34415f;
    --panel: #1a2338;
    --ok: #5fd49a;
    --bad: #ff8a80;
    --focus: #8fb4ff;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font: 400 var(--step-0)/1.6 var(--body);
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); font-weight: 800; }
h2 { font-size: var(--step-2); font-weight: 700; margin-top: 2.5rem; }
h3 { font-size: var(--step-1); font-weight: 700; margin-top: 1.75rem; }
p, ul, ol { margin: 0 0 1rem; max-width: var(--measure); }
li { margin-bottom: 0.4rem; }
code, kbd, pre { font-family: var(--mono); font-size: 0.92em; }
:not(pre) > code { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.35em; }
pre {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 1rem; overflow-x: auto; max-width: var(--measure); line-height: 1.5;
}

.wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }

/* Header and footer */
.site-header { padding: 1.25rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.logo { font: 800 1.25rem var(--display); text-decoration: none; }
.logo span { background: var(--marker); color: var(--marker-ink); padding: 0 0.2em; }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-soft); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

.site-footer { margin-top: 5rem; padding: 2rem 0 3rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: var(--step--1); }
.site-footer .wrap { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

main { padding-bottom: 2rem; }

/* Buttons and forms */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: 700 var(--step-0) var(--body); color: var(--paper); background: var(--ink);
  border: 2px solid var(--ink); border-radius: 6px; padding: 0.6rem 1.1rem;
  text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.15); }
.button.secondary { background: transparent; color: var(--ink); }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
details { margin-top: 1.5rem; }
summary { cursor: pointer; color: var(--ink-soft); }

label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); margin-top: 0.2rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; max-width: 28rem; font: 400 var(--step-0) var(--body); color: var(--ink);
  background: var(--paper); border: 2px solid var(--line); border-radius: 6px; padding: 0.55rem 0.7rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.field { margin-bottom: 1.25rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

.notice { max-width: var(--measure); border-left: 4px solid var(--line); padding: 0.75rem 1rem; background: var(--panel); margin: 0 0 1.25rem; }
.notice p:last-child { margin-bottom: 0; }
.notice.ok { border-color: var(--ok); }
.notice.bad { border-color: var(--bad); }
.notice.warn { border-color: #d39b00; }

.status { font-weight: 700; min-height: 1.6em; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.status.muted { color: var(--ink-soft); font-weight: 400; }

[hidden] { display: none !important; }

/* Home hero: the address itself */
.hero { padding: 3rem 0 2.5rem; }
.hero h1 { font-size: var(--step-1); font-weight: 700; color: var(--ink-soft); margin-bottom: 1rem; }
.address {
  display: flex; align-items: baseline; flex-wrap: wrap;
  font: 700 var(--step-4)/1.1 var(--mono); letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}
.address input {
  font: inherit; letter-spacing: inherit; color: var(--marker-ink);
  background: var(--marker); border: 0; border-radius: 3px;
  padding: 0 0.12em; width: 6ch; min-width: 3ch; max-width: 100%;
}
.address input:focus { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: none; }
.address input::placeholder { color: color-mix(in srgb, var(--marker-ink) 45%, transparent); }
.address .suffix { color: var(--ink); }
.hero .lead { font-size: var(--step-1); max-width: 34rem; margin-top: 1.5rem; }
.hero .row { margin-top: 1.5rem; }

/* Home: steps */
.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); max-width: none; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 0.75rem; border-top: 3px solid var(--ink); }
.steps li::before { content: counter(step); font: 800 var(--step-2) var(--display); display: block; margin-bottom: 0.25rem; }
.steps h3 { margin-top: 0; }

.faq dt { font: 700 var(--step-1) var(--display); margin-top: 1.5rem; }
.faq dd { margin: 0.4rem 0 0; max-width: var(--measure); }

/* Guide: sidebar contents + numbered sections */
.guide { display: grid; gap: 3rem; grid-template-columns: 1fr; }
@media (min-width: 60rem) { .guide { grid-template-columns: 14rem 1fr; } }
.toc { font-size: var(--step--1); }
@media (min-width: 60rem) { .toc { position: sticky; top: 1rem; align-self: start; } }
.toc ol { padding-left: 1.2rem; }
.toc a { text-decoration: none; color: var(--ink-soft); }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.guide section { scroll-margin-top: 1rem; }
.guide section > h2 { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.guide section:first-child > h2 { margin-top: 0; border-top: 0; padding-top: 0; }
.step-num { margin-right: 0.25em; }

/* About: Bharat's own address, in the same highlighter style as the home page */
.about-address { font: 700 var(--step-2) var(--mono); letter-spacing: -0.02em; margin-bottom: 2rem; }
.about-address a { text-decoration: none; }
.about-address span { background: var(--marker); color: var(--marker-ink); padding: 0 0.12em; border-radius: 3px; }
.about-address a:hover { text-decoration: underline; }

/* Claim helper */
.output { max-width: var(--measure); }
.output pre { margin-bottom: 1rem; }

/* Verify */
.panel h2 { margin-top: 0; }
.panel { max-width: var(--measure); border: 2px solid var(--ink); border-radius: 8px; padding: 1.5rem; background: var(--paper); margin-bottom: 2rem; }
.code-input { font-family: var(--mono) !important; letter-spacing: 0.3em; max-width: 12rem !important; font-size: var(--step-1) !important; }

@media (prefers-reduced-motion: no-preference) {
  .address input { transition: width 120ms ease; }
}
