/* ============================================================
   The Lexicon board (Nina, 2026-08-05)

   Every entry on this page is already a comparison, so the card is
   split down the middle: two terms, two colours, one card. The split
   does the teaching before anyone reads a word.

   Continues the Diary's material language (app/blog/blog.css): same
   cream paper, the same five brand hues at paper weight, same slight
   rotation. Pins rather than tape and a dark board rather than journal
   paper, so this reads as its own surface and not a copy of /blog.

   Loaded only by lexicon.html, after assets/styles.css, so the brand
   tokens from :root there resolve and are used directly.
   ============================================================ */

/* the five brand hues at paper weight. Same values as blog.css. */
:root{
  --t-orange:#FBD7BC; --t-teal:#BEE9EA; --t-purple:#DBD0F7;
  --t-green:#C2E9D6;  --t-amber:#FBE3B7;
  --board-ink:#374151;   /* clears 4.5:1 on the palest tint in the set */
}

html:has(body.lexicon){ background:var(--bg-page-dark); }
body.lexicon{
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255,255,255,.05), transparent 60%),
    linear-gradient(180deg,#1E2942,var(--bg-page-dark) 42%,#141D30);
}

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}

/* ---- hero, straight onto the desk ---- */
.lex-hero{ padding:56px 0 40px; }
.lex-hero .eyebrow{ color:var(--orange); margin:0 0 13px; letter-spacing:.24em; }
.lex-hero h1{
  font-family:var(--font-display); font-weight:700; color:#fff; margin:0 0 16px;
  font-size:clamp(28px,4.4vw,42px); line-height:1.12; text-wrap:balance; max-width:19ch;
}
.lex-hero p{ font-size:16.5px; line-height:1.65; color:#B9C3D6; margin:0; max-width:60ch; }

/* ---- the board ---- */
.lex-boardwrap{ padding:0 0 60px; }
.lex-board{
  position:relative; border-radius:6px; padding:40px 28px 48px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.035), transparent 42%),
    radial-gradient(circle at 78% 68%, rgba(255,255,255,.03), transparent 40%),
    linear-gradient(180deg,#0D1930,#0A1424);
  box-shadow:inset 0 0 0 9px #202D4A, inset 0 0 44px rgba(0,0,0,.75), 0 26px 50px rgba(0,0,0,.45);
}
.lex-board:before{
  content:""; position:absolute; inset:9px; border-radius:2px;
  box-shadow:inset 0 2px 6px rgba(0,0,0,.6); pointer-events:none;
}
.lex-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(272px,1fr));
  gap:44px 26px; align-items:start;
}

/* ---- a card ---- */
.lex-card{
  position:relative; border-radius:2px; background:var(--cream);
  box-shadow:0 2px 3px rgba(0,0,0,.4), 0 18px 26px -14px rgba(0,0,0,.8);
}
.lex-card:nth-child(4n+1){ rotate:-1.3deg; }
.lex-card:nth-child(4n+2){ rotate:1.1deg; }
.lex-card:nth-child(4n+3){ rotate:-.7deg; }
.lex-card:nth-child(4n+4){ rotate:1.6deg; }
/* the three-way entry takes two columns and sits nearly square */
.lex-card.wide{ grid-column:span 2; rotate:-.4deg; }

/* the pushpin */
.lex-card .pin{
  position:absolute; top:-9px; left:50%; margin-left:-9px; width:18px; height:18px;
  border-radius:50%; z-index:5; pointer-events:none;
  background:radial-gradient(circle at 33% 28%, rgba(255,255,255,.75), transparent 46%), var(--orange);
  box-shadow:0 3px 5px rgba(0,0,0,.5), inset 0 -2px 4px rgba(0,0,0,.28);
}
.lex-card .pin.teal{ background:radial-gradient(circle at 33% 28%, rgba(255,255,255,.75), transparent 46%), var(--teal); }
.lex-card .pin.purple{ background:radial-gradient(circle at 33% 28%, rgba(255,255,255,.7), transparent 46%), var(--purple); }
.lex-card .pin.green{ background:radial-gradient(circle at 33% 28%, rgba(255,255,255,.75), transparent 46%), var(--green); }
.lex-card .pin.amber{ background:radial-gradient(circle at 33% 28%, rgba(255,255,255,.75), transparent 46%), var(--amber); }

/* ---- the split ----
   .lex-terms IS the card's h2, and .lex-subs sits under it on the same
   column template, so the tinted cells stack into two continuous
   columns while the heading text stays a plain "X vs. Y". The word
   "vs." is screen-reader-only inside the gutter; the badge a sighted
   reader sees is a pseudo-element floating over a 1px fold. */
.lex-terms, .lex-subs{
  display:grid; grid-template-columns:1fr 1px 1fr; margin:0;
  border-radius:2px 2px 0 0; overflow:visible;
}
.lex-subs{ border-radius:0; }
.lex-card.wide .lex-terms,
.lex-card.wide .lex-subs{ grid-template-columns:1fr 1px 1fr 1px 1fr; }

.lex-terms{ font-family:var(--font-display); font-weight:700; }
.lex-terms .term{
  display:flex; align-items:flex-end; justify-content:center; text-align:center;
  font-size:15.5px; line-height:1.2; color:var(--text);
  padding:20px 13px 0; overflow-wrap:anywhere;
}
.lex-card.wide .lex-terms .term{ font-size:14.5px; }

/* the fold: a dashed hairline running the height of both rows */
.lex-terms .fold, .lex-subs .fold{
  position:relative;
  background:repeating-linear-gradient(to bottom, rgba(17,24,39,.32) 0 5px, transparent 5px 10px);
}
/* the badge, sitting in the clear space above the bottom-aligned term
   names. Vertically centring it put it straight through any term that
   wrapped to two lines. */
.lex-card:not(.wide) .lex-terms .fold:after{
  content:"vs"; position:absolute; top:12px; left:50%;
  transform:translate(-50%,0) rotate(-6deg);
  width:30px; height:30px; border-radius:50%; background:var(--cream);
  display:flex; align-items:center; justify-content:center; z-index:3;
  font-family:var(--font-display); font-weight:700; font-size:10.5px; color:var(--muted);
  box-shadow:0 2px 5px rgba(0,0,0,.28);
}

.lex-subs .sub{
  font-family:var(--font-body); font-size:11.8px; line-height:1.45; color:var(--board-ink);
  text-align:center; padding:8px 13px 18px;
}

/* tints, set per card as --a / --b / --c on the article */
.lex-terms > :nth-child(1), .lex-subs > :nth-child(1){ background:var(--a); }
.lex-terms > :nth-child(3), .lex-subs > :nth-child(3){ background:var(--b); }
.lex-card.wide .lex-terms > :nth-child(5),
.lex-card.wide .lex-subs  > :nth-child(5){ background:var(--c); }

/* ---- the answer, on plain paper ---- */
.lex-answer{ padding:17px 19px 19px; border-top:1px solid rgba(17,24,39,.12); }
.lex-answer .lab{
  display:block; font-family:ui-monospace,SFMono-Regular,monospace; font-size:9.5px;
  letter-spacing:.17em; text-transform:uppercase; color:var(--orange-text); margin-bottom:7px;
}
.lex-answer p{ font-size:13.4px; line-height:1.6; color:var(--board-ink); margin:0 0 11px; }
.lex-answer p:last-child{ margin-bottom:0; }
.lex-answer a{ color:var(--orange-text); font-weight:700; }
.lex-answer a:hover{ color:#8F3C0F; }

/* ---- closing note under the board ---- */
.lex-foot{ margin-top:34px; max-width:64ch; }
.lex-foot p{ font-size:14.5px; line-height:1.65; color:#8F9CB5; margin:0; }
.lex-foot a{ color:var(--orange); font-weight:700; }

@media (max-width:760px){
  .lex-hero{ padding:40px 0 30px; }
  .lex-board{ padding:30px 15px 36px; }
  .lex-grid{ gap:38px 16px; }
  /* the three-way card asks for two columns it may not have on a phone */
  .lex-card.wide{ grid-column:span 1; }
  .lex-card.wide .lex-terms .term{ font-size:12.2px; padding:17px 5px 0; }
  .lex-card.wide .lex-subs .sub{ font-size:10.4px; padding:6px 5px 15px; }
  .lex-terms .term{ font-size:14px; padding:18px 9px 0; }
  .lex-subs .sub{ font-size:11.2px; padding:7px 9px 16px; }
}
@media (prefers-reduced-motion:reduce){ *{ transition:none !important; } }
