/* Easel — easel.art
 *
 * The palette, radii and type come from ios/PhotoStyle/Views/Design.swift, so
 * the site and the app are the same warm parchment by day and the same warm
 * charcoal at night.
 *
 * One value is this site's own: --coral-strong, a darker step of the action
 * colour, because the app's own fill measures 3.0:1 against a white label and
 * that is thin on a desktop page. Everything else is the app's, and each token
 * below names which of Design.swift's it is where that is not obvious.
 *
 * Design.swift's rules travel with its values. The one that matters here is
 * the note at Design.swift:93 — control boundaries use `outline`, never
 * `outlineVariant`, which is decorative only and measures 1.62:1.
 */

:root {
  --surface: #fff8f4;
  --surface-container: #f4ece7;
  --surface-container-high: #eee7e1;
  --on-surface: #1e1b18;
  --on-surface-variant: #59413c;
  --outline: #8d716a;
  --outline-variant: #e1bfb8;
  --coral: #ff603d;
  /* The app fills its primary button with --coral and labels it white, which
     measures 3.0:1. That is fine on a phone held at arm's length and thin on a
     desktop page, so filled controls here use a darker step of the same hue
     (5.0:1) while --coral keeps every glow, focus ring and accent. Same family,
     legible label. */
  --coral-strong: #c4431f;
  --coral-deep: #ae3115;
  /* Design.swift's onPrimaryFixedVariant. --coral-deep is 5.54:1 on a tinted
     surface and 4.99:1 on the coral wash, so eyebrows and step numerals — the
     two places that sit on tint rather than on parchment — use this instead. */
  --coral-on-tint: #8c1900;
  --coral-soft: #ffdad2;
  --amber: #fea932;
  --amber-soft: #ffddb9;
  --lilac: #a586ff;
  --lilac-soft: #ece4ff;
  --on-coral: #ffffff;
  --shadow-card: 0 4px 16px rgba(30, 27, 24, 0.06);
  --shadow-panel: 0 4px 20px rgba(30, 27, 24, 0.06);
  --shadow-action: 0 6px 20px rgba(255, 107, 74, 0.32);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --measure: 62ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #17120f;
    --surface-container: #251e1b;
    --surface-container-high: #302825;
    --on-surface: #efe1dc;
    --on-surface-variant: #d6c0ba;
    --outline: #a48a84;
    --outline-variant: #53433f;
    --coral-deep: #ffb4a3;
    /* Design.swift:59 `primary`, dark — not onPrimaryFixedVariant, which is
       #8C1900 in both appearances and unreadable on a dark wash. Named
       separately from --coral-deep so changing one does not move the other. */
    --coral-on-tint: #ffb4a3;
    /* Without a dark value the filled controls and the focus ring darkened
       along with the ground: the ring measured 3.26:1 on a container, not the
       3.69 that was claimed for it. A lighter coral fixes the ring but kills a
       white label, so dark mode takes the app's own pairing — a coral fill
       carries a dark label, Design.swift:60 `onPrimary`. */
    --coral-strong: #ff8a6a;
    --on-coral: #5f1600;
    /* Design.swift:121-122 washAmber and washCoral, dark. */
    --coral-soft: #4e2419;
    --amber-soft: #4a3514;
    --lilac-soft: #3a2e5c;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.42);
    --shadow-panel: 0 4px 20px rgba(0, 0, 0, 0.42);
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.6rem, 4.6vw, 2.2rem);
  font-weight: 800;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--coral-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2.5px;
}

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

/* --coral is 2.86:1 on parchment, under the 3:1 WCAG 1.4.11 wants for a
   non-text indicator. The darker step clears it in both themes: at worst
   4.32 light and 7.10 dark, on --surface-container, the deepest ground the
   site actually paints. (4.11 and 6.25 were the same measurement against
   --surface-container-high — a token nothing paints, which this same commit
   removed from the checker's grounds for exactly that reason. Third time a
   number in this comment described a pair the site does not render.)
   (The 3.69 this comment used to quote was measured before --coral-strong
   had a dark value, and stayed here after that value made it wrong.
   check-contrast.py measures tokens, not prose, so it could not catch it.) */
:focus-visible {
  outline: 3px solid var(--coral-strong);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface-container);
  color: var(--on-surface);
  padding: 12px 18px;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 700;
  z-index: 50;
}

.skip:focus {
  left: 0;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- glows ------------------------------------------------------------- */

.bloom {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .bloom {
    will-change: auto;
  }
}

/* --- header ------------------------------------------------------------ */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--outline-variant);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  color: var(--on-surface);
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 22%;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--on-surface-variant);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--on-surface);
  background: var(--surface-container);
}

/* On a phone the four links wrap to a second line and strand one of them, so
   the first — which is also the first thing you meet on scrolling — steps out
   and the rest tighten up to hold one tidy row down to 320px. */
@media (max-width: 600px) {
  .site-nav {
    flex-wrap: nowrap;
    gap: 0;
  }
  .site-nav a {
    padding: 8px 6px;
    font-size: 0.85rem;
    white-space: nowrap;
  }
  .nav-secondary {
    display: none;
  }
  .brand {
    font-size: 0.88rem;
  }
}

/* --- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.btn-primary {
  background: var(--coral-strong);
  color: var(--on-coral);
  box-shadow: var(--shadow-action);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-quiet {
  background: transparent;
  color: var(--on-surface);
  /* `outline`, not `outlineVariant`: this is the boundary of a control. */
  border-color: var(--outline);
}

.btn-quiet:hover {
  background: var(--surface-container);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* --- hero -------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(48px, 9vw, 96px) 0 clamp(40px, 7vw, 72px);
  overflow: hidden;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(32px, 6vw, 64px);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-copy p.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--on-surface-variant);
  max-width: 34ch;
  margin-top: 20px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-note {
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--on-surface-variant);
}

/* the photo, an arrow, four results */

.transform {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.tile {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--surface-container);
  aspect-ratio: 1;
  width: 100%;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile .label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--on-surface);
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.transform > .tile {
  max-width: 260px;
}

.arrow {
  color: var(--coral);
  width: 34px;
  height: 34px;
}

.quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

/* --- sections ---------------------------------------------------------- */

section {
  padding: clamp(48px, 8vw, 88px) 0;
}

.section-head {
  max-width: var(--measure);
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head p {
  color: var(--on-surface-variant);
  margin-top: 14px;
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-on-tint);
  margin-bottom: 14px;
}

.alt {
  background: var(--surface-container);
}

/* --- steps ------------------------------------------------------------- */

.steps {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.steps li {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.alt .steps li {
  background: var(--surface);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral-on-tint);
  font-weight: 800;
  margin-bottom: 16px;
}

.steps p {
  color: var(--on-surface-variant);
  margin: 10px 0 0;
}

/* --- look grid --------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filters button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9999px;
  border: 1.5px solid var(--outline);
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
}

.filters button:hover {
  background: var(--surface-container);
  color: var(--on-surface);
}

.filters button[aria-pressed="true"] {
  background: var(--coral-strong);
  border-color: var(--coral-strong);
  color: var(--on-coral);
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}

.grid figure {
  margin: 0;
}

.grid .tile {
  border-radius: var(--radius-md);
}

.grid figcaption {
  padding: 10px 2px 0;
}

.grid .name {
  font-weight: 700;
  font-size: 0.95rem;
  display: block;
}

.grid .blurb {
  color: var(--on-surface-variant);
  font-size: 0.85rem;
}

.count {
  color: var(--on-surface-variant);
  font-size: 0.92rem;
  margin: 0 0 20px;
}

/* --- words panel ------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-panel);
}

.said {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.said li {
  padding: 10px 18px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
}

.said li:nth-child(3n + 1) {
  background: var(--coral-soft);
}

.said li:nth-child(3n + 2) {
  background: var(--amber-soft);
}

.said li:nth-child(3n + 3) {
  background: var(--lilac-soft);
}

/* --- facts ------------------------------------------------------------- */

.facts {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}

.facts li {
  border-left: 3px solid var(--coral);
  padding-left: 18px;
}

.facts strong {
  display: block;
  font-size: 1.05rem;
}

.facts span {
  color: var(--on-surface-variant);
  font-size: 0.95rem;
}

/* --- blog -------------------------------------------------------------- */

.posts {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  /* A whole-card link is a control, so `outline` here too. */
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  border-color: var(--coral-strong);
}

.post-card time {
  color: var(--on-surface-variant);
  font-size: 0.85rem;
  font-weight: 600;
}

.post-card h3 {
  margin: 10px 0;
}

.post-card p {
  color: var(--on-surface-variant);
  font-size: 0.95rem;
  margin: 0;
}

.article {
  max-width: var(--measure);
  margin: 0 auto;
}

.article h2 {
  font-size: 1.4rem;
  margin: 2em 0 0.6em;
}

.article time {
  color: var(--on-surface-variant);
  font-weight: 600;
  font-size: 0.9rem;
}

.article .lede {
  font-size: 1.15rem;
  color: var(--on-surface-variant);
}

.article ul {
  padding-left: 1.2em;
}

.article li {
  margin-bottom: 0.5em;
}

.article figure {
  margin: 2em 0;
}

.article figure img {
  border-radius: var(--radius-lg);
  width: 100%;
}

.article figcaption {
  color: var(--on-surface-variant);
  font-size: 0.88rem;
  margin-top: 10px;
}

/* --- closing ----------------------------------------------------------- */

.closing {
  position: relative;
  overflow: hidden;
  text-align: center;
}

.closing .wrap {
  position: relative;
  z-index: 1;
}

.closing p {
  color: var(--on-surface-variant);
  max-width: 44ch;
  margin: 18px auto 30px;
}

/* --- footer ------------------------------------------------------------ */

.site-foot {
  border-top: 1px solid var(--outline-variant);
  padding: 40px 0;
  color: var(--on-surface-variant);
  font-size: 0.92rem;
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
}

.site-foot nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-left: auto;
}

.site-foot a {
  color: var(--on-surface-variant);
}
