/* Landing page and 404 for tools.safcre.com.au. The look is the tools' own (tools 7, 8 and 10):
   Instrument Serif for display type and figures, Figtree for text, JetBrains Mono for labels,
   hairlines, pills, numbered sections and the big fading footer word. The eight themes match the
   tools, and the choice is shared with them (sc-theme in local storage). Saffron on black is the
   default, for Saffron Creations. Served from /site/, so every path here is relative to it. */

@font-face { font-family: 'Instrument Serif'; src: url(fonts/instrument-serif.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url(fonts/instrument-serif-italic.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url(fonts/figtree.woff2) format('woff2'); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(fonts/jetbrains-mono.woff2) format('woff2'); font-weight: 100 800; font-style: normal; font-display: swap; }

/* ---------- themes: the same eight as the tools. --acc is the warm colour, --acc-2 the bright one ---------- */
:root, [data-theme='saffron-black'] { --bg: #050505; --panel: #0B0B0A; --line: #24221D; --ink: #F2EFE8; --ink-2: #9C978C; --ink-3: #605C54; --acc: #FF9A1F; --acc-2: #B48CFF; color-scheme: dark; }
[data-theme='rust-volt'] { --bg: #0A0A0A; --panel: #141414; --line: #262626; --ink: #F2F2F2; --ink-2: #9A9A9A; --ink-3: #5E5E5E; --acc: #E5482A; --acc-2: #D8FF3A; color-scheme: dark; }
[data-theme='copper-jade'] { --bg: #0B0D0C; --panel: #131715; --line: #252B28; --ink: #F0F0EC; --ink-2: #9A9F9B; --ink-3: #5F6561; --acc: #D9773A; --acc-2: #2ED19A; color-scheme: dark; }
[data-theme='night-globe'] { --bg: #07090D; --panel: #0D1118; --line: #1D2531; --ink: #ECEBE6; --ink-2: #8B93A1; --ink-3: #565E6B; --acc: #F2B544; --acc-2: #4D9BFF; color-scheme: dark; }
[data-theme='scan-black'] { --bg: #050605; --panel: #0A0C0A; --line: #1E2A1F; --ink: #F2F2ED; --ink-2: #9A9D96; --ink-3: #5E625C; --acc: #FF4FB0; --acc-2: #3AFB3B; color-scheme: dark; }
[data-theme='signal-mono'] { --bg: #000000; --panel: #0A0A0A; --line: #222222; --ink: #F5F5F0; --ink-2: #9A9A9A; --ink-3: #5A5A5A; --acc: #FF5F00; --acc-2: #F5F5F0; color-scheme: dark; }
[data-theme='paper'] { --bg: #EEE9E4; --panel: #F6F2EE; --line: #D9D1BC; --ink: #090B08; --ink-2: #5C6059; --ink-3: #8E918A; --acc: #B23A0B; --acc-2: #1F5FA8; color-scheme: light; }
[data-theme='gallery'] { --bg: #FAFAF7; --panel: #FFFFFF; --line: #E2E2DC; --ink: #111111; --ink-2: #5D5D58; --ink-3: #93938D; --acc: #C2410C; --acc-2: #0E7C5A; color-scheme: light; }

:root {
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --gutter: max(clamp(16px, 4.2vw, 72px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --maxw: clamp(320px, 92vw, 90rem);
  --radius: clamp(12px, 1vw, 18px);
  --ease: cubic-bezier(.2, .7, 0, 1);
  --header-h: clamp(58px, 5vw, 76px);
}

html { font-size: clamp(16px, 0.42vw + 10px, 24px); background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
::selection { background: var(--acc); color: var(--bg); }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--ink); }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- type ---------- */
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; line-height: 0.98; margin: 0; }
.display em { font-style: italic; }
.d-hero { font-size: clamp(3rem, min(7.4vw, 12.5vh), 9rem); }
.d-l { font-size: clamp(2.3rem, 4.6vw, 4.8rem); }
.eyebrow { font-family: var(--mono); font-size: clamp(0.68rem, 0.62rem + 0.2vw, 0.8rem); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.lede { font-size: clamp(1.06rem, 0.98rem + 0.4vw, 1.35rem); line-height: 1.5; color: var(--ink); max-width: 40ch; margin: 0; text-wrap: pretty; }
.body { color: var(--ink-2); max-width: 60ch; margin: 0; text-wrap: pretty; }
.note { font-size: 0.9rem; color: var(--ink-2); line-height: 1.55; margin: 0; }
.acc { color: var(--acc); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

/* ---------- header ---------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); transition: background .4s var(--ease), border-color .4s; border-bottom: 1px solid transparent; }
.site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom-color: var(--line); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: clamp(12px, 2vw, 36px); }
.site-header__actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
@media (max-width: 520px) { .hide-s { display: none; } }
@media (max-width: 380px) { .site-header__actions .btn.hide-s { display: none; } }

/* The trail every tool carries at the top left: Saffron Creations mark / Tools / this page */
.sc-trail { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; }
.sc-trail__home { display: inline-flex; flex: none; border-radius: 5px; }
.sc-trail__home img { width: auto; height: clamp(26px, 1.55em, 34px); }
.sc-trail__sep { color: var(--ink-3); font-family: var(--mono); font-size: 0.8rem; }
.sc-trail__here { font-family: var(--serif); font-size: clamp(1.15rem, 1rem + 0.5vw, 1.55rem); line-height: 1; text-decoration: none; white-space: nowrap; }
.sc-trail__here i { font-style: italic; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 2.75rem; padding: 0.5em 1.2em; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 0.9rem; text-decoration: none; cursor: pointer; transition: border-color .25s, background .25s, color .25s, transform .25s var(--ease); white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(0.97); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn--sm { min-height: 2.25rem; padding: 0.3em 0.95em; font-size: 0.82rem; }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- theme menu ---------- */
.theme-menu { position: relative; }
.theme-menu__pop { position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, 86vw); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem; z-index: 60; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.theme-menu__pop .eyebrow { padding: 0.5rem 0.6rem 0.3rem; }
.theme-opt { display: flex; align-items: center; gap: 0.7rem; width: 100%; border: 0; background: transparent; padding: 0.55rem 0.6rem; border-radius: 10px; cursor: pointer; text-align: left; font-size: 0.88rem; }
.theme-opt:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.theme-opt[aria-checked='true'] { background: color-mix(in srgb, var(--ink) 11%, transparent); }
.theme-opt small { margin-left: auto; color: var(--ink-2); font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; }
.theme-sw { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.theme-sw i { width: 14px; height: 18px; display: block; }

/* ---------- hero ---------- */
.hero { position: relative; padding-top: calc(var(--header-h) + clamp(2rem, 8vh, 6rem)); padding-bottom: clamp(3rem, 8vw, 6rem); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 96px); align-items: end; }
@media (max-width: 960px) { .hero__grid { grid-template-columns: minmax(0, 1fr); } }
.hero__text { display: flex; flex-direction: column; gap: clamp(1.1rem, 2.6vh, 1.75rem); }
.hero__actions { margin-top: 0.4rem; }

/* the figures: one real number from each dashboard's latest data */
.figs { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.fig { border-bottom: 1px solid var(--line); }
.fig a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0.2rem 1rem; padding: clamp(0.8rem, 1.6vw, 1.25rem) 0; text-decoration: none; }
.fig__k { grid-column: 1 / -1; }
.fig__v { font-family: var(--serif); font-size: clamp(2.2rem, 3.6vw, 4rem); line-height: 1; letter-spacing: -0.01em; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.fig__v sup { font-size: 0.45em; vertical-align: 0.9em; margin-left: 0.04em; }
.fig__note { grid-column: 1 / 2; font-size: 0.86rem; color: var(--ink-2); margin: 0; }
.fig__go { grid-column: 2; grid-row: 2 / 4; align-self: center; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; gap: 0.5em; transition: color .25s; }
.fig__go svg { width: 1.1em; height: 1.1em; transition: transform .3s var(--ease); }
.fig a:hover .fig__go { color: var(--acc); }
.fig a:hover .fig__go svg { transform: translateX(4px); }
.fig a:hover .fig__v { color: var(--acc); }
.fig__v { transition: color .3s; }
.figs__foot { margin-top: 0.8rem; }
.decode { font-variant-numeric: tabular-nums; }

/* ---------- sections ---------- */
.chapter { position: relative; padding-block: clamp(3.5rem, 6.5vw, 7rem); border-top: 1px solid var(--line); }
.ch-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(16px, 4vw, 80px); align-items: end; margin-bottom: clamp(1.75rem, 3.5vw, 3.5rem); }
@media (max-width: 860px) { .ch-head { grid-template-columns: minmax(0, 1fr); } }
.ch-idx { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.1rem; }
.ch-idx span:first-child { font-family: var(--mono); font-size: 0.75rem; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 0.15em 0.7em; }
.ch-idx span + span { flex: 1; height: 1px; background: var(--line); }

/* ---------- tool cards ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(14px, 2vw, 32px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.tcard { min-width: 0; }
.tcard a { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: border-color .3s, transform .5s var(--ease); }
.tcard a:hover { border-color: var(--ink-3); }
.tcard__shot { aspect-ratio: 1200 / 630; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--panel); }
.tcard__shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.tcard a:hover .tcard__shot img { transform: scale(1.035); }
.tcard__body { display: flex; flex-direction: column; gap: 0.6rem; padding: clamp(16px, 1.8vw, 30px); flex: 1; }
.tcard__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 1.2rem + 1.1vw, 2.5rem); line-height: 1.04; margin: 0; letter-spacing: -0.005em; }
.tcard__sum { margin: 0; color: var(--ink-2); max-width: 58ch; text-wrap: pretty; }
.tcard__foot { margin-top: auto; padding-top: 0.8rem; display: flex; justify-content: space-between; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; }
.tcard__asof { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.tcard__go { display: inline-flex; align-items: center; gap: 0.5em; font-size: 0.9rem; color: var(--ink); }
.tcard__go svg { width: 1.1em; height: 1.1em; transition: transform .3s var(--ease); }
.tcard a:hover .tcard__go { color: var(--acc); }
.tcard a:hover .tcard__go svg { transform: translateX(4px); }

/* ---------- made by ---------- */
.made { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 80px); align-items: end; }
@media (max-width: 860px) { .made { grid-template-columns: minmax(0, 1fr); } }
.made__mark { display: flex; align-items: center; gap: 1rem; }
.made__mark img { height: clamp(48px, 4vw, 72px); width: auto; }

/* ---------- 404 ---------- */
.nf { padding-top: calc(var(--header-h) + clamp(2.5rem, 10vh, 8rem)); padding-bottom: clamp(3rem, 8vw, 6rem); }
.nf__text { display: flex; flex-direction: column; gap: clamp(1.1rem, 2.6vh, 1.75rem); }
.nf__list { list-style: none; margin: clamp(2.5rem, 6vw, 5rem) 0 0; padding: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(20px, 4vw, 64px); }
@media (max-width: 760px) { .nf__list { grid-template-columns: minmax(0, 1fr); } }
.nf__list li { border-bottom: 1px solid var(--line); }
.nf__list a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; text-decoration: none; font-family: var(--serif); font-size: clamp(1.3rem, 1.05rem + 0.8vw, 1.9rem); line-height: 1.1; }
.nf__list a svg { width: 1.1rem; height: 1.1rem; flex: none; color: var(--ink-2); transition: transform .3s var(--ease), color .25s; }
.nf__list a:hover { color: var(--acc); }
.nf__list a:hover svg { transform: translateX(4px); color: var(--acc); }

/* ---------- footer ---------- */
.site-footer { position: relative; border-top: 1px solid var(--line); padding-top: clamp(3rem, 6vw, 6rem); overflow: hidden; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 80px); }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: minmax(0, 1fr); } }
.footer-brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.8rem); }
.footer-brand img { height: 1.5em; width: auto; }
.footer-brand i { font-style: italic; }
.footer-note { max-width: 52ch; margin-top: 1.25rem; }
.site-footer h2 { font-family: var(--mono); font-weight: 400; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer ul a { text-decoration: none; color: var(--ink-2); font-size: 0.92rem; }
.site-footer ul a:hover { color: var(--ink); }
.site-footer__base { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem 1.6rem; flex-wrap: wrap; padding-block: 1.6rem; margin-top: clamp(2rem, 4vw, 4rem); border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--ink-2); position: relative; z-index: 1; }
.site-footer__base p { margin: 0; }
.credit a { color: var(--ink); text-decoration-thickness: 1px; }
.site-footer__word { font-family: var(--serif); font-size: clamp(5rem, 24vw, 24rem); line-height: 1; letter-spacing: -0.03em; white-space: nowrap; color: transparent; background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 22%, var(--bg)) 10%, color-mix(in srgb, var(--ink) 4%, var(--bg)) 95%); -webkit-background-clip: text; background-clip: text; text-align: center; margin-top: 1rem; padding: 0 0.1em 0.06em; pointer-events: none; user-select: none; }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.split-line { display: block; overflow: hidden; padding: 0.08em 0.16em 0.22em; margin: -0.08em -0.16em -0.22em; }
.js .split-line > span { display: inline-block; transform: translateY(130%); transition: transform 1.1s var(--ease); }
.js .split-line + .split-line > span { transition-delay: .11s; }
.js .reveal-lines.is-in .split-line > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .split-line > span { transform: none; }
}

/* Reset to default, at the bottom of the theme menu (clears the theme saved for every tool) */
.theme-reset { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; width: 100%; margin-top: 0.35rem; padding: 0.7rem 0.6rem 0.45rem; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.86rem; text-align: left; cursor: pointer; min-height: 2.5rem; }
.theme-reset:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.theme-reset small { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }

/* Footer pattern1: the credit sits under the note, level with the last link (no bottom row) */
.site-footer > .container { padding-bottom: clamp(2rem, 4vw, 4rem); }
.site-footer__grid { row-gap: 1.6rem; }
.foot-credit { margin: 0; font-size: 0.86rem; color: var(--ink-2); line-height: 1.5; }
@media (min-width: 860.02px) {
  .site-footer__grid > div:not(:first-child) { grid-row: 1 / span 2; }
  .foot-credit { grid-column: 1; grid-row: 2; align-self: end; }
}

/* The big footer word goes back to the top (smoothly), and brightens a little on hover */
@property --word-a { syntax: '<percentage>'; inherits: false; initial-value: 22%; }
@property --word-b { syntax: '<percentage>'; inherits: false; initial-value: 4%; }
.site-footer a.site-footer__word, .site-footer button.site-footer__word {
  display: block; width: 100%; border: 0; color: transparent; text-decoration: none; cursor: pointer; pointer-events: auto;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) var(--word-a), var(--bg)) 10%, color-mix(in srgb, var(--ink) var(--word-b), var(--bg)) 95%);
  -webkit-background-clip: text; background-clip: text; transition: --word-a .45s ease, --word-b .45s ease;
}
.site-footer .site-footer__word:hover, .site-footer .site-footer__word:focus-visible { --word-a: 44%; --word-b: 14%; }
.site-footer .site-footer__word:focus-visible { outline-offset: -0.08em; border-radius: 0.1em; }
