/* The journal's home page at /. Same look as the app (app/lib/app_theme.dart,
   JournalLogo in app/lib/controls.dart): white ground, black text, Inter. The contact block is on a pale tint of the
   logo tile's ochre with black words and a black Send (owner, 3 December 2026); the footer is black with white words,
   in the form of aikyam hq's footer, and carries the logo's dark form.
   Fonts are the app's own Inter 4.1 files (app/assets/fonts), subset to Latin
   and converted to WOFF2 with fontTools:
     uvx --from 'fonttools[woff]==4.60.1' pyftsubset app/assets/fonts/Inter-Bold.ttf \
       --unicodes=U+0020-007E,U+00A0-00FF,U+2010-2027,U+2030-203A \
       --layout-features=kern,liga,calt --flavor=woff2 --output-file=home/fonts/inter-700.woff2
   (and the same for Light 300, Regular 400, SemiBold 600). */

@font-face { font-family: Inter; font-weight: 300; font-display: swap; src: url("/fonts/inter-300.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url("/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url("/fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url("/fonts/inter-700.woff2") format("woff2"); }

/* Swiss raster (swiss-raster skill). At the default 16 px text size:
   unit 4 px, baseline 24 px (the body's 16 px text at line height 1.5), module 24 px (1 baseline).
   Every block top, line height and vertical gap is whole baselines; every left edge is whole modules
   from the content column. The content column is 57rem (38 modules) wide at most.
   Type scale: 1rem x 1.125^n (major second); the steps used are below.
   Space ladder, phone / desktop:
     0      lines of one item; heading to its line; a label to its box; a box to its error line
     1 line headline to the numbers; rule to heading (phone); between form fields; text to the form (phone)
     2 lines rule to heading and last line to next rule (desktop); numbers to the points; the closing block's columns
     3 lines header to headline, phone (header padding 1 line + headline margin 2 lines)
     4 lines header to headline, desktop (header padding 1 line + headline margin 3 lines)
     1 line / 2 lines the closing block to the footer, and the footer to the page's end (the side padding);
                      the footer's inside padding and the gap between its parts
     0      in the footer: list heading to its links (each link 2 lines tall, a touch target); logo to the unity line;
            the logo's tile on the footer's content edge (no plate)
     1 line the sign-up's heading, form, outcome line and "Powered by" line; its email box to its error line (the box
            keeps focus there); its label-and-box beside Subscribe, or above it when they do not fit
     1 line "Supported by" to the registration line, whose small print (step -2) keeps 1 line per line of text
   Text that can wrap has leading of at least 1.15, except the display headline.
   Line heights stay unitless (--lines baselines divided by the size), so they scale with the text. */

:root {
  color-scheme: light;
  --ink: #000;
  --ground: #fff;
  --quiet: #6b635e;
  --pale-ochre: #f5e9d3; /* a tint of the logo tile's ochre #a86a00 (app/assets/brand/aikyam-journal-tile.svg) */
  --on-ink-quiet: #b3b3b3;
  --on-ink-soft: #ccc;
  --on-ink-legal: #8f8f8f; /* the registration line, the quietest words: 6.5 to 1 on black */
  --rule-width: 2px;
  --rule: var(--rule-width) solid var(--ink);
  --baseline: 1.5;
  --line: calc(var(--baseline) * 1rem);
  --pad: var(--line);
  --step--2: 0.7901;
  --step--1: 0.8889;
  --step-0: 1;
  --step-1: 1.125;
  --step-2: 1.2656;
  --step-3: 1.4238;
  --step-5: 1.802;
  --step-7: 2.2807;
  --step-8: 2.5658;
  --step-12: 4.1099;
}

@media (width >= 40em) {
  :root { --pad: calc(2 * var(--line)); }
}

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

/* Each text element sets --fs (a scale step) and --lines (whole baselines per line). */
body, h1, .numbers__value, .numbers__label, .logo, .button, .point h2, .point__text, .closing h2, .closing__text,
.contact__label, .field, .contact__error, .contact__done, .foot h2, .foot a, .foot__gloss, .foot__supported, .foot__legal,
.subscribe__label, .subscribe__err, .subscribe__state, .subscribe__nojs {
  font-size: calc(var(--fs) * 1rem);
  line-height: calc(var(--lines) * var(--baseline) / var(--fs));
}

body {
  --fs: var(--step-0);
  --lines: 1;
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  font-size-adjust: from-font;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

.wrap {
  inline-size: min(100%, 57rem + 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}

h1, h2, p, ul, ol { margin: 0; }

a:focus-visible, button:focus-visible, .field:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Top row, 4 lines tall: logo left, outlined Sign in right. */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 0.75rem;
  row-gap: var(--line);
  padding-block: var(--line);
}

.logo {
  --fs: var(--step-3);
  --lines: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo img { display: block; flex: none; inline-size: 32px; block-size: 32px; }
.logo__aikyam { font-weight: 600; color: var(--ink); }
.logo__journal { font-weight: 300; color: var(--quiet); }

/* 2 lines tall: the border is taken out of the padding. */
.button {
  --fs: var(--step-1);
  --lines: 1;
  display: inline-block;
  margin: 0;
  font-family: inherit;
  cursor: pointer;
  padding: calc(0.5 * var(--line) - var(--rule-width)) calc(1.25rem - var(--rule-width));
  border: var(--rule);
  font-weight: 600;
  text-decoration: none;
}
.button:active { scale: 0.97; }
.button--outline { color: var(--ink); }
.button--outline:hover { background: var(--ink); color: var(--ground); }

/* Headline and the two numbers. */
h1 {
  --fs: var(--step-8);
  --lines: 2;
  margin-block: calc(2 * var(--line)) var(--line);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Each number over its label, side by side, 2 modules apart. */
.numbers {
  display: flex;
  flex-wrap: wrap;
  column-gap: calc(2 * var(--line));
  margin-block-end: calc(2 * var(--line));
  padding: 0;
  list-style: none;
}
.numbers li { display: grid; }
.numbers__value {
  --fs: var(--step-8);
  --lines: 2;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.numbers__label {
  --fs: var(--step-1);
  --lines: 1;
  color: var(--quiet);
}

/* The three points: 2 px black rule above each, words on the content column's left edge. */
.points { padding: 0; list-style: none; }

.point {
  padding-block: calc(var(--line) - var(--rule-width)) var(--line);
  border-block-start: var(--rule);
}

.point h2 {
  --fs: var(--step-2);
  --lines: 1;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.point__text {
  --fs: var(--step-1);
  --lines: 1;
  max-inline-size: 40rem;
  text-wrap: pretty;
}

/* Closing block: pale ochre ground, black words and black edges (black on the pale ochre is 17.4 to 1). The words left, the contact form right on a wide screen
   (Friendraiser's closing block), stacked on a phone. */
.closing {
  --inset: 0px;
  display: grid;
  row-gap: var(--line);
  column-gap: calc(2 * var(--line));
  align-items: start;
  padding: calc(var(--line) - var(--inset));
  background: var(--pale-ochre);
  color: var(--ink);
}
/* A phone has room for its words at the points' heading size; a larger size would wrap to loose lines. */
.closing h2 {
  --fs: var(--step-2);
  --lines: 1;
  font-weight: 700;
  text-wrap: balance;
}
.closing__text {
  --fs: var(--step-1);
  --lines: 1;
  text-wrap: pretty;
}

/* The contact form (js/contact.js). Its script shows and hides lines, the summary, the form and the section;
   the hidden attribute always wins over a display value set here. */
.contact[hidden],
.contact [hidden] { display: none !important; }

.contact { scroll-margin-block-start: var(--line); }

.contact__label {
  --fs: var(--step-1);
  --lines: 1;
  display: block;
  font-weight: 600;
}
.contact__gap { margin-block-start: var(--line); }

/* Square white boxes, 2 lines tall: the 2 px edge is taken out of the padding. The message box is 6 lines. */
.field {
  --fs: var(--step-1);
  --lines: 1;
  display: block;
  inline-size: 100%;
  margin: 0;
  padding: calc(0.5 * var(--line) - var(--rule-width)) calc(0.75rem - var(--rule-width));
  border: var(--rule);
  border-radius: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: inherit;
}
.field--message {
  block-size: calc(6 * var(--line));
  resize: vertical;
}
.field::placeholder { color: var(--quiet); opacity: 1; }
/* A field the reader must fix: a 4 px black edge inside the white box, beside its error line. */
.field[aria-invalid="true"] { box-shadow: inset 0 0 0 calc(2 * var(--rule-width)) var(--ink); }

.contact__error {
  --fs: var(--step-1);
  --lines: 1;
  font-weight: 700;
}
.contact__error a { color: inherit; text-underline-offset: 0.2em; }

/* The error summary (GOV.UK's, without its title): a 2 px rule above its lines, 1 line above the first field.
   It takes focus to be read out, and shows a ring while it has it. */
.contact__summary {
  scroll-margin-block: var(--line);
  margin-block-end: var(--line);
  padding-block-start: calc(var(--line) - var(--rule-width));
  border-block-start: var(--rule);
}
.contact__summary:focus { outline: 3px solid var(--ink); outline-offset: 3px; }

.contact__send { margin-block-start: var(--line); }
.button[aria-disabled="true"] { opacity: 0.6; cursor: default; }

/* The sent line takes focus to be read out; the ring shows only to keyboard users. */
.contact__done {
  --fs: var(--step-1);
  --lines: 1;
  font-weight: 700;
}
.contact__done:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.contact__done:focus:not(:focus-visible) { outline: none; }
/* A #contact link moves focus to the section for the jump only, with no ring. */
.fr-focused-target:focus { outline: none; }
/* Send: a white box with a black edge, like the fields. */
.button--light {
  padding: calc(0.5 * var(--line) - var(--rule-width)) calc(var(--line) - var(--rule-width));
  background: var(--ground);
  color: var(--ink);
  font-weight: 700;
}
.button--light:hover { text-decoration: underline; text-underline-offset: 0.2em; }
/* Send on the pale ochre: black with white words. */
.closing .button--light { background: var(--ink); color: var(--ground); }

/* Footer, in the form of aikyam hq's: black ground, white words, the logo's dark form (the ochre tile,
   both words white, "journal" in regular weight; owner, 3 December 2026) with no plate,
   the unity line, two lists of links, then the supporters and the registration line under a hairline. It sits as far
   below the closing block, and the page ends as far below it, as the content column is from the screen's side. */
.foot { padding-block: var(--pad); }
.foot__box {
  --inset: 0px;
  display: grid;
  row-gap: var(--line);
  column-gap: calc(2 * var(--line));
  align-items: start;
  padding: calc(var(--line) - var(--inset));
  background: var(--ink);
  color: var(--ground);
}
.foot a { color: inherit; }
.foot a:focus-visible { outline-color: var(--ground); }
.foot__logo { inline-size: fit-content; }
.foot .logo__aikyam { color: var(--ground); }
.foot .logo__journal { font-weight: 400; color: var(--ground); }
.foot__gloss {
  --fs: var(--step-0);
  --lines: 1;
  margin-block-start: var(--line);
  color: var(--on-ink-quiet);
}
/* The Malayalam and Devanagari words: outlines in the text's colour, 1em = the font's 1000 units, baseline on the
   text's. One step up the scale, so their letters stand as tall as Inter's beside them; still inside the 24 px line. */
.unity { font-size: calc(var(--step-1) * 1em); vertical-align: -0.3em; }
.foot__grid { display: grid; gap: var(--line) calc(2 * var(--line)); }
.foot h2 {
  --fs: var(--step--1);
  --lines: 1;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-ink-quiet);
}
.foot ul { padding: 0; list-style: none; }
.foot li a {
  --fs: var(--step-0);
  --lines: 1;
  display: inline-flex;
  align-items: center;
  min-block-size: calc(2 * var(--line));
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
}
.foot li a:hover { text-decoration-color: currentColor; }
/* The sign-up (js/subscribe.js), in aikyam hq's place: under the mark on a wide screen, after the lists on a phone.
   Heading, form, the line that replaces it (sent, failed, or no JavaScript), then "Powered by Friendraiser",
   1 line apart. The email box and Subscribe are the contact form's white boxes, 2 lines tall, side by side
   while they fit. The sent and failed lines are white panels with black words; 12 px above and below one line
   keep them whole lines tall. */
.subscribe { display: grid; row-gap: var(--line); min-inline-size: 0; scroll-margin-block-start: var(--line); }
.subscribe[hidden], .subscribe [hidden] { display: none !important; }
.foot .subscribe h2 {
  --fs: var(--step-1);
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ground);
}
.subscribe__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--line) 0.75rem; }
.subscribe__field { flex: 1 1 13.5rem; min-inline-size: 0; }
.subscribe__label { --fs: var(--step-0); --lines: 1; display: block; font-weight: 600; }
.subscribe .field:disabled { color: var(--quiet); cursor: not-allowed; opacity: 1; }
/* The email box's focus ring is drawn inside the white box, 8 px in, clear of the typing and of the 6 px black edge a
   refused address gets: outside it would cover the "Email" label above (the box sits on the label's line). */
.foot .subscribe .field:focus-visible { outline: 3px solid var(--ink); outline-offset: -11px; }
.subscribe .field { padding-inline: calc(1rem - var(--rule-width)); }
.subscribe__err, .subscribe__state { display: flex; align-items: flex-start; gap: 0.75rem; --fs: var(--step-0); --lines: 1; }
.subscribe__err svg, .subscribe__state svg { flex: none; margin-block-start: 4px; }
/* 1 line under the box, not 0 as the contact form's: the box keeps focus here, and its ring would cover the line. */
.subscribe__err { margin-block-start: var(--line); padding-inline-start: 0.75rem; border-inline-start: var(--rule-width) solid var(--ground); font-weight: 700; }
.subscribe__state { padding: calc(0.5 * var(--line)) 1rem; background: var(--ground); color: var(--ink); }
.subscribe__state span { min-inline-size: 0; overflow-wrap: anywhere; }
.subscribe__state:focus-visible { outline: 3px solid var(--ground); outline-offset: 3px; }
.foot button:focus-visible, .foot .field:focus-visible { outline-color: var(--ground); }
.subscribe__state:focus:not(:focus-visible) { outline: none; }
.subscribe__nojs { --fs: var(--step-0); --lines: 1; color: var(--on-ink-soft); }
/* Friendraiser's badge, dark form, as aikyamhq.com shows it under its Subscribe: the hosted picture, 142 x 30,
   centred in a link 2 lines tall (a touch target on the raster). */
.subscribe__powered, .contact__powered { display: flex; }
.subscribe__powered a, .contact__powered a { display: flex; align-items: center; min-block-size: calc(2 * var(--line)); line-height: 0; }
.subscribe__powered img, .contact__powered img { display: block; inline-size: 142px; block-size: 30px; }
/* The light badge under the contact form, 1 line below Send or "Message sent." (aikyamhq.com's 1-line form gap). */
.contact__powered { margin-block-start: var(--line); }
.subscribe__nojs a { text-underline-offset: 0.2em; text-decoration-color: rgb(255 255 255 / 0.45); }
.subscribe__nojs a:hover { text-decoration-color: currentColor; }

.foot__supported, .foot__legal {
  --fs: var(--step-0);
  --lines: 1;
  color: var(--on-ink-soft);
}
.foot__supported {
  padding-block-start: calc(var(--line) - 1px);
  border-block-start: 1px solid rgb(255 255 255 / 0.18);
  margin-block-end: var(--line);
}
.foot__supported a { text-underline-offset: 0.2em; text-decoration-color: rgb(255 255 255 / 0.45); }
.foot__supported a:hover { text-decoration-color: currentColor; }
/* The registration line is a legal need only (owner, 3 December 2026): the quietest text on the page, the scale's
   smallest step (12.6 px at the default size), regular weight, across the footer's full width. */
.foot__legal { --fs: var(--step--2); color: var(--on-ink-legal); }

/* /subscribed/: the headline and one link under it, 1 line apart. */
.subscribed__link { --fs: var(--step-1); --lines: 1; font-size: calc(var(--fs) * 1rem); line-height: calc(var(--lines) * var(--baseline) / var(--fs)); }
.subscribed__link a { color: inherit; text-underline-offset: 0.2em; }
.subscribed [hidden] { display: none; }

/* Desktop steps. */
@media (width >= 40em) {
  h1 { --fs: var(--step-12); --lines: 3; margin-block-start: calc(3 * var(--line)); }
  .numbers__value { --fs: var(--step-12); --lines: 3; }
  .numbers__label, .point__text { --fs: var(--step-2); }
  .point { padding-block: calc(2 * var(--line) - var(--rule-width)) calc(2 * var(--line)); }
  .point h2 { --fs: var(--step-7); --lines: 2; }
  .closing { padding: calc(2 * var(--line) - var(--inset)); }
  .closing h2 { --fs: var(--step-8); --lines: 2; }
  .closing__text { margin-block-start: var(--line); }
  .foot__box { row-gap: calc(2 * var(--line)); padding: calc(2 * var(--line) - var(--inset)); }
  .foot__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Two columns once each can hold a form a reader can use: words left, form right. */
@media (width >= 56em) {
  .closing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* The footer's mark left and its lists right, on the closing block's two columns. */
  /* When the lists are the taller side, their extra height goes under the sign-up (row 2), never half above it. */
  .foot__box { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; }
  .foot__grid { grid-column: 2; grid-row: 1 / span 2; }
  .subscribe { grid-column: 1; }
  .foot__record { grid-column: 1 / -1; }
}

/* Forced colours drop the pale ochre and black grounds and the button fills: borders keep the boxes,
   taken out of the padding so nothing moves off the lines. */
@media (forced-colors: active) {
  .closing, .foot__box { --inset: var(--rule-width); border: var(--rule); border-color: CanvasText; }
  /* The invalid field's inner edge is a shadow, which forced colours drop: an inner outline instead. */
  .field[aria-invalid="true"] { outline: var(--rule-width) solid CanvasText; outline-offset: calc(-2 * var(--rule-width)); }
  .button--light { border-color: ButtonText; }
  .subscribe__state { padding: calc(0.5 * var(--line) - var(--rule-width)) calc(1rem - var(--rule-width)); border: var(--rule-width) solid CanvasText; }
}

/* Print with backgrounds off: ink on white, a rule round the block, kept on one page. */
@media print {
  .closing, .foot__box {
    --inset: var(--rule-width);
    border: var(--rule);
    background: none;
    color: var(--ink);
    break-inside: avoid;
  }
  .foot h2, .foot__gloss, .foot__supported, .foot__legal, .foot .subscribe h2, .subscribe__nojs { color: var(--ink); }
  /* The badge's light letters would vanish on white paper. */
  .subscribe__powered img { filter: invert(1); }
  .subscribe__err { border-inline-start-color: var(--ink); }
  .foot__supported { border-block-start-color: var(--ink); }
  .button--light, .closing .button--light { background: none; color: var(--ink); }
  .foot .logo__aikyam, .foot .logo__journal { color: var(--ink); }
}
