/* =========================================================================
   n8nHub — design system
   Light is the default theme; [data-theme="dark"] overrides the tokens.
   Never hard-code a colour in a component — always go through a variable.
   ========================================================================= */

/* ----------------------------------------------------------- 1. tokens -- */

:root {
  /* Light is the default for every visitor; only an explicit toggle switches
     to dark. color-scheme keeps native widgets (scrollbars, form controls)
     in step with the site rather than with the operating system. */
  color-scheme: light;

  /* Light (default) */
  --bg:            #FBFBFD;
  --bg-elevated:   #F3F4F8;
  --surface:       #FFFFFF;
  --surface-2:     #F7F8FB;
  --border:        #E6E8EE;
  --border-strong: #D3D7E2;
  --text:          #1B1F2A;
  --text-muted:    #626B7E;
  --text-faint:    #8A92A6;
  --accent:        #4F46E5;   /* electric indigo — primary actions */
  --accent-hover:  #4338CA;
  --accent-soft:   #EEEDFD;
  --accent-2:      #12B5A5;   /* teal — connector lines / highlights */
  --accent-2-soft: #E2F7F4;
  --warn:          #B4690E;
  --warn-soft:     #FDF3E3;
  --danger:        #C0392B;
  --danger-soft:   #FCEDEB;
  --success:       #0E7C5A;
  --success-soft:  #E3F6EF;

  --radius:        14px;
  --radius-sm:     9px;
  --radius-lg:     22px;
  --radius-pill:   999px;
  --shadow:        0 1px 3px rgba(20,25,40,.06), 0 8px 24px rgba(20,25,40,.05);
  --shadow-lg:     0 2px 6px rgba(20,25,40,.07), 0 18px 48px rgba(20,25,40,.10);
  --ring:          0 0 0 3px rgba(79,70,229,.28);

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", "Consolas", monospace;

  /* Type scale — deliberate steps, not one size for every heading. */
  --step--1: 0.8125rem;
  --step-0:  0.9375rem;
  --step-1:  1.0625rem;
  --step-2:  1.375rem;
  --step-3:  1.75rem;
  --step-4:  2.25rem;
  --step-5:  clamp(2.4rem, 1.4rem + 3.4vw, 3.75rem);

  --container: 1180px;
  --header-h:  64px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #0E1017;
  --bg-elevated:   #12151E;
  --surface:       #171A23;
  --surface-2:     #1D2130;
  --border:        #262A36;
  --border-strong: #363B4C;
  --text:          #EEF0F5;
  --text-muted:    #98A0B3;
  --text-faint:    #79819A;
  --accent:        #7C74FF;
  --accent-hover:  #928BFF;
  --accent-soft:   #211F3A;
  --accent-2:      #2AD4C2;
  --accent-2-soft: #122E30;
  --warn:          #E9A94A;
  --warn-soft:     #2C2418;
  --danger:        #F2796B;
  --danger-soft:   #2E1D1B;
  --success:       #3DD9A4;
  --success-soft:  #10291F;
  --shadow:        0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:     0 2px 6px rgba(0,0,0,.45), 0 18px 48px rgba(0,0,0,.5);
  --ring:          0 0 0 3px rgba(124,116,255,.38);
}

/* ------------------------------------------------------------ 2. reset -- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, ul, ol, dl { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: var(--step-5); letter-spacing: -0.035em; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

code, kbd, .mono { font-family: var(--font-mono); font-size: 0.9em; }

/* Visible keyboard focus everywhere. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------- 3. layout ---- */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container--narrow { max-width: 760px; }
.container--mid { max-width: 940px; }

.section { padding-block: 56px; }
.section--tight { padding-block: 36px; }
.stack > * + * { margin-top: 16px; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--text-muted); margin-top: 6px; max-width: 60ch; }
.section-head__link { font-size: var(--step--1); font-weight: 600; white-space: nowrap; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 600; margin-bottom: 10px;
}
[data-theme="dark"] .eyebrow { color: var(--accent-2); }

.muted { color: var(--text-muted); }
.lead { font-size: var(--step-1); color: var(--text-muted); line-height: 1.65; }
.text-center { text-align: center; }

/* --------------------------------------------------------- 4. header ---- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header { background: var(--bg); }
}

.site-header__inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
  min-width: 0;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name { font-family: var(--font-display); font-size: 1.125rem; letter-spacing: -0.03em; }
.brand__name b { color: var(--accent); font-weight: 700; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  color: var(--text-muted); font-size: var(--step--1); font-weight: 500;
  padding: 8px 11px; border-radius: var(--radius-sm); transition: color .15s ease, background .15s ease;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--text); font-weight: 600; }
.nav a.is-active::after {
  content: ""; display: block; height: 2px; margin-top: 5px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

/* Submit + auth links live in the header on desktop and move into the
   collapsed nav panel on narrow screens, where the bar cannot fit them. */
.nav__mobile-only { display: none; }

.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }

/* --------------------------------------------------------- 5. buttons --- */

.btn {
  --btn-bg: var(--accent); --btn-fg: #fff; --btn-border: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-border);
  font-size: var(--step--1); font-weight: 600; line-height: 1.2; cursor: pointer;
  white-space: nowrap; transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { --btn-bg: var(--accent-hover); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--text); --btn-border: var(--border-strong); }
.btn--ghost:hover { --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-border: var(--border-strong); }
.btn--quiet { --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-border: var(--border); }
.btn--quiet:hover { --btn-bg: var(--bg-elevated); --btn-fg: var(--text); }
.btn--danger { --btn-bg: var(--danger); }
.btn--danger:hover { --btn-bg: var(--danger); filter: brightness(1.08); }
.btn--success { --btn-bg: var(--success); }
.btn--success:hover { --btn-bg: var(--success); filter: brightness(1.08); }
.btn--lg { padding: 13px 24px; font-size: var(--step-0); }
.btn--sm { padding: 6px 12px; font-size: var(--step--1); }
.btn--block { width: 100%; }

/* Google's brand guidance: white button, grey border, its own wordmark colour. */
.btn--google {
  --btn-bg: #FFFFFF; --btn-fg: #3C4043; --btn-border: #DADCE0;
  font-weight: 500;
}
.btn--google:hover { --btn-bg: #F8F9FA; --btn-fg: #3C4043; --btn-border: #D2D3D6; }
[data-theme="dark"] .btn--google {
  --btn-bg: #FFFFFF; --btn-fg: #3C4043; --btn-border: #FFFFFF;
}
[data-theme="dark"] .btn--google:hover { --btn-bg: #F1F3F4; }

/* "or" rule between social and password sign-in. */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 2px; color: var(--text-faint); font-size: var(--step--1);
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* ---------------------------------------------------------- 6. pills ---- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-family: var(--font-mono);
  font-size: 0.6875rem; letter-spacing: .02em; white-space: nowrap;
}
a.pill:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.pill--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.pill--teal   { background: var(--accent-2-soft); border-color: transparent; color: var(--accent-2); }
.pill--warn   { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.pill--danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.pill--success{ background: var(--success-soft); border-color: transparent; color: var(--success); }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ----------------------------------------------------------- 7. hero ---- */

.hero { position: relative; overflow: hidden; padding-block: 84px 64px; border-bottom: 1px solid var(--border); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(680px 340px at 12% -10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    radial-gradient(560px 300px at 88% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 70%);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hero::before { background: none; }
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .85; }
.hero__inner { position: relative; z-index: 1; max-width: 780px; }
.hero h1 { margin-bottom: 18px; }
.hero h1 .accent {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { font-size: var(--step-1); color: var(--text-muted); max-width: 62ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 26px; }
.hero__secondary { margin-top: 16px; font-size: var(--step--1); color: var(--text-muted); }
.hero__stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 40px; }
.hero__stat b {
  display: block; font-family: var(--font-display); font-size: var(--step-3);
  line-height: 1.1; letter-spacing: -0.03em;
}
.hero__stat span { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }

/* --------------------------------------------------------- 8. search ---- */

.searchbar { display: flex; gap: 8px; width: 100%; max-width: 560px; }
.searchbar__field { position: relative; flex: 1; }
.searchbar__field svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}
.searchbar input[type="search"], .searchbar input[type="text"] {
  width: 100%; padding: 12px 16px 12px 42px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.searchbar input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.searchbar input::placeholder { color: var(--text-faint); }

/* ---------------------------------------------------- 9. tool cards ----- */
/* The signature element: cards read as nodes on an n8n canvas, with
   connector ports on their left edge and a hairline connector rail. */

.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.node-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
/* input / output ports */
.node-card::before, .node-card::after {
  content: ""; position: absolute; top: 30px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
  transition: border-color .18s ease, background .18s ease;
}
.node-card::before { left: -5px; }
.node-card::after  { right: -5px; }
.node-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.node-card:hover::before, .node-card:hover::after { border-color: var(--accent-2); background: var(--accent-2); }
.node-card:focus-within { border-color: var(--accent); }

.node-card__top { display: flex; align-items: flex-start; gap: 13px; }
.node-card__logo {
  width: 44px; height: 44px; flex: none; border-radius: 11px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.02em;
}
.node-card__logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.node-card__heading { min-width: 0; flex: 1; }
.node-card__title { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; letter-spacing: -0.02em; }
.node-card__title a { color: var(--text); }
.node-card__title a:hover { color: var(--accent); text-decoration: none; }
/* Stretched link — the title makes the whole card clickable. Anything else
   interactive inside the card must therefore sit above that overlay. */
.node-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); z-index: 0; }
.node-card__host,
.node-card__foot,
.node-card .pill-row,
.node-card .spec-list,
.node-card form { position: relative; z-index: 2; }
.node-card__host { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-faint); margin-top: 3px; }
.node-card__desc { color: var(--text-muted); font-size: var(--step--1); line-height: 1.6; flex: 1; }
.node-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 13px; border-top: 1px dashed var(--border);
}
.node-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-faint); }
.node-card--featured { border-color: color-mix(in srgb, var(--accent) 34%, var(--border)); }
.node-card--rail { position: relative; }

/* connector rail behind a row of cards */
.rail { position: relative; }
.rail__line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.rail > .grid { position: relative; z-index: 1; }

/* --------------------------------------------------------- 10. upvote --- */

.upvote {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 52px; padding: 6px 10px; gap: 1px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer; position: relative; z-index: 2;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .12s ease;
}
.upvote:hover { border-color: var(--accent); color: var(--accent); }
.upvote:active { transform: scale(.96); }
.upvote svg { transition: transform .15s ease; }
.upvote:hover svg { transform: translateY(-1px); }
.upvote__count { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; line-height: 1; }
.upvote.is-voted { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.upvote--lg { min-width: 72px; padding: 12px 16px; }
.upvote--lg .upvote__count { font-size: var(--step-2); }

/* ------------------------------------------------------ 11. categories -- */

.cat-tile {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.cat-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); text-decoration: none; }
.cat-tile__name { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); color: var(--text); letter-spacing: -0.02em; }
.cat-tile__count { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-faint); }
.cat-tile__desc { font-size: var(--step--1); color: var(--text-muted); }
.cat-tile--primary { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 62%); border-color: color-mix(in srgb, var(--accent) 26%, var(--border)); }
.cat-tile__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); display: inline-block; margin-right: 7px; vertical-align: middle; }

.cat-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.cat-strip a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: var(--step--1); font-weight: 500; }
.cat-strip a:hover, .cat-strip a.is-active { color: var(--text); border-color: var(--accent); text-decoration: none; }
.cat-strip a.is-active { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------- 12. forms --- */

.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-size: var(--step--1); font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 0.8125rem; color: var(--text-faint); margin-top: 6px; }
.field .hint--right { float: right; font-family: var(--font-mono); }
/* A label with a trailing action (e.g. "Forgot?") — aligned, not floated. */
.field label.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field label.label-row .hint--right { float: none; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="search"], input[type="number"], select, textarea {
  width: 100%; padding: 11px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }

.field-error { color: var(--danger); font-size: 0.8125rem; margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--step--1); }
.check input { width: auto; margin-top: 3px; }

.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 24px; }

/* choice cards (pricing / hosting radios) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice span {
  display: block; text-align: center; padding: 10px 8px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-size: var(--step--1); transition: all .15s ease;
}
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.choice input:focus-visible + span { box-shadow: var(--ring); }

/* ------------------------------------------- 12b. listing type chooser -- */
/* Step 0 of the submit flow: pick what you are listing before anything else. */

.type-grid { display: grid; gap: 12px; }
.type-choice { position: relative; display: block; }
.type-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.type-choice__body {
  display: block; padding: 18px 20px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.type-choice__body:hover { border-color: var(--accent); transform: translateY(-1px); }
.type-choice input:checked + .type-choice__body {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.type-choice input:focus-visible + .type-choice__body { box-shadow: var(--ring); }
.type-choice__title {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-1); letter-spacing: -0.02em; margin-bottom: 4px;
}
.type-choice__blurb { display: block; color: var(--text-muted); font-size: var(--step--1); }
.type-choice__hint { display: block; color: var(--text-faint); font-size: 0.6875rem; margin-top: 8px; }
.type-choice__badge { margin-top: 12px; }

/* ------------------------------------------------- 12d. image uploads --- */

.dropzone {
  position: relative; display: block; padding: 26px 20px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); text-align: center; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.dropzone__body { pointer-events: none; display: grid; gap: 6px; justify-items: center; color: var(--text-muted); }
.dropzone__body svg { color: var(--accent); }
.dropzone__body p { font-size: var(--step--1); margin: 0; }
.dropzone__list {
  list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
}
.dropzone__list:empty { display: none; }
.dropzone__list li { display: flex; justify-content: space-between; gap: 12px; }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.shot-thumb {
  position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shot-thumb__remove {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px;
  display: grid; place-items: center; cursor: pointer; font-size: 12px; line-height: 1;
  border: none; border-radius: 50%; background: rgba(20,25,40,.72); color: #fff;
}
.shot-thumb__remove:hover { background: var(--danger); }

.logo-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-modes .choice span { padding: 8px 16px; }
.logo-preview { display: flex; align-items: center; gap: 12px; font-size: 0.75rem; }
.logo-preview img {
  width: 56px; height: 56px; object-fit: contain; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}

/* --------------------------------------------------------- 12e. gallery -- */
/* A scroll-snap track: usable as a plain scroll strip without JavaScript. */

.gallery { position: relative; }
.gallery__viewport {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; border-radius: var(--radius);
  scrollbar-width: thin; padding-bottom: 4px;
}
.gallery__viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* A tall screenshot must not push the rest of the page out of view, so slides
   are a fixed, modest height and the image is contained inside them. */
.gallery { --gallery-h: 340px; }
.gallery__slide {
  flex: 0 0 100%; margin: 0; scroll-snap-align: center;
  height: var(--gallery-h);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden;
}
.gallery__slide img {
  width: 100%; height: 100%; display: block;
  object-fit: contain; object-position: center;
}
.gallery--single .gallery__viewport { overflow: visible; }

@media (max-width: 760px) { .gallery { --gallery-h: 220px; } }

.gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  transition: background .15s ease, color .15s ease, opacity .15s ease;
}
.gallery__nav:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.gallery__nav[disabled] { opacity: .3; cursor: default; }
.gallery__nav[disabled]:hover { background: var(--surface); color: var(--text); border-color: var(--border); }
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }

.gallery__dots { display: flex; gap: 7px; justify-content: center; margin-top: 14px; }
.gallery__dot {
  width: 8px; height: 8px; padding: 0; border-radius: 50%; cursor: pointer;
  border: none; background: var(--border-strong); transition: background .15s ease, transform .15s ease;
}
.gallery__dot.is-current { background: var(--accent); transform: scale(1.35); }

@media (prefers-reduced-motion: reduce) {
  .gallery__viewport { scroll-behavior: auto; }
}

/* ------------------------------------------------- 12f. maker socials --- */

.maker-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.maker-socials__link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); font-size: var(--step--1); text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.maker-socials__link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ------------------------------------------------ 12g. verify success --- */

.verify-mark {
  width: 56px; height: 56px; margin: 0 auto; display: grid; place-items: center;
  border-radius: 50%; background: var(--success-soft); color: var(--success);
}

/* --------------------------------------------------------- 12c. blog ---- */

.post-body { font-size: 1.0625rem; line-height: 1.8; }
.post-body h2 {
  font-size: var(--step-2); margin-top: 38px; margin-bottom: 12px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.post-body p + p { margin-top: 18px; }
.post-body ul { margin: 18px 0; padding-left: 22px; list-style: disc; }
.post-body li { margin-bottom: 9px; }
.post-body li::marker { color: var(--accent-2); }
.post-body strong { font-weight: 650; color: var(--text); }

/* --------------------------------------------------------- 13. stepper -- */

.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 32px; }
.stepper__step { display: flex; align-items: center; gap: 10px; flex: none; }
.stepper__num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-faint); flex: none;
}
.stepper__label { font-size: var(--step--1); color: var(--text-faint); white-space: nowrap; }
.stepper__step.is-current .stepper__num { border-color: var(--accent); background: var(--accent); color: #fff; }
.stepper__step.is-current .stepper__label { color: var(--text); font-weight: 600; }
.stepper__step.is-done .stepper__num { border-color: var(--accent-2); background: var(--accent-2); color: #04231F; }
.stepper__step.is-done .stepper__label { color: var(--text-muted); }
.stepper__line { flex: 1; height: 1px; background: var(--border-strong); margin: 0 14px; min-width: 20px; }

/* ---------------------------------------------------------- 14. flash --- */

.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  font-size: var(--step--1); border: 1px solid transparent;
}
.flash--success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.flash--error   { background: var(--danger-soft);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.flash--info    { background: var(--accent-soft);  color: var(--accent);  border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

.notice {
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--step--1); color: var(--text-muted);
}
.notice--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }

/* ----------------------------------------------------- 15. tool page ---- */

.tool-hero { padding-block: 44px 30px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.tool-hero__inner { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.tool-hero__logo {
  width: 76px; height: 76px; flex: none; border-radius: 18px; overflow: hidden;
  display: grid; place-items: center; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
}
.tool-hero__logo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.tool-hero__main { flex: 1; min-width: 260px; }
.tool-hero__main h1 { font-size: var(--step-4); margin-bottom: 8px; }
.tool-hero__tagline { font-size: var(--step-1); color: var(--text-muted); max-width: 62ch; }
.tool-hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tool-hero__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; align-items: start; padding-block: 40px 64px; }
.prose { font-size: var(--step-0); line-height: 1.75; color: var(--text); }
.prose p + p { margin-top: 15px; }
.prose h2 { font-size: var(--step-2); margin-top: 30px; margin-bottom: 12px; }

.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.sidebar-card + .sidebar-card { margin-top: 18px; }
.sidebar-card h3 { font-size: var(--step-0); margin-bottom: 14px; letter-spacing: -0.01em; }
.spec-list { display: grid; gap: 11px; }
.spec-list div { display: flex; justify-content: space-between; gap: 14px; font-size: var(--step--1); }
.spec-list dt, .spec-list .k { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: .06em; text-transform: uppercase; }
.spec-list dd, .spec-list .v { margin: 0; text-align: right; font-weight: 500; }

/* -------------------------------------------------------- 16. comments -- */

.comment-list { display: grid; gap: 16px; margin-top: 20px; }
.comment { display: flex; gap: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-display); font-size: 0.8125rem; font-weight: 600;
}
.comment__body { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px; }
.comment__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.comment__author { font-weight: 600; font-size: var(--step--1); }
.comment__time { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-faint); }
.comment__text { font-size: var(--step--1); color: var(--text-muted); white-space: pre-wrap; }

/* ---------------------------------------------------------- 17. badge --- */

.embed-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; position: relative;
}
.embed-box code {
  display: block; white-space: pre-wrap; word-break: break-all;
  font-size: 0.75rem; color: var(--text-muted); line-height: 1.65;
}
.copy-btn { position: absolute; top: 10px; right: 10px; }
.badge-preview { display: inline-block; padding: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ---------------------------------------------------------- 18. table --- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 640px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th {
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 600; background: var(--surface-2); white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ----------------------------------------------------------- 19. admin -- */

.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding-block: 30px 60px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 3px; }
.admin-nav a { padding: 9px 13px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: var(--step--1); font-weight: 500; }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.admin-nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.admin-nav__title { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 10px 13px 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stat__label { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.stat__value { font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; line-height: 1.1; }
.stat--alert .stat__value { color: var(--warn); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: var(--step-3); }
.page-head p { color: var(--text-muted); font-size: var(--step--1); margin-top: 4px; }

/* ------------------------------------------------------ 20. pagination -- */

.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.pagination__link {
  padding: 8px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-size: var(--step--1); font-family: var(--font-mono);
}
.pagination__link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination__link.is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pagination__gap { color: var(--text-faint); padding: 0 4px; }

/* --------------------------------------------------------- 21. empty ---- */

.empty {
  text-align: center; padding: 56px 24px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--surface);
}
.empty h3 { font-size: var(--step-2); margin-bottom: 8px; }
.empty p { color: var(--text-muted); max-width: 46ch; margin: 0 auto 20px; }

/* --------------------------------------------------------- 22. footer --- */

.site-footer { border-top: 1px solid var(--border); background: var(--bg-elevated); padding-block: 48px 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 34px; }
.footer-brand p { color: var(--text-muted); font-size: var(--step--1); margin-top: 12px; max-width: 34ch; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; margin-bottom: 12px; }
.footer-col ul { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.footer-col a { color: var(--text-muted); font-size: var(--step--1); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.8125rem; color: var(--text-faint);
}

/* ------------------------------------------------------ 23. utilities --- */

.divider { height: 1px; background: var(--border); border: 0; margin-block: 28px; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flex--between { justify-content: space-between; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Scroll reveal is an enhancement, so it is scoped to .js — added by the inline
   head script. Without JavaScript the content is simply visible, never a grid
   of invisible cards waiting for an observer that will never run. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------- 24. responsive ----- */

@media (max-width: 980px) {
  .tool-layout { grid-template-columns: 1fr; gap: 26px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 6px; }
  .admin-nav__title { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
}

/* The full desktop bar (brand + 5 links + Submit + auth) stops fitting around
   900px, so the nav collapses there rather than overflowing the viewport. */
@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 12px 16px 18px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 11px 12px; font-size: var(--step-0); }
  .nav a.is-active::after { display: none; }
  .nav__mobile-only { display: block; }
  .nav__mobile-only.nav__cta { color: var(--accent); font-weight: 600; }
  /* Submit + auth are in the panel now — keep only the icon controls in the bar. */
  .header-actions .btn { display: none; }
}

@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .hero { padding-block: 52px 44px; }
  .hero__stats { gap: 20px; }
  .section { padding-block: 40px; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stepper__label { display: none; }
  .stepper__line { margin: 0 8px; }
  .form-card { padding: 22px 18px; }
  .tool-hero__logo { width: 60px; height: 60px; font-size: 1.25rem; }
}

@media (max-width: 460px) {
  .container { padding-inline: 16px; }
  .hero__actions .btn { width: 100%; }
  .searchbar { flex-direction: column; }
  .searchbar .btn { width: 100%; }
}

/* --------------------------------------------- 25. motion & printing ---- */

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

@media print {
  .site-header, .site-footer, .hero__canvas, .upvote { display: none !important; }
  body { background: #fff; color: #000; }
}
