:root {
  --bg: #f6f4f0;
  --bg-warm: #eee9e2;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #5a5550;
  --text-tertiary: #8a847d;
  --border: #d8d2ca;
  --border-light: #e8e3dc;
  --accent: #c44b28;
  --accent-soft: rgba(196, 75, 40, 0.07);
  --accent-border: rgba(196, 75, 40, 0.22);
  --ink: #2c2926;
  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --max-width: 720px;
  --radius-card: 20px;
  --t: 0.18s ease;
}

[data-theme="dark"] {
  --bg: #2b2e33;
  --bg-warm: #333740;
  --bg-card: #32363d;
  --text: #e0ddd8;
  --text-secondary: #a8a29e;
  --text-tertiary: #8a847d;
  --border: #3e4249;
  --border-light: #353940;
  --accent: #00d2ff;
  --accent-soft: rgba(0, 210, 255, 0.09);
  --accent-border: rgba(0, 210, 255, 0.25);
  --ink: #f6f3f3;
}

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

html {
  scroll-behavior: smooth;
  position: relative;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t), color var(--t);
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---- Nav ---- */

header {
  padding: 2rem 0 0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-logo-link {
  text-decoration: none;
  color: var(--text);
  transition: color var(--t);
}

.site-logo-link:hover {
  color: var(--text-secondary);
}

.site-logo-svg {
  height: 36px;
  width: 36px;
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
}

.nav-right a {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  transition: color 0.15s;
}

.nav-right a:hover {
  color: var(--text);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 0.3rem;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  border-radius: 6px;
}

.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

.icon-moon { display: block; }
.icon-sun  { display: none;  }

[data-theme="dark"] .icon-moon { display: none;  }
[data-theme="dark"] .icon-sun  { display: block; }

/* ---- Intro ---- */

.intro {
  padding: 4rem 0 3rem;
}

.intro-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-tertiary);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.intro-heading {
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 0.9rem;
  cursor: default;
  display: inline-block;
  user-select: none;
}

.intro-bio {
  font-size: 0.97rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 500px;
}

.intro-bio strong {
  color: var(--text);
  font-weight: 500;
}

/* ---- Section label ---- */

.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ---- Tool Grid ---- */

.tools-section {
  margin-bottom: 4rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 1.8rem 1.6rem 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 190px;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--t),
    background var(--t),
    transform 0.16s ease,
    box-shadow 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Shine line at top */
.tool-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  pointer-events: none;
}

[data-theme="dark"] .tool-card::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
}

/* Colored top stripe on hover */
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--tool-color, var(--accent));
  opacity: 0;
  transition: opacity var(--t);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

[data-theme="dark"] .tool-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.tool-card:active {
  transform: scale(0.97);
  box-shadow: none;
}

.tool-icon {
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.tool-icon svg {
  width: 100%;
  height: 100%;
}

.tool-name {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.3;
}

.tool-type {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.tool-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-top: 0.35rem;
  flex: 1;
}

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-light);
}

.tool-status {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-tertiary);
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  flex-shrink: 0;
}

.dot.live { background: #22c55e; }
.dot.wip  { background: #f59e0b; }

.tool-arrow {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.15s, transform 0.15s;
}

.tool-card:hover .tool-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

/* Per-card stripe colors */
.card-vat     { --tool-color: #c44b28; }
.card-lf      { --tool-color: #22c55e; }
.card-lego    { --tool-color: #f59e0b; }
.card-energy  { --tool-color: #6366f1; }
.card-sublist { --tool-color: #60a5fa; }
.card-etf       { --tool-color: #d97706; }
.card-finance   { --tool-color: #0ea5e9; }
.card-snipvault { --tool-color: #2d9e6b; }
.card-wanderly  { --tool-color: #0891b2; }
.card-apikey    { --tool-color: #f43f5e; }

/* ---- Stack ---- */

.stack-block {
  padding: 1.2rem 1.4rem;
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 4rem;
  transition: background var(--t), border-color var(--t);
}

.stack-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.45rem;
}

.stack-block p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.stack-block code {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

/* ---- Footer ---- */

footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding: 3rem 0 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-left span:last-child {
  opacity: 0.5;
}

.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.monogram {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  border-radius: 5px;
  background: var(--bg-card);
  font-family: var(--mono);
  transition: background var(--t), border-color var(--t);
}

.footer-copy {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.6rem;
  opacity: 0.5;
}

.footer-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.2rem;
}

.footer-right a {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
  font-size: 0.75rem;
}

.footer-right a:hover {
  color: var(--accent);
}

.footer-icon {
  width: 13px;
  height: 13px;
}

.back-to-top {
  display: block;
  margin: 2rem auto 0;
  width: max-content;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-tertiary);
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s;
}

.back-to-top:hover {
  opacity: 1;
  color: var(--accent);
}

/* ---- V2 · Trimmy ---- */

[data-design="v2"] {
  --bg: #eee8db;
  --bg-warm: #e8e2d5;
}

[data-design="v2"][data-theme="dark"] {
  --bg: #1e2024;
  --bg-warm: #23272d;
}

[data-design="v2"] .tool-card {
  border: 2px solid #1a1a1a;
  box-shadow: 3px 3px 0 #c44b28;
  min-height: auto;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

[data-design="v2"][data-theme="dark"] .tool-card {
  border: 2px solid #4a4540;
  box-shadow: 3px 3px 0 #00d2ff;
}

[data-design="v2"] .tool-card:hover {
  border-color: #1a1a1a;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #c44b28;
}

[data-design="v2"][data-theme="dark"] .tool-card:hover {
  border-color: #4a4540;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #00d2ff;
}

[data-design="v2"] .tool-card:active {
  transform: translate(0, 0);
  box-shadow: 3px 3px 0 #c44b28;
}

[data-design="v2"][data-theme="dark"] .tool-card:active {
  box-shadow: 3px 3px 0 #00d2ff;
}

/* Hide color stripe in V2 — replaced by offset shadow */
[data-design="v2"] .tool-card::before {
  display: none;
}

/* ---- Grain Overlay ---- */

.grain {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.25;
}

[data-design="v2"] .grain {
  display: block;
}

/* ---- Crop Marks ---- */

.crop-mark {
  display: none;
  position: absolute;
  font-family: monospace;
  font-size: 16px;
  line-height: 1;
  opacity: 0.3;
  pointer-events: none;
  z-index: 40;
  color: var(--text);
}

[data-design="v2"] .crop-mark {
  display: block;
}

.crop-mark.tl { top: 14px; left: 16px; }
.crop-mark.tr { top: 14px; right: 16px; }

/* ---- Design Toggle Pill ---- */

.design-toggle {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  background: #1a1a1a;
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .design-toggle {
  background: #2a2e34;
}

.design-toggle button {
  font-family: var(--mono);
  font-size: 0.65rem;
  padding: 6px 14px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #888;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.design-toggle button.active {
  background: #c44b28;
  color: #fff;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }

  .footer-right {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 0 1.2rem;
  }

  .intro {
    padding: 2.5rem 0 2rem;
  }

  .intro-heading {
    font-size: 1.45rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: auto;
    padding: 1.5rem 1.4rem 1.3rem;
  }
}
