/* Jameely — site styles (9 Oct 2026). Colours and type follow the book: Mali (the cover title) for headings,
   Nunito (the book's text face) for reading; the Jameely green and gold from the logo; the rug's sage lines. */

@font-face { font-family: "Mali"; src: url("/assets/fonts/mali-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/nunito-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/nunito-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --cream: #F7F1E6;      /* the page, like the book's paper */
  --rug: #FCF9F2;        /* the musalla's field */
  --green: #1F4D45;      /* Jameely green */
  --green-deep: #173B35;
  --gold: #C48A35;       /* Jameely gold: lines and underlines, never text */
  --sage: #6F8068;       /* the book's sage: large text only */
  --sage-line: #73846C;  /* the rug's two lines */
  --fringe: #D8CCB4;
  --ink: #35302B;
  --muted: #5E574E;
  --field: #FFFDF8;
  --field-line: #C9BCA6;
  --mist: #D9E3DE;       /* light text on green */

  --step--1: 0.875rem;
  --step-0: 1.125rem;    /* 18px body */
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.5rem, 5.4vw + 0.5rem, 3.6rem);

  --measure: 36rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 var(--step-0)/1.65 "Nunito", system-ui, sans-serif;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: "Mali", "Nunito", system-ui, sans-serif; font-weight: 700; color: var(--green); margin: 0; line-height: 1.12; }
h2 { font-size: var(--step-3); margin-bottom: 0.6em; }
h3 { font-size: var(--step-1); margin: 1.6em 0 0.4em; font-family: "Nunito", system-ui, sans-serif; }

a { color: var(--green); text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--green-deep); text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 68rem; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--green); color: var(--cream); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- header ---------- */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1.25rem; }
.site-header .brand img { height: 44px; width: auto; }
.site-header nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a { font-weight: 700; text-decoration: none; padding-block: 0.25rem; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }

/* ---------- the two sage lines: the rug's border, used as the only divider ---------- */
.lines { height: 9px; border: 0; border-top: 2px solid var(--sage-line); border-bottom: 2px solid var(--sage-line); opacity: 0.55; margin: 0; }

/* ---------- hero ---------- */
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  grid-template-areas: "title rug" "body rug";
  align-items: start;
  column-gap: clamp(2rem, 6vw, 5rem);
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 7vw, 5.5rem);
}
.hero-title { grid-area: title; align-self: end; padding-top: clamp(1rem, 5vw, 4rem); }
.hero-body { grid-area: body; max-width: var(--measure); }
.hero-rug { grid-area: rug; align-self: center; justify-self: center; width: 100%; max-width: 400px; }
.hero h1 { font-size: var(--step-4); letter-spacing: -0.01em; }
.subtitle { font-weight: 700; font-size: var(--step-1); color: var(--sage); margin: 0.45em 0 1.1em; line-height: 1.3; }
.when { color: var(--muted); }

.rug { width: 100%; filter: drop-shadow(0 22px 26px rgb(31 77 69 / 0.13)); }
.rug .field { fill: var(--rug); }
.rug .line { fill: none; stroke: var(--sage-line); stroke-width: 2.4; }
.rug .fringe { stroke: var(--fringe); stroke-width: 1.6; stroke-linecap: round; }

/* ---------- sign-up ---------- */
.signup { margin-top: 1.75rem; }
.signup label { display: block; font-weight: 700; margin-bottom: 0.5rem; }
.signup .row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.signup input {
  flex: 1 1 15rem; min-width: 0; min-height: 3rem; padding: 0 1rem;
  font: inherit; color: var(--ink); background: var(--field);
  border: 2px solid var(--field-line); border-radius: 10px;
}
.signup input:focus-visible { outline-offset: 1px; border-color: var(--green); }
.signup button {
  flex: 0 0 auto; min-height: 3rem; padding: 0 1.4rem;
  font: 700 var(--step-0)/1 "Nunito", system-ui, sans-serif;
  color: var(--cream); background: var(--green); border: 0; border-radius: 10px; cursor: pointer;
}
.signup button:hover { background: var(--green-deep); }
.signup .fine { font-size: var(--step--1); color: var(--muted); margin: 0.6rem 0 0; }
.signup[data-pending] input, .signup[data-pending] button { opacity: 0.5; cursor: not-allowed; }

/* ---------- inside the book ---------- */
.inside { padding-block: clamp(3rem, 7vw, 5rem) 0; }
.inside figure { margin: 0; }
.inside img { width: 100%; border-radius: 14px; }
.inside figcaption { max-width: var(--measure); margin-top: 1rem; color: var(--muted); }

/* ---------- the book ---------- */
.book .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; padding-block: clamp(3rem, 7vw, 5.5rem); }
.book .cover { width: 100%; border-radius: 4px; box-shadow: 0 1px 0 rgb(0 0 0 / 0.05), 0 24px 40px -18px rgb(31 77 69 / 0.35); }
.book ul { padding-left: 1.2em; margin: 0 0 2rem; }
.book li { margin-bottom: 0.55em; }
.book li::marker { color: var(--sage-line); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.5rem; margin: 0; font-size: var(--step--1); }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 700; }

/* ---------- about ---------- */
.about .wrap { padding-block: clamp(3rem, 7vw, 5rem); }
.about p { max-width: var(--measure); }

/* ---------- article pages (/pictures, /privacy, /thanks) ---------- */
.article { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }
.article .wrap { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.article h1 { font-size: clamp(2.25rem, 4vw + 1rem, 3rem); margin-bottom: 0.5em; }
.article h2 { font-size: var(--step-2); margin: 1.8em 0 0.5em; }
.article .lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink); }
.article figure { margin: 2rem 0; }
.article figure img { width: 100%; border-radius: 14px; }
.article figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.6rem; }
.article ul { padding-left: 1.2em; }
.article li { margin-bottom: 0.4em; }
.article li::marker { color: var(--sage-line); }
.updated { font-size: var(--step--1); color: var(--muted); margin-top: 2.5rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--green); color: var(--mist); margin-top: 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem; padding-block: 2.5rem; font-size: var(--step--1); }
.site-footer img { height: 40px; width: auto; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--cream); text-decoration-color: var(--gold); }
.site-footer :focus-visible { outline-color: var(--cream); }
.site-footer small { display: block; width: 100%; color: var(--mist); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .site-header .brand img { height: 36px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "rug" "body"; }
  .hero-title { padding-top: 0.5rem; }
  .hero-rug { max-width: 300px; margin-block: 0.5rem 1.75rem; }
  .book .wrap { grid-template-columns: minmax(0, 1fr); }
  .book .cover { max-width: 420px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
