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

:root {
  /* Brand */
  --color-fox:          #F05241;
  --color-fox-light:    #F4705E;
  --color-fox-dark:     #C73E2D;
  --color-gold:         #E8A030;

  /* Backgrounds */
  --color-bg:           #18161F;
  --color-surface-1:    #221F2D;
  --color-surface-2:    #2D293C;

  /* Borders */
  --color-border:       #3A3550;

  /* Text */
  --color-fg-1:         #F0EDF8;
  --color-fg-2:         #8D87A8;
  --color-fg-3:         #4F4A64;

  /* Semantic */
  --color-danger:       #E84040;

  /* Shadows */
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.6);
  --shadow-fox:  0 4px 20px rgba(240, 82, 65, 0.35);

  /* Transitions */
  --duration-fast: 150ms;
  --ease-out:      cubic-bezier(0.0, 0.0, 0.2, 1.0);

  /* Typography */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  /* Legacy aliases (used by non-React tools) */
  --bg:    var(--color-bg);
  --fox:   var(--color-fox);
  --gold:  var(--color-gold);
  --surf1: var(--color-surface-1);
  --surf2: var(--color-surface-2);
  --fg:    var(--color-fg-1);
  --fg2:   var(--color-fg-2);
  --fg3:   var(--color-fg-3);
  --danger: var(--color-danger);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--color-bg); color: var(--color-fg-1); min-height: 100vh; }
body { display: flex; flex-direction: column; font-family: var(--font-body); -webkit-font-smoothing: antialiased; }

a { color: inherit; text-decoration: none; }

/* ── Nav ─────────────────────────────────────────────────── */

nav.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-1);
  border-bottom: 1px solid var(--color-border);
  padding: 0 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--color-fg-1);
  letter-spacing: 0.05em;
}


.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-user {
  font-size: 14px;
  color: var(--color-fg-2);
}

.nav-signout {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-fg-2);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.nav-signout:hover { color: var(--color-fg-1); border-color: var(--color-fg-2); }

/* ── Main layout ─────────────────────────────────────────── */

main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px;
}

/* Homepage runs wider than a single-tool page. */
main.home { max-width: 1120px; }

/* ── Sign-in page ────────────────────────────────────────── */

.signin-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.signin-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 360px;
  box-shadow: var(--shadow-lg);
}

.signin-hero {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 4px;
}

.signin-subtitle {
  font-size: 14px;
  color: var(--color-fg-2);
  margin-bottom: 8px;
}

.signin-btn {
  width: 100%;
  height: 48px;
  background: var(--color-fox);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-fox);
  transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.signin-btn:hover { background: var(--color-fox-light); }
.signin-btn:active { background: var(--color-fox-dark); transform: scale(0.97); }

.signin-error {
  font-size: 14px;
  color: var(--color-danger);
  text-align: center;
}

/* ── Homepage hero ───────────────────────────────────────── */

.home-hero {
  margin: 0 0 40px;
}

.home-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-fox);
  margin: 0 0 6px;
}

.home-title {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
  color: var(--color-fg-1);
}

.home-sub {
  margin: 0;
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-fg-2);
}

/* ── Tools section ───────────────────────────────────────── */

.tools-heading {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-fg-2);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tools-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.tools-heading + .tool-list { margin-bottom: 44px; }
.tool-list:last-child { margin-bottom: 0; }

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.tool-card {
  --glow: var(--color-fox);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    transform    var(--duration-fast) var(--ease-out),
    box-shadow   var(--duration-fast) var(--ease-out);
}
.tool-card:hover {
  border-color: var(--glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Art panel — either an <img> or an inline SVG glyph. */
.tool-art {
  position: relative;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 100% at 50% 115%, color-mix(in srgb, var(--glow) 26%, transparent), transparent 70%),
    var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
}

.tool-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Scrim so photographic key art sits at the same value as the vector art,
   which is already drawn on the dark background. Photos only. */
.tool-art.is-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(24,22,31,0.30), rgba(24,22,31,0.62));
  transition: opacity var(--duration-fast) var(--ease-out);
}
.tool-card:hover .tool-art.is-photo::after { opacity: 0.55; }

.tool-glyph {
  width: 68px;
  height: 68px;
  color: var(--glow);
  opacity: 0.9;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast) var(--ease-out);
}
.tool-card:hover .tool-glyph { transform: scale(1.06); opacity: 1; }

.tool-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 16px;
  flex: 1;
}

.tool-card h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.1;
  margin: 0;
  color: var(--color-gold);
}

/* Stretched link — the whole card is clickable, but only the title is a link. */
.tool-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.tool-card p {
  margin: 0;
  color: var(--color-fg-2);
  font-size: 14px;
  line-height: 1.5;
}

.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  font-size: 12px;
  color: var(--color-fg-3);
}

.tool-host {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-card:hover .tool-host { color: var(--color-fg-2); }

/* Secondary link inside a card — must sit above the stretched link. */
.tool-sub {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-fg-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 4px 9px;
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.tool-sub:hover { color: var(--color-fg-1); border-color: var(--color-fg-2); }

.tool-badge {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold);
  border: 1px solid color-mix(in srgb, var(--color-gold) 40%, transparent);
  border-radius: 999px;
  padding: 3px 9px;
}

/* Not-yet-built tools: present, but clearly inert. */
.tool-card.is-soon {
  border-style: dashed;
  background: transparent;
}
.tool-card.is-soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--color-border);
}
.tool-card.is-soon .tool-art { opacity: 0.5; }
.tool-card.is-soon h3 { color: var(--color-fg-2); }

@media (max-width: 640px) {
  .home-title { font-size: 40px; }
  .tool-list { grid-template-columns: 1fr; }
}

/* ── Shared utilities ────────────────────────────────────── */

.muted { color: var(--color-fg-3); font-size: 14px; }
.error { color: var(--color-danger); }

/* Used by non-React tools (hello-world, etc.) */
button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--color-fox);
  color: var(--color-fg-1);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
button:hover { background: var(--color-fox-light); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--color-surface-2); color: var(--color-fg-2); }
button.secondary:hover { background: var(--color-surface-1); color: var(--color-fg-1); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.output {
  margin-top: 16px;
  padding: 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  white-space: pre-wrap;
  min-height: 24px;
}

.hidden { display: none !important; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
