@charset "utf-8";
/* ============================================================================
   Ultra Tools — shared shell
   A light, editorial page around a dark tool. The contrast is the point: the
   tool should read as an instrument set into a clean printed page.
   Everything here is shell. Tool-specific CSS ships inline, scoped to #root.
   ========================================================================== */

/* ─────────────────────────── tokens ─────────────────────────── */
:root {
  /* Warm paper ground rather than pure white — pure #fff next to a near-black
     tool frame reads as glare. */
  --paper:        oklch(98.8% 0.003 95);
  --paper-raised: oklch(100%  0     0);
  --paper-sunk:   oklch(96.6% 0.005 95);
  --paper-tint:   oklch(94.6% 0.008 95);

  --ink:      oklch(22%   0.021 268);
  --ink-2:    oklch(48%   0.018 268);
  --ink-3:    oklch(63%   0.014 268);
  --rule:     oklch(90.5% 0.006 268);
  --rule-2:   oklch(84%   0.008 268);

  --accent:      oklch(56% 0.196 274);
  --accent-deep: oklch(48% 0.196 274);
  --accent-wash: oklch(56% 0.196 274 / 0.09);
  --accent-edge: oklch(56% 0.196 274 / 0.28);

  /* Category hues. Each surface pulls --cat-* from a [data-cat] scope. */
  --cat-dev:      oklch(56% 0.196 274);
  --cat-business: oklch(52% 0.132 168);
  --cat-content:  oklch(56% 0.148 52);
  --cat-design:   oklch(56% 0.196 330);
  --cat: var(--accent);

  /* Tool frame chrome — matches the dark tools it wraps. */
  --frame:      oklch(16.5% 0.014 268);
  --frame-edge: oklch(28%   0.018 268);

  --font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --step--1: clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --step-0:  clamp(0.9375rem, 0.91rem + 0.14vw, 1.0313rem);
  --step-1:  clamp(1.0625rem, 1.01rem + 0.27vw, 1.25rem);
  --step-2:  clamp(1.375rem,  1.26rem + 0.55vw, 1.75rem);
  --step-3:  clamp(1.75rem,   1.53rem + 1.1vw,  2.5rem);
  --step-4:  clamp(2.125rem,  1.6rem  + 2.6vw,  4rem);

  --gutter:  clamp(1rem, 0.55rem + 2.2vw, 3rem);
  --measure: 42rem;
  --shell:   80rem;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --ease: cubic-bezier(0.2, 0.75, 0.3, 1);
  --fast: 140ms;
  --slow: 340ms;

  --tool-h: clamp(34rem, 76vh, 54rem);

  color-scheme: light;
}

/* ─────────────────────────── reset ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* The tool frame can scroll internally; the page itself never scrolls sideways. */
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection { background: var(--accent-wash); }

.u-visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: var(--r-sm);
  font-size: var(--step--1); font-weight: 600; text-decoration: none;
  transition: top var(--fast) var(--ease);
}
.skip-link:focus { top: 8px; }

/* ─────────────────────────── nav ─────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1rem;
  height: 60px;
  padding-inline: var(--gutter);
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--rule);
  view-transition-name: site-nav;
}
@supports (backdrop-filter: blur(1px)) {
  .site-nav { backdrop-filter: blur(14px) saturate(1.6); -webkit-backdrop-filter: blur(14px) saturate(1.6); }
}

.nav-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-size: 1.125rem; font-weight: 700; letter-spacing: -0.025em;
  text-decoration: none; color: var(--ink);
  white-space: nowrap;
}
.nav-brand em { font-style: normal; color: var(--accent); }
.nav-brand svg { flex: none; }

.nav-links { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 7px 11px; border-radius: var(--r-sm);
  font-size: 0.84rem; font-weight: 500; letter-spacing: -0.005em;
  color: var(--ink-2); text-decoration: none;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--paper-tint); }
.nav-links a[aria-current="page"] { color: var(--accent); background: var(--accent-wash); }
.nav-links .nav-all {
  margin-left: 6px; padding-inline: 13px;
  color: var(--ink); font-weight: 600;
  border: 1px solid var(--rule-2);
}
.nav-links .nav-all:hover { border-color: var(--accent-edge); color: var(--accent); background: var(--accent-wash); }

/* Below the fold of a phone the link row would wrap into three lines; the
   brand plus the all-tools affordance is what people actually need there. */
@media (max-width: 860px) {
  .nav-links a:not(.nav-all) { display: none; }
  .nav-links { margin-left: auto; }
}

/* ─────────────────────────── hero ─────────────────────────── */
.hero {
  max-width: 52rem; margin-inline: auto;
  padding: clamp(2.25rem, 1.4rem + 3.4vw, 4rem) var(--gutter) clamp(1.25rem, 1rem + 1vw, 1.75rem);
  text-align: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cat);
  background: color-mix(in oklab, var(--cat) 9%, transparent);
  border: 1px solid color-mix(in oklab, var(--cat) 22%, transparent);
  padding: 5px 13px; border-radius: 100px;
  margin-bottom: 1.25rem;
}
.eyebrow::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--cat); flex: none;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--step-4); font-weight: 700;
  line-height: 1.04; letter-spacing: -0.035em;
  text-wrap: balance;
  margin-bottom: 1.125rem;
}
.hero-lede {
  max-width: 38rem; margin-inline: auto;
  font-size: var(--step-1); color: var(--ink-2);
  line-height: 1.6; text-wrap: pretty;
}
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.4rem 1.5rem; margin-top: 1.5rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta span::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--cat); opacity: 0.7;
}

/* ─────────────────────────── ad slots ─────────────────────────── */
/* Exact IAB dimensions, switching to mobile units under 720px. The slot
   collapses entirely when nothing renders — an empty reserved box is worse
   than no box, both for layout shift and for how the page reads. */
.ad-slot {
  display: flex; justify-content: center;
  margin-inline: auto; padding-inline: var(--gutter);
}
.ad-slot--top { padding-block: 1.25rem 0.25rem; }
.ad-slot--mid { padding-block: 2rem; }
.ad-slot--bot { padding-block: 1.5rem 2rem; }
.ad-slot[data-state="empty"] { display: none; }

.ad-unit { display: block; max-width: 100%; }
.ad-unit--leaderboard { width: 728px; height: 90px; }
.ad-unit--rectangle   { width: 336px; height: 280px; }
.ad-unit--banner      { width: 468px; height: 60px; }
@media (max-width: 720px) {
  .ad-unit--leaderboard,
  .ad-unit--banner    { width: 320px; height: 50px; }
  .ad-unit--rectangle { width: 300px; height: 250px; }
}

.ad-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(135deg,
      transparent 0 7px,
      color-mix(in oklab, var(--ink) 3.5%, transparent) 7px 8px),
    var(--paper-sunk);
  border: 1px dashed var(--rule-2); border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 0.65rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
}
.ad-ph .sm { display: none; }
@media (max-width: 720px) {
  .ad-ph .lg { display: none; }
  .ad-ph .sm { display: inline; }
}

/* ─────────────────────────── tool frame ─────────────────────────── */
.tool-section { padding: 0 var(--gutter) 0.5rem; }
.tool-frame {
  max-width: var(--shell); margin-inline: auto;
  background: var(--frame);
  border-radius: var(--r-xl);
  overflow: clip;
  box-shadow:
    0 1px 2px oklch(20% 0.02 268 / 0.07),
    0 12px 32px -8px oklch(20% 0.02 268 / 0.22),
    0 40px 80px -32px oklch(20% 0.02 268 / 0.28);
  view-transition-name: tool-frame;
}
.frame-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  background: oklch(100% 0 0 / 0.035);
  border-bottom: 1px solid var(--frame-edge);
}
.frame-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.frame-dot:nth-child(1) { background: #ff5f57; }
.frame-dot:nth-child(2) { background: #febc2e; }
.frame-dot:nth-child(3) { background: #28c840; }
.frame-title {
  margin-left: 6px;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.02em; color: oklch(100% 0 0 / 0.42);
}
.frame-live {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.65rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: oklch(100% 0 0 / 0.34);
}
.frame-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #28c840; box-shadow: 0 0 0 3px oklch(75% 0.2 145 / 0.16);
}
@media (max-width: 560px) { .frame-live { display: none; } }

/* The tools were built as full-screen apps. The viewport gives them a definite
   box to fill; anything wider than the phone pans inside the frame instead of
   pushing the page sideways. */
.tool-viewport {
  height: var(--tool-h);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--frame);
}
/* The tools' own root element sizes itself with height:100%. That only
   resolves against a parent with a definite height, so #root is pinned to the
   frame rather than left at min-height:auto — otherwise apps whose stylesheet
   used min-height:100vh collapse to their content height inside the frame. */
.tool-viewport > #root { height: 100%; }
.tool-hint {
  display: none;
  max-width: var(--shell); margin: 0.625rem auto 0;
  font-size: 0.78rem; color: var(--ink-3); text-align: center;
}
@media (max-width: 860px) {
  :root { --tool-h: 32rem; }
  .tool-hint { display: block; }
  /* The tools have no mobile breakpoints of their own: a 440px sidebar simply
     sits outside a 360px screen, and the tool's own overflow:hidden clips it
     away rather than letting it be reached. Releasing that lets the frame pan,
     so the whole interface stays available on a phone. */
  .tool-viewport > #root { overflow: visible; }
}

/* ─────────────────────────── content sections ─────────────────────────── */
.prose-section {
  max-width: var(--measure); margin-inline: auto;
  padding: clamp(2.5rem, 1.8rem + 2.6vw, 4rem) var(--gutter) 0;
}
.prose-section--wide { max-width: 62rem; }
.section-head { margin-bottom: 1.75rem; }
.section-kicker {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cat); margin-bottom: 0.6rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--step-2); font-weight: 700;
  letter-spacing: -0.028em; line-height: 1.15; text-wrap: balance;
}
.section-head p {
  margin-top: 0.6rem; color: var(--ink-2); text-wrap: pretty;
}

/* How-to steps — a hairline rail rather than a row of boxes. */
.steps { display: grid; gap: 0; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 2.75rem 1fr; gap: 1.125rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}
.step:last-child { border-bottom: 1px solid var(--rule); }
.step-n {
  counter-increment: step;
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border: 1px solid color-mix(in oklab, var(--cat) 26%, transparent);
  background: color-mix(in oklab, var(--cat) 7%, transparent);
  border-radius: var(--r);
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 500;
  color: var(--cat);
}
.step-n::after { content: counter(step, decimal-leading-zero); }
.step h3 {
  font-family: var(--font-display);
  font-size: var(--step-1); font-weight: 600;
  letter-spacing: -0.015em; margin-bottom: 0.25rem;
}
.step p { color: var(--ink-2); font-size: var(--step-0); text-wrap: pretty; }
.step code, .faq-a code, .hero-lede code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--paper-tint); padding: 0.1em 0.38em;
  border-radius: 5px; color: var(--ink);
}

/* FAQ — grid-template-rows animates cleanly to intrinsic height, so long
   answers never get clipped the way a max-height guess does. */
.faq { border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-q {
  width: 100%; display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.125rem 0; background: none; border: 0;
  text-align: left; cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--step-1); font-weight: 600; letter-spacing: -0.012em;
  color: var(--ink);
  transition: color var(--fast) var(--ease);
}
.faq-q:hover { color: var(--cat); }
.faq-q::after {
  content: ''; flex: none; margin-left: auto;
  width: 1.5rem; height: 1.5rem; margin-top: 0.15rem;
  border: 1px solid var(--rule-2); border-radius: 50%;
  background:
    linear-gradient(var(--ink-2) 0 0) center / 9px 1.5px no-repeat,
    linear-gradient(var(--ink-2) 0 0) center / 1.5px 9px no-repeat;
  transition: transform var(--slow) var(--ease), border-color var(--fast) var(--ease);
}
.faq-q[aria-expanded="true"]::after {
  transform: rotate(135deg);
  border-color: var(--cat);
}
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--slow) var(--ease); }
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p {
  padding-bottom: 1.25rem; padding-right: 2.5rem;
  color: var(--ink-2); text-wrap: pretty;
}

/* ─────────────────────────── tool cards ─────────────────────────── */
.card-grid {
  display: grid; gap: 0.875rem;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
}
.tool-card {
  container-type: inline-size;
  display: grid; grid-template-columns: 2.5rem 1fr; gap: 0 0.875rem;
  align-content: start;
  padding: 1.125rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  text-decoration: none; color: inherit;
  transition: border-color var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}
/* Subgrid keeps the title and description baselines aligned across every card
   in a row, whatever the name length. */
@supports (grid-template-rows: subgrid) {
  .card-grid { grid-auto-rows: auto; }
  .tool-card { grid-template-rows: subgrid; grid-row: span 2; }
}
.tool-card:hover {
  border-color: color-mix(in oklab, var(--cat) 40%, var(--rule));
  box-shadow: 0 1px 2px oklch(20% 0.02 268 / 0.05),
              0 10px 24px -12px color-mix(in oklab, var(--cat) 45%, transparent);
  transform: translateY(-2px);
}
.tool-card:active { transform: translateY(0); }
.card-icon {
  grid-row: 1 / span 2;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border-radius: 11px;
  color: var(--cat);
  background: color-mix(in oklab, var(--cat) 9%, transparent);
  border: 1px solid color-mix(in oklab, var(--cat) 18%, transparent);
  transition: background var(--fast) var(--ease);
}
.tool-card:hover .card-icon { background: color-mix(in oklab, var(--cat) 15%, transparent); }
.card-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card-name {
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 600; letter-spacing: -0.015em;
  align-self: end;
}
.card-desc { font-size: 0.8rem; color: var(--ink-3); line-height: 1.45; }
@container (max-width: 14rem) {
  .card-desc { display: none; }
  .tool-card { align-items: center; }
}

/* ─────────────────────────── footer ─────────────────────────── */
.site-footer {
  margin-top: clamp(3rem, 2rem + 3vw, 5rem);
  border-top: 1px solid var(--rule);
  background: var(--paper-sunk);
  padding: clamp(2rem, 1.5rem + 2vw, 3rem) var(--gutter);
}
.footer-inner {
  max-width: var(--shell); margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 1rem 2rem;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1rem; letter-spacing: -0.025em;
  text-decoration: none; color: var(--ink);
}
.footer-brand em { font-style: normal; color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.footer-links a {
  font-size: 0.82rem; color: var(--ink-2); text-decoration: none;
  transition: color var(--fast) var(--ease);
}
.footer-links a:hover { color: var(--accent); }
.footer-note {
  width: 100%; margin-top: 0.5rem;
  font-size: 0.78rem; color: var(--ink-3);
}

/* ─────────────────────────── motion ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
}
