/* Generated sections (/tools/, /blog/) — everything else is styles.css. */

/* The home page hero is a full viewport tall because it holds the phone
   render; here the text is the content, so it shrinks to fit and just clears
   the fixed nav. */
.page-hero {
  min-height: auto;
  padding: 6rem 2rem 3rem;
  display: block;
  text-align: center;
}

.page-hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin-bottom: 1rem; }

/* styles.css paints every h1 with a gradient clipped to the text, via
   -webkit-text-fill-color: transparent. That fill wins over a child's colour,
   so the accent span was being silently swallowed on every hero. */
.hl { -webkit-text-fill-color: currentColor; }

/* The home page's glow is a fixed 600px circle, which fits because that hero
   is a full viewport tall. These heroes are only as tall as their text, and
   .hero clips its overflow — so the circle arrives with its top and bottom
   sliced off. An ellipse sized to the box fades out inside it instead. */
.page-hero .bg-gradient {
  width: min(1100px, 140%);
  height: 100%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 38%, rgb(101 181 251 / 26%) 0%, rgba(0, 0, 0, 0) 72%);
}

.page-hero .lede {
  max-width: 720px;
  margin: 0 auto 2rem;
  color: rgba(255, 255, 255, 0.82);
}

/* A div, never a <nav>: the bare `nav` selector in styles.css is the fixed
   site header, so a second nav lands on top of the logo. */
/* The landing page's logo is a <span>; here it links home, and a bare <a>
   arrives underlined and in link blue. */
nav .logo { text-decoration: none; color: inherit; }

/* styles.css never styles a plain link, so an <a> inside body copy falls back
   to the browser's default blue and, once clicked, its default purple. */
.section-header a,
.article a,
.callout a,
.lede a { color: #7ec8f4; }

.section-header a:visited,
.article a:visited,
.callout a:visited,
.lede a:visited { color: #7ec8f4; }

.byline {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin: 0 0 1.6rem;
}

.byline .sep { margin: 0 0.5rem; opacity: 0.5; }

.crumbs { font-size: 0.85rem; color: var(--text-gray); margin-bottom: 0.5rem; text-align: left; }
.crumbs a { color: var(--text-gray); text-decoration: none; }
.crumbs a:hover { color: white; }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  max-width: 900px;
}

.chip-list a { text-decoration: none; }
/* .pack-chip is sized for the marquee, which never has to be tapped. */
.chip-list .pack-chip { padding: 8px 16px; font-size: 0.82rem; }

/* Word tables ---------------------------------------------------------- */

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.word-card { padding: 1.5rem 1.6rem 0.6rem; }
.word-card h2 { font-size: 1.25rem; margin-bottom: 0.15rem; }

.wc-level {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-gray);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.word-table { width: 100%; border-collapse: collapse; }

.word-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-gray);
  font-weight: 500;
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.word-table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.98rem;
}

.word-table tr:last-child td { border-bottom: none; }

/* Romanisation under the word, not beside it: a fifth column would squeeze the
   English one, and the two belong to the same cell anyway. */
.word-table .roman {
  display: block;
  font-size: 0.8rem;
  color: var(--text-gray);
  margin-top: 0.1rem;
}
.word-table .target { color: #7ec8f4; }

.word-table .meta {
  color: var(--text-gray);
  font-size: 0.82rem;
  white-space: nowrap;
  text-align: right;
}

/* Cards that are whole links ------------------------------------------- */

/* The app's own flag set, which picks the country people associate with a
   language rather than every country that speaks it. */
.flag-badge {
  height: 22px;
  width: auto;
  border-radius: 3px;
  vertical-align: middle;
  flex: 0 0 auto;
}

/* The tile badges. Every one is the same 50px circle so the titles beside them
   line up, whatever is drawn inside. Each rule is scoped under .tool-icon
   because `.tile span` — the subtitle rule — is a class and an element, and an
   unscoped `.tool-icon-glyph` loses to it and comes out small and grey. */
.tool-icon {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  line-height: 1;
}

.tool-icon .tool-icon-art {
  position: relative;
  width: 50px;
  height: 50px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #05060a;
  border: 1px solid rgb(52 52 52 / 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* The bedside-clock red of the drill's own face, shrunk to a badge. */
.tool-icon .tool-icon-clock {
  color: #ff4d55;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 77, 85, 0.5);
}

/* A torn-off calendar page: the red strip is the binding, the number the day. */
.tool-icon .tool-icon-calendar {
  color: #eaf4ff;
  font-size: 1.15rem;
  font-weight: 700;
  padding-top: 9px;
}

.tool-icon .tool-icon-calendar .tool-icon-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  margin: 0;
  background: #d7323c;
}

/* Not the monospace of the faces above: these are symbols, and a code font
   draws them thin and half-height. */
.tool-icon .tool-icon-glyph {
  color: #7ec8f4;
  font-family: var(--font, inherit), system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

/* The ring is the card's own background, so the flag reads as sitting on top
   of the badge rather than welded to its edge. */
.tool-icon .tool-icon-flag {
  position: absolute;
  right: -3px;
  bottom: -3px;
  height: 13px;
  width: auto;
  margin: 0;
  border-radius: 2px;
  box-shadow: 0 0 0 2px #09111b;
}

/* Scoped past `.tile span`, which is the subtitle rule and would otherwise
   win on specificity — turning the head into a block and the title into small
   grey text. */
.tile .tile-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
}

.tile .tile-head > span {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-light);
}

.post-tile .post-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.post-tile .post-meta-row .post-meta { margin: 0; }

/* Pushed to the far end of the meta row so the kicker still reads first. */
.post-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-gray);
  white-space: nowrap;
}

.hero-flag {
  height: 34px;
  width: auto;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: inline-block;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1.6rem;
  text-decoration: none;
  color: var(--text-light);
  font-size: 1.15rem;
  font-weight: 600;
}

.tile:hover { border-color: rgba(70, 164, 248, 0.55); }

.tile span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-gray);
}

/* A fixed height, not an aspect-ratio: .card is a stretched column flex item,
   which lets a ratio-sized image grow with the tallest card in the row — the
   art ends up several times taller than it was drawn. */
.tile-media {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-bottom: 1px solid rgb(52 52 52 / 50%);
}

.post-tile { padding: 0; overflow: hidden; }
.post-tile .tile-body { padding: 1.25rem 1.4rem 1.5rem; }
.post-tile h2 { font-size: 1.2rem; margin: 0 0 0.4rem; }
.post-tile p { font-size: 0.95rem; margin: 0; color: var(--text-gray); }

.post-meta {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-gray);
  margin-bottom: 0.6rem;
}

/* Articles -------------------------------------------------------------- */

.article { max-width: 760px; margin: 0 auto; padding: 0 2rem 2rem; }
.article > img { width: 100%; border-radius: 12px; margin-bottom: 2.5rem; }
.article h2 { font-size: 1.8rem; margin: 3rem 0 1rem; }
.article h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }

.article p,
.article li { font-size: 1.08rem; color: #c9c9d1; line-height: 1.75; }

.article ul, .article ol { padding-left: 1.3rem; margin-bottom: 1.5rem; }
.article li { margin-bottom: 0.6rem; }
.article a { color: #7ec8f4; }

.article-figure { margin: 2.5rem 0; }

.article-figure img {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgb(52 52 52 / 50%);
}

.article-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: right;
}

.article-figure figcaption a { color: inherit; }

.callout {
  position: relative;
  margin: 2.5rem 0;
  /* Left padding clears the mascot, which sits over the corner rather than
     inside the text column. */
  padding: 1.4rem 1.6rem 1.4rem 5.4rem;
  background: #09111b;
  border: 1px solid rgb(52 52 52 / 50%);
  border-left: 3px solid rgb(70, 164, 248);
  border-radius: 10px;
}

.callout p:last-child { margin-bottom: 0; }

/* Perched on the corner and tipped off-axis, so the box reads as something the
   app is saying rather than another paragraph. */
.callout-mascot {
  position: absolute;
  top: -16px;
  left: -14px;
  width: 72px;
  height: auto;
  transform: rotate(-12deg);
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}

/* The app has to be named as an app before any sentence uses the name.
   "Watch Your Language is where these words come from" parses as a phrase to
   anyone who has never heard of it — the icon, the name as a title and a plain
   descriptor do the introducing so the prose does not have to. */
.app-row {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.4rem;
  padding: 0.7rem 1.2rem 0.7rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgb(52 52 52 / 60%);
  border-radius: 999px;
  text-align: left;
  transition: var(--transition);
}

/* It is a link to the App Store, so it has to look like one you can press —
   but it must not take the body-link blue, which would turn the app's name
   into a run of coloured text. */
a.app-row,
a.app-row:visited { color: inherit; text-decoration: none; }

a.app-row:hover {
  background: rgba(70, 164, 248, 0.12);
  border-color: rgba(70, 164, 248, 0.55);
  transform: translateY(-1px);
}

a.app-row:hover b { color: #9dd0ff; }
a.app-row:active { transform: translateY(0); }
a.app-row:focus-visible { outline: 2px solid rgb(70, 164, 248); outline-offset: 3px; }

.app-row img { width: 46px; height: 46px; border-radius: 11px; flex: 0 0 auto; }
.app-row b { display: block; font-size: 1.02rem; color: var(--text-light); line-height: 1.25; }

.app-row span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-gray);
  line-height: 1.3;
}

/* Flex, not text-align: as inline boxes the links were breaking *inside* the
   pill when the row ran out of room, splitting one button across two lines.
   Flex items are block boxes, so each button wraps whole. */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
}

.cta-row img { height: 54px; width: auto; }

/* styles.css hides the nav below 768px and relies on script.js adding
   .nav-scrolled to slide it back in. These pages do not load that script, so
   the header would simply never appear — pin it in place instead. */
@media (max-width: 768px) {
  nav {
    transform: none;
    opacity: 1;
  }
}

/* Below this the wordmark and the badge fight for the same row. The badge goes:
   the footer and every app row on the page still carry the download link. */
@media (max-width: 560px) {
  nav .nav-cta { display: none; }
}

@media (max-width: 768px) {
  .page-hero { padding: 5rem 1.25rem 2rem; }
  .word-grid { grid-template-columns: 1fr; }
  .word-card { padding: 1.25rem 1.2rem 0.4rem; }
  .article { padding: 0 1.25rem 2rem; }
  .callout { padding-left: 4.2rem; }
  .callout-mascot { width: 56px; top: -12px; left: -10px; }
}
