/* =============================================================
   Foster Tools suite (/tools/): warm-black ground, Instrument Serif display,
   gold Pro accents. Redefines the site tokens so calc.css renders the same
   calculator markup dark here.
   ============================================================= */
:root {
  --bg: #1B1714;
  --bg2: #15120F;
  --surface: #221D19;
  --surface2: #2A241F;
  --border: rgba(255, 240, 220, 0.09);
  --border2: rgba(233, 199, 123, 0.28);
  --text: #F5F1EA;
  --muted: #A89F94;
  --muted2: #7D756C;
  --gold: #E9C77B;
  --gold2: #D9B064;
  --shadow-md: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px rgba(0, 0, 0, 0.35);
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
/* display rules below (.ghost-btn, .panel, .tool-card) must never un-hide [hidden] elements */
[hidden] { display: none !important; }
html { background: var(--bg2); }
body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 var(--font-body);
  color: var(--text);
  background:
    radial-gradient(90% 50% at 50% -10%, rgba(233, 140, 80, 0.10), transparent 70%),
    var(--bg2);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: #F3DBA3; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.suite-wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

/* ── Top bar ── */
.suite-top {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: rgba(21, 18, 15, 0.82);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.suite-top .suite-wrap { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: flex; align-items: baseline; gap: 8px; color: var(--text); }
.wordmark small { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; color: var(--muted); }
.wordmark span { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.suite-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 500; }
.suite-title { font-weight: 600; font-size: 16px; text-align: center; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suite-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pro-pill {
  background: linear-gradient(180deg, #F0D49A, var(--gold2)); color: #2A1F0C;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; padding: 6px 10px; border-radius: 999px; border: 0;
}
.ghost-btn {
  min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border2);
  background: var(--surface); color: var(--gold); font: 600 14px var(--font-body); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.ghost-btn:hover { background: var(--surface2); }
.suite-nav { display: flex; gap: 22px; font-size: 14px; }
.suite-nav a { color: #D8CFC4; }
@media (max-width: 760px) { .suite-nav { display: none; } }

/* ── Drawer ── */
.drawer-hero { padding: 48px 0 28px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.drawer-hero h1 { margin: 0; font: 400 clamp(40px, 6vw, 68px)/1.02 var(--font-display); letter-spacing: -0.01em; max-width: 720px; }
.drawer-hero h1 em { color: var(--gold); }
.drawer-hero p { margin: 12px 0 0; color: #B8AEA2; font-size: 17px; max-width: 560px; }
.search {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; width: min(340px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: 16px var(--font-body); }
.search input::placeholder { color: var(--muted2); }
.section-label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 12px; }
.recent { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 30px; }
.recent a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 500;
}
.recent i { width: 10px; height: 10px; border-radius: 3px; background: var(--tile); }

.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-bottom: 28px; }
.tool-card {
  display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 22px; min-height: 172px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), #1D1814;
  border: 1px solid var(--border); color: var(--text);
  transition: transform 0.25s cubic-bezier(.2, .8, .2, 1), border-color 0.25s, background 0.25s;
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--border2); color: var(--text); }
.tool-card:active { transform: scale(0.98); }
.tool-card[data-status="soon"] { opacity: 0.55; pointer-events: none; }
.tool-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile {
  width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--tile); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 24px rgba(0, 0, 0, 0.35);
}
.tile svg { width: 26px; height: 26px; }
.status { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; color: #6FBF8A; }
.tool-card[data-status="soon"] .status { color: var(--muted); }
.tool-card strong { font-size: 17px; font-weight: 600; display: block; }
.tool-card .blurb { font-size: 14px; line-height: 1.45; color: var(--muted); margin: 4px 0 0; }
.empty-search { color: var(--muted); padding: 12px 0 30px; }
@media (max-width: 980px) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .drawer-hero { padding: 26px 0 18px; }
  .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 8px; }
  .tool-card { padding: 0; min-height: 0; background: none; border: 0; align-items: center; text-align: center; gap: 8px; }
  .tool-card:hover { transform: none; }
  .tool-card .row { justify-content: center; }
  .tool-card .status, .tool-card .blurb { display: none; }
  .tile { width: 64px; height: 64px; border-radius: 19px; }
  .tile svg { width: 30px; height: 30px; }
  .tool-card strong { font-size: 12px; font-weight: 500; line-height: 1.25; }
  .tool-card[data-status="soon"] strong::after { content: "Soon"; display: block; font-size: 10px; letter-spacing: 0.06em; color: var(--muted); margin-top: 2px; }
}

.panel {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
  padding: 16px 20px; border-radius: 18px; margin: 0 0 16px;
  background: linear-gradient(90deg, #2A231D, #1D1814); border: 1px solid var(--border2);
}
.panel p { margin: 0; color: #D8CFC4; font-size: 15px; flex: 1 1 280px; }
.panel .tag { margin-right: 10px; }
.install-panel { border-color: var(--border); }
.install-panel svg { flex-shrink: 0; }
.suite-foot { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--muted2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; }
.suite-foot a { color: var(--muted); }

/* ── Tool page ── */
.tool-main { padding: 22px 0 10px; }
.tool-main .calc { max-width: 980px; }
.tool-main .calc { --calc-on-accent: #15120F; }
.tool-main .result { background: radial-gradient(120% 90% at 15% 0%, var(--calc-accent-soft), transparent 70%), #1E1915; border: 1px solid var(--border); }
.tool-main .result-value { font-family: var(--font-display); font-weight: 400; font-size: clamp(56px, 12vw, 92px); letter-spacing: -0.01em; line-height: 0.95; }
.tool-main .result-stats div { background: rgba(255, 255, 255, 0.04); }
.tool-main .calc-warning { color: #FCD9B6; background: rgba(234, 88, 12, 0.16); }
.tool-main .calc-app { display: none; }
.tool-intro { max-width: 980px; margin: 0 auto 18px; display: flex; align-items: center; gap: 14px; }
.tool-intro .tile { width: 44px; height: 44px; border-radius: 13px; }
.tool-intro .tile svg { width: 22px; height: 22px; }
.tool-intro h1 { margin: 0; font: 400 clamp(30px, 5vw, 40px)/1 var(--font-display); }
.tool-intro p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.offline-dot { display: inline-flex; align-items: center; gap: 6px; }
.offline-dot::before { content: ""; width: 7px; height: 7px; border-radius: 4px; background: #6FBF8A; }
html[data-standalone="true"] .hide-standalone { display: none !important; }

/* ── Install steps sheet (browsers without an install prompt) ── */
.install-sheet {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(10, 8, 6, 0.6);
  animation: install-fade 0.2s ease;
}
.install-sheet__card {
  width: min(420px, 100%); padding: 24px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border2); box-shadow: var(--shadow-md);
  animation: install-rise 0.35s cubic-bezier(.2, .8, .2, 1);
}
.install-sheet h2 { margin: 0 0 14px; font: 400 30px/1.1 var(--font-display); }
.install-sheet ol { margin: 0 0 20px; padding-left: 22px; color: #D8CFC4; font-size: 15px; line-height: 1.5; }
.install-sheet li + li { margin-top: 10px; }
.install-sheet li b { color: var(--text); font-weight: 600; }
.install-sheet li svg { vertical-align: -3px; color: var(--gold); }
.install-sheet .ghost-btn { width: 100%; justify-content: center; }
@media (min-width: 761px) { .install-sheet { align-items: center; } }
@keyframes install-fade { from { opacity: 0; } }
@keyframes install-rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .install-sheet, .install-sheet__card { animation: none; } }
