/* =========================================================================
   Acute Tools — shared design system (Holt & Gander brand)
   Cool teal-tinted neutrals, teal + amber accents, Space Grotesk display.
   Light + dark via prefers-color-scheme.
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg:        #f4f8f7;
  --bg-soft:   #eaf1ef;
  --panel:     #ffffff;
  --panel-2:   #f7fbfa;
  --ink:       #0b1f1d;
  --ink-soft:  #34514d;
  --ink-faint: #5f7975;
  --line:      rgba(1, 60, 56, 0.10);
  --line-2:    rgba(1, 60, 56, 0.17);
  --accent:    #015e56;   /* Holt & Gander teal */
  --accent-ink:#013f39;
  --accent-bg: #e2efeb;
  --amber:     #d4871f;   /* Holt & Gander amber */
  --amber-ink: #b06a14;
  --amber-bg:  #f6ecd8;
  --danger:    #b4452f;
  --danger-bg: #f7e6e1;
  --warn:      #b06a14;
  --warn-bg:   #f6ecd8;
  --add:       #117a52;
  --add-bg:    #e2f0e9;
  --rm:        #b4452f;
  --rm-bg:     #f7e6e1;
  --chg:       #8a6d1c;
  --chg-bg:    #f6efda;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(1,31,29,.05), 0 10px 30px rgba(1,31,29,.07);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
  --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0c1614;
    --bg-soft:   #111d1a;
    --panel:     #13201d;
    --panel-2:   #182723;
    --ink:       #e8efed;
    --ink-soft:  #a9bdb8;
    --ink-faint: #7a908b;
    --line:      rgba(255,255,255,.09);
    --line-2:    rgba(255,255,255,.15);
    --accent:    #5fb89e;
    --accent-ink:#8fd3bd;
    --accent-bg: #16302a;
    --amber:     #e3bd78;
    --amber-ink: #e3bd78;
    --amber-bg:  #2a2113;
    --danger:    #e07a62;
    --danger-bg: #341f1a;
    --warn:      #d6a652;
    --warn-bg:   #2a2113;
    --add:       #6fc78c;
    --add-bg:    #14271d;
    --rm:        #e07a62;
    --rm-bg:     #341f1a;
    --chg:       #d6a652;
    --chg-bg:    #2a2113;
    --shadow:    0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Page chrome ---------------------------------------------------------- */

.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .01em;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }

.site-header__links { font-size: 13px; color: var(--ink-faint); display: flex; gap: 16px; }

.tool {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 40px;
}

.tool__title {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 18px 0 8px;
  font-weight: 680;
}
.tool__tagline {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 62ch;
}

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px 36px;
  color: var(--ink-faint);
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--ink-soft); }

/* ---- Panels & layout ------------------------------------------------------ */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel + .panel { margin-top: 16px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--split { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.cols { display: grid; gap: 16px; }
@media (min-width: 720px) { .cols--2 { grid-template-columns: 1fr 1fr; } }

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 7px;
}

/* ---- Inputs --------------------------------------------------------------- */

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  resize: vertical;
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { min-height: 150px; line-height: 1.5; }
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
textarea::placeholder, input::placeholder { color: var(--ink-faint); }
select { font-family: var(--sans); cursor: pointer; }

input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ---- Dropzone ------------------------------------------------------------- */

.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.dropzone:hover { border-color: var(--accent); color: var(--ink); }
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-ink); }
.dropzone__big { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.dropzone__hint { font-size: 13px; color: var(--ink-faint); margin: 0; }
.dropzone input[type="file"] { display: none; }

/* ---- Buttons -------------------------------------------------------------- */

.btn {
  appearance: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .12s ease, border-color .12s ease, transform .04s ease, opacity .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); border-color: var(--ink-faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-bg); }

.btn--primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { .btn--primary { color: #0e1a16; } }

.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn--ghost:hover { background: var(--bg-soft); border-color: var(--line); }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--danger { color: var(--danger); border-color: var(--line-2); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* ---- Toggles -------------------------------------------------------------- */

.toggle-row { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__sw {
  width: 30px; height: 18px; border-radius: 999px;
  background: var(--line-2); position: relative; transition: background .14s ease; flex: none;
}
.toggle__sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transition: transform .14s ease; box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.toggle input:checked + .toggle__sw { background: var(--accent); }
.toggle input:checked + .toggle__sw::after { transform: translateX(12px); }
.toggle:has(input:checked) { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-bg); }
.toggle input:focus-visible + .toggle__sw { box-shadow: 0 0 0 3px var(--accent-bg); }

/* ---- Badges / chips ------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-soft); border: 1px solid var(--line);
}
.badge--accent { background: var(--accent-bg); color: var(--accent-ink); border-color: transparent; }
.badge--warn   { background: var(--warn-bg);   color: var(--warn);       border-color: transparent; }
.badge--danger { background: var(--danger-bg); color: var(--danger);     border-color: transparent; }
.badge--add    { background: var(--add-bg);    color: var(--add);        border-color: transparent; }
.badge--rm     { background: var(--rm-bg);     color: var(--rm);         border-color: transparent; }
.badge--chg    { background: var(--chg-bg);    color: var(--chg);        border-color: transparent; }

.chip {
  font-family: var(--mono); font-size: 12.5px;
  padding: 4px 9px; border-radius: 6px;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--ink-soft); cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }

kbd {
  font-family: var(--mono); font-size: 12px;
  background: var(--bg-soft); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--ink-soft);
}

/* ---- Result / output ------------------------------------------------------ */

.result {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.result--plain { font-family: var(--sans); white-space: normal; }
.muted { color: var(--ink-faint); }
.tally { font-size: 13px; color: var(--ink-faint); margin-top: 8px; }

/* Markdown-ish output blocks (AI tools render into .md) */
.md { font-family: var(--sans); line-height: 1.6; }
.md h1, .md h2, .md h3 { line-height: 1.25; margin: 18px 0 8px; }
.md h2 { font-size: 18px; } .md h3 { font-size: 15px; }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 4px 0; }
.md code { font-family: var(--mono); font-size: .9em; background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md strong { font-weight: 680; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---- Diff rows (ConfigDiff, FixJSON change-lists, Redactor, etc.) ---------- */

.diff-group { margin-top: 6px; }
.diff-group__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  margin: 14px 0 6px;
}
.diff-line {
  font-family: var(--mono); font-size: 13px;
  padding: 6px 10px; border-radius: 6px; margin: 3px 0;
  border: 1px solid transparent; word-break: break-word;
}
.diff-line--add { background: var(--add-bg); color: var(--add); }
.diff-line--rm  { background: var(--rm-bg);  color: var(--rm); }
.diff-line--chg { background: var(--chg-bg); color: var(--chg); }
.diff-path { opacity: .8; }
.mark {
  background: var(--warn-bg); color: var(--warn);
  border-radius: 4px; padding: 0 3px; font-family: var(--mono); font-size: .92em;
}

/* ---- Tables (SnapTable, PromptMeter) -------------------------------------- */

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.grid { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.grid th, table.grid td {
  border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top;
}
table.grid th { background: var(--bg-soft); font-weight: 650; position: sticky; top: 0; }
table.grid td[contenteditable] { cursor: text; }
table.grid td[contenteditable]:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-bg); }
table.grid tr:nth-child(even) td { background: var(--panel-2); }

/* ---- Disclaimer ----------------------------------------------------------- */

.disclaimer {
  font-size: 12.5px; color: var(--ink-soft);
  background: var(--warn-bg); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 10px 13px; margin-top: 14px;
}

/* ---- Spinner / loading ---------------------------------------------------- */

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.is-busy { pointer-events: none; opacity: .7; }

/* ---- Toast ---------------------------------------------------------------- */

.toast-wrap {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg);
  font-size: 13px; font-weight: 500;
  padding: 9px 15px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease;
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast--err { background: var(--danger); color: #fff; }

/* ---- Hub (index) ---------------------------------------------------------- */

.hub { max-width: 1040px; margin: 0 auto; padding: 30px 20px 56px; }
.hub__hero { margin: 18px 0 6px; }
.hub__hero h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -.03em; margin: 0 0 10px; font-weight: 720; }
.hub__hero p { color: var(--ink-soft); font-size: 17px; max-width: 60ch; margin: 0; }
.hub__sectionhead {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin: 34px 0 12px;
}
.cardgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 17px; box-shadow: var(--shadow);
  transition: transform .08s ease, border-color .12s ease, box-shadow .12s ease;
}
.card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 4px 14px rgba(28,27,25,.08), 0 12px 30px rgba(28,27,25,.07); }
.card__name { font-size: 17px; font-weight: 680; color: var(--ink); margin: 0 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card__desc { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.5; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* =========================================================================
   Brand refresh (Holt & Gander) — fonts, hero band, back-link, polish.
   Appended so it overrides the base rules above via the cascade.
   ========================================================================= */

/* Display font on titles, brand, and hub chrome */
.brand,
.tool__title,
.hub__hero h1,
.hub__sectionhead,
.card__name,
.hero-band h1,
.hero-eyebrow { font-family: var(--display); }
.tool__title, .hero-band h1 { letter-spacing: -.025em; }

/* Header: brand dot + a real link back to holtandgander.com */
.brand__dot { box-shadow: 0 0 0 3px var(--accent-bg); }
.site-header__links a { color: var(--ink-soft); font-weight: 500; }
.site-header__links a:hover { color: var(--accent-ink); text-decoration: none; }

/* ---- Full-bleed hero band (hub) ---- */
.hero-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #02322d 0%, #013f39 48%, #015e56 100%);
  color: #fff;
}
.hero-band__inner {
  position: relative; z-index: 2;
  max-width: 1040px; margin: 0 auto;
  padding: clamp(48px, 9vw, 92px) 20px clamp(40px, 7vw, 68px);
}
.hero-eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: #f3bf72; margin: 0 0 14px;
}
.hero-band h1 {
  font-size: clamp(32px, 6vw, 54px); line-height: 1.05; margin: 0 0 16px;
  font-weight: 700; max-width: 17ch;
}
.hero-band h1 .accent { color: #f3bf72; }
.hero-sub { font-size: clamp(16px, 2.2vw, 19px); color: #cfe3dd; max-width: 58ch; margin: 0; line-height: 1.55; }

/* Aurora blobs behind the hero (GPU-friendly transforms; reduced-motion aware) */
.aurora { position: absolute; inset: 0; z-index: 1; pointer-events: none; filter: blur(64px); opacity: .5; }
.aurora span { position: absolute; display: block; border-radius: 50%; }
.aurora .a1 { width: 380px; height: 380px; background: #2aa193; top: -130px; left: -60px; animation: hg-drift1 22s ease-in-out infinite; }
.aurora .a2 { width: 320px; height: 320px; background: #d4871f; bottom: -150px; right: 6%; animation: hg-drift2 27s ease-in-out infinite; }
.aurora .a3 { width: 300px; height: 300px; background: #0a7068; top: 14%; right: 28%; animation: hg-drift3 31s ease-in-out infinite; }
@keyframes hg-drift1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(40px,28px)} }
@keyframes hg-drift2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-32px,-22px)} }
@keyframes hg-drift3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(22px,-30px)} }
@media (prefers-reduced-motion: reduce) { .aurora span { animation: none; } }

/* Hub now sits below the hero band */
.hub { padding-top: 30px; }
.hub__sectionhead { color: var(--accent-ink); }

/* Card polish */
.card { transition: transform .12s ease, box-shadow .14s ease, border-color .14s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.site-footer a:hover { color: var(--accent-ink); }

/* =========================================================================
   Navbar ported from holtandgander.com — scoped under .nav so it can't
   collide with the tools' own .brand / .btn. Same look; links are tools-aware.
   ========================================================================= */
:root { --ease: cubic-bezier(.22,.61,.36,1); --nav-bg: rgba(244,248,247,.72); --nav-bg-scrolled: rgba(244,248,247,.93); }
@media (prefers-color-scheme: dark) { :root { --nav-bg: rgba(12,22,20,.6); --nav-bg-scrolled: rgba(12,22,20,.88); } }

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.nav.scrolled { background: var(--nav-bg-scrolled); border-bottom-color: var(--line); box-shadow: 0 8px 30px -18px rgba(2,40,36,.28); }
.nav .nav-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; transition: height .25s var(--ease);
}
.nav.scrolled .nav-inner { height: 62px; }
.nav .brand { display: inline-flex; align-items: center; gap: 11px; font-size: inherit; font-weight: inherit; color: var(--ink); }
.nav .brand:hover { color: var(--ink); text-decoration: none; }
.nav .brand-mark { width: 32px; height: 32px; flex: none; display: block; transition: transform .4s var(--ease); }
.nav .brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }
.nav .brand-name { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.nav .brand-name .amp { color: var(--amber); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.nav-cta) { color: var(--ink-soft); font-size: 15px; font-weight: 500; position: relative; }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: linear-gradient(90deg, #0a7068, var(--amber));
  border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .28s var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--ink); text-decoration: none; }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #0a7068, #013f39); border: 1px solid transparent;
  transition: transform .12s var(--ease), box-shadow .22s var(--ease);
}
.nav-cta:hover { color: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 26px -8px rgba(1,94,86,.55); }
@media (max-width: 460px) { .nav-links { gap: 14px; } .nav-links a:not(.nav-cta) { display: none; } }
