/* Hallmark · macrostructure: Long Document · tone: editorial (warm, story-led, restrained) · anchor hue: 35
 * genre: editorial · theme: Newsprint (paper: light · display: roman-serif · accent: warm ~35°, custom-tuned within catalog)
 * enrichment: Tier A pure-CSS art — hand-built grain-row ornament (no photography, no stock imagery; typography-first)
 * nav: N6 Newspaper masthead (knobs: issue line above wordmark, wordmark size 2xl, rule double)
 * footer: Ft6 Letter close (knobs: signoff roman, no postscript-italic, width 60ch)
 * cta: C2 Inline form-as-CTA (knobs: fields=1, submit=end-of-row, helper=below)
 * feature: F3 Tabular spec sheet (real ranges only — no invented metrics; footnote discloses source)
 * audience: health-conscious South Indian households + diabetics/pre-diabetics eating rice daily (inferred, no user present)
 * use case: single CTA — notify-me email capture ahead of first harvest (inferred)
 * fonts: Newsreader (display) · EB Garamond (body) · JetBrains Mono (outlier — masthead dateline + spec-sheet numerals only, 2 slots)
 * motion: Newsprint runs at 0x — static, print metaphor; only functional loading spinner + instant state changes
 * contrast: pass (40–41) · nav: N6 · footer: Ft6 · slop: pass (42–45) · honest: pass (46) · chrome: pass (47)
 * tokens: pass (48) · responsive: pass (49) · mobile: pass (34, 49, 50–57) · icons: pass (30)
 * pre-emit critique: P5 H5 E5 S5 R5 V5
 */

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--color-rule-2) var(--color-paper);
}
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: var(--color-paper); }
html::-webkit-scrollbar-thumb {
  background: var(--color-rule-2);
  border-radius: var(--radius-sm);
}
html::-webkit-scrollbar-thumb:hover { background: var(--color-neutral); }

body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -3rem;
  background: var(--color-ink);
  color: var(--color-paper);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  z-index: var(--z-toast);
  transition: none;
}
.skip-link:focus-visible {
  top: var(--space-md);
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* ---- Focus ring — global, instant, never animated ---- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: inherit;
}

/* ==========================================================
   Nav — N6 Newspaper masthead
   ========================================================== */
.nav-mast {
  display: grid;
  gap: var(--space-2xs);
  padding: var(--space-xl) var(--page-gutter) 0;
  text-align: center;
}
.mast-line {
  font-family: var(--font-outlier);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
}
.mast-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 4vw, 3rem);
  letter-spacing: -0.01em;
  line-height: 1.02;
  margin: var(--space-xs) 0 0;
  color: var(--color-ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.mast-nav { margin: var(--space-sm) 0 0; }
.mast-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md) var(--space-lg);
  list-style: none;
  padding: 0;
  margin: 0;
}
.mast-nav a {
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  padding-block: var(--space-2xs);
}
.mast-nav a:hover {
  color: var(--color-ink);
  border-bottom-color: var(--color-rule-2);
}
.mast-rule.double {
  border: 0;
  border-top: var(--rule-hair) solid var(--color-rule);
  border-bottom: var(--rule-hair) solid var(--color-rule);
  height: 4px;
  margin: var(--space-lg) 0 0;
}

@media (max-width: 40rem) {
  .nav-mast { padding-top: var(--space-lg); }
  .mast-name { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .mast-nav ul { gap: var(--space-sm) var(--space-md); }
}

/* ==========================================================
   Article / prose — Long Document macrostructure
   ========================================================== */
main {
  display: flex;
  justify-content: center;
  padding-inline: var(--page-gutter);
}
.prose {
  width: 100%;
  max-width: var(--measure);
  padding-block: var(--space-2xl) var(--space-3xl);
  padding-bottom: 0;
}

.lede {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--color-ink);
  margin: 0 0 var(--space-xl);
  min-width: 0;
  overflow-wrap: anywhere;
}

.prose p {
  margin: 0 0 var(--space-lg);
  max-width: var(--measure);
  overflow-wrap: anywhere;
}

.prose h2.inline {
  font-family: var(--font-body);
  font-weight: 500;
  font-style: normal;
  font-size: var(--text-xl);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin: var(--space-2xl) 0 var(--space-md);
  min-width: 0;
  overflow-wrap: anywhere;
}
.prose h2.inline:first-of-type { margin-top: var(--space-xl); }

.prose blockquote {
  margin: var(--space-xl) 0;
  padding-inline-start: var(--space-lg);
  border-inline-start: 3px solid var(--color-accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--color-ink-2);
}
.prose blockquote p { margin: 0; }

.muted { color: var(--color-muted); font-size: var(--text-sm); }

/* ---- Grain-row ornament — Tier A pure CSS art ----
   A hand-built row of rice-grain shapes standing in for a paddy-row divider.
   No animation: Newsprint runs at 0x motion (static, print metaphor). */
.grain-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
  padding-block: var(--space-xs);
}
.grain {
  display: inline-block;
  width: 0.85rem;
  height: 0.4rem;
  border-radius: 50% / 40%;
  background: linear-gradient(180deg, var(--color-accent-2), var(--color-accent));
  opacity: 0.55;
}
.grain:nth-child(odd) { transform: rotate(-18deg); }
.grain:nth-child(even) { transform: rotate(14deg) translateY(2px); }
.grain:nth-child(3n) { opacity: 0.8; width: 1rem; height: 0.46rem; }
.grain:nth-child(5) { opacity: 1; }

@media (max-width: 25rem) {
  .grain-row { gap: var(--space-sm); }
  .grain:nth-last-child(-n+2) { display: none; }
}

/* ---- Photo slots — placeholder art, swap src for real photography ---- */
.photo {
  margin: var(--space-xl) 0;
}
.photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-rule);
}
.photo figcaption {
  margin-top: var(--space-sm);
}

/* ==========================================================
   F3 · Tabular spec sheet — nutrition comparison
   ========================================================== */
.spec-sheet-wrap {
  margin: var(--space-lg) 0 var(--space-xl);
  max-width: 100%;
  overflow-x: auto;
}
.spec-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.spec-sheet caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
  font-size: var(--text-sm);
}
.spec-sheet th, .spec-sheet td {
  text-align: left;
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
  vertical-align: top;
}
.spec-sheet thead th {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-ink);
  border-bottom: 2px solid var(--color-rule-2);
}
.spec-sheet tbody th {
  font-weight: 500;
  color: var(--color-ink);
  white-space: nowrap;
}
.spec-sheet.tnum td {
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
  color: var(--color-ink-2);
}
.spec-sheet-wrap figcaption { margin-top: var(--space-sm); }

@media (max-width: 40rem) {
  .spec-sheet thead { display: none; }
  .spec-sheet, .spec-sheet tbody, .spec-sheet tr, .spec-sheet th, .spec-sheet td {
    display: block;
    width: 100%;
  }
  .spec-sheet tr {
    padding-block: var(--space-sm);
    border-bottom: var(--rule-hair) solid var(--color-rule);
  }
  .spec-sheet th, .spec-sheet td {
    border-bottom: 0;
    padding: var(--space-3xs) 0;
    white-space: normal;
  }
  .spec-sheet tbody th { font-family: var(--font-display); font-weight: 600; }
  .spec-sheet td::before {
    content: attr(data-label) ": ";
    font-family: var(--font-body);
    font-style: normal;
    color: var(--color-muted);
  }
}

/* ==========================================================
   C2 · Inline form-as-CTA — email capture
   ========================================================== */
.cta-form { margin-top: var(--space-lg); max-width: var(--measure); }
.cta-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.cta-form__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-xs);
}
.cta-form__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-sm);
  align-items: center;
}
.cta-form__field {
  position: relative;
  display: flex;
  align-items: center;
}
.cta-form input {
  width: 100%;
  height: 2.75rem;
  min-height: 44px;
  background: var(--color-paper);
  border: 1px solid var(--color-rule-2);
  outline: 2px solid transparent;
  outline-offset: 1px;
  border-radius: var(--radius-sm);
  padding-inline: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-ink);
}
.cta-form input::placeholder { color: var(--color-neutral); }

@media (hover: hover) and (pointer: fine) {
  .cta-form input:hover { background: var(--color-paper-2); }
}
.cta-form input:focus-visible {
  outline: 2px solid var(--color-focus);
  border-color: var(--color-ink-2);
}
.cta-form input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cta-form input[aria-invalid="true"] {
  border-color: var(--color-error);
}
.cta-form input.is-success {
  border-color: var(--color-success);
}

.cta-form__icon {
  position: absolute;
  right: var(--space-sm);
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}
.cta-form input[aria-invalid="true"] ~ .cta-form__icon::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--color-error);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.7rem;
}
.cta-form input.is-success ~ .cta-form__icon::before {
  content: "\2713";
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  color: var(--color-success);
  font-weight: 700;
}
.cta-form input.is-loading ~ .cta-form__icon::before {
  content: "";
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid var(--color-rule-2);
  border-top-color: var(--color-ink-2);
  animation: spin 700ms linear infinite;
}

.cta-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  min-height: 44px;
  padding-inline: var(--space-lg);
  background: var(--color-ink);
  color: var(--color-paper);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.cta-form__submit:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.cta-form__submit:active { transform: translateY(1px); }
.cta-form__submit:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.cta-form__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--color-neutral);
  border-color: var(--color-neutral);
}

.cta-form__helper {
  min-height: 1lh;
  margin: var(--space-sm) 0 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.cta-form__helper.is-error { color: var(--color-error); }
.cta-form__helper.is-success { color: var(--color-success); }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 30rem) {
  .cta-form__row { grid-template-columns: 1fr; }
  .cta-form__submit { width: 100%; }
}

/* ==========================================================
   Order Here — nav/inline trigger + modal
   ========================================================== */
.order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xs) var(--space-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1.4;
  cursor: pointer;
}
.order-btn:hover { background: var(--color-accent-2); border-color: var(--color-accent-2); }
.order-btn:active { transform: translateY(1px); }
.order-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.order-btn--inline {
  height: 2.75rem;
  min-height: 44px;
  padding-inline: var(--space-lg);
  font-size: var(--text-base);
}

.order-modal {
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-paper);
  color: var(--color-ink);
  width: min(90vw, 34rem);
  max-height: min(88vh, 40rem);
  overflow-y: auto;
  margin: auto;
  z-index: var(--z-modal);
}
.order-modal::backdrop { background: oklch(19% 0.02 40 / 55%); }

.order-modal .cta-form {
  position: relative;
  margin-top: 0;
  max-width: none;
  padding: var(--space-xl);
}

.order-modal__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.order-modal__close:hover { color: var(--color-ink); }
.order-modal__close:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.order-modal__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin: 0 0 var(--space-xs);
  padding-right: var(--space-xl);
}
.order-modal__intro {
  margin: 0 0 var(--space-lg);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

@media (max-width: 30rem) {
  .order-btn--inline { width: 100%; }
}

/* ==========================================================
   Footer — Ft6 Letter close
   ========================================================== */
.foot-letter {
  display: flex;
  justify-content: center;
  padding: var(--space-2xl) var(--page-gutter) var(--space-2xl);
  padding-top: 8px;
}
.foot-letter__inner {
  width: 100%;
  max-width: var(--measure);
}
.foot-letter__close {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--color-ink);
  margin: 0;
}
.foot-letter__sign { font-weight: 600; color: var(--color-accent); }
.foot-letter__ps {
  margin: var(--space-md) 0 0;
}

/* ---- C3 · Typographic link — inline text CTA, no box, no fill ---- */
.link {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.link:hover { color: var(--color-accent-2); }
.link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- About · people list ---- */
.people-list {
  list-style: none;
  margin: 0 0 var(--space-lg);
  padding: 0;
  max-width: var(--measure);
}
.people-list li {
  padding: var(--space-sm) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.people-list li:first-child {
  border-top: var(--rule-hair) solid var(--color-rule);
}
.people-list .link {
  font-family: var(--font-display);
  font-size: var(--text-md);
}

/* ==========================================================
   Reduced motion
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
  .cta-form input.is-loading ~ .cta-form__icon::before {
    animation: none;
    border-top-color: var(--color-rule-2);
  }
}
