/* Ember Workbench. The look follows the tool landing pages (dark hero band, Inter,
   gradient words, pill chips). The page has no framework CSS and no links to the rest of
   joegaudet.com, so it can move to its own domain as one folder. */

/* Light is the default; dark follows the OS unless the toggle pinned data-theme. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #c2410c;
  --accent-soft: rgb(234 88 12 / 0.1);
  --harnessed: #7c3aed;
  --real-enums: #0d9488;
  --ember-formwright: #4f46e5;
  --ember-joinery: #b45309;
  --switchyard: #2563eb;
  --ember-marquetry: #be123c;
  --jig: #0369a1;
  --space-gutter: clamp(1rem, 4vw, 2rem);
  --space-section: clamp(4rem, 9vw, 6.5rem);
  --radius: 14px;
  --font: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b0b14;
    --surface: #12121f;
    --ink: #f1f5f9;
    --muted: #a3aec2;
    --line: #262637;
    --accent: #fb923c;
    --accent-soft: rgb(251 146 60 / 0.12);
    --harnessed: #a78bfa;
    --real-enums: #2dd4bf;
    --ember-formwright: #a5b4fc;
    --ember-joinery: #fbbf24;
    --switchyard: #60a5fa;
    --ember-marquetry: #fb7185;
    --jig: #38bdf8;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0b0b14;
  --surface: #12121f;
  --ink: #f1f5f9;
  --muted: #a3aec2;
  --line: #262637;
  --accent: #fb923c;
  --accent-soft: rgb(251 146 60 / 0.12);
  --harnessed: #a78bfa;
  --real-enums: #2dd4bf;
  --ember-formwright: #a5b4fc;
  --ember-joinery: #fbbf24;
  --switchyard: #60a5fa;
  --ember-marquetry: #fb7185;
  --jig: #38bdf8;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

img,
svg {
  max-width: 100%;
}

code,
pre {
  font-family: var(--mono);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: calc(1200px + 2 * var(--space-gutter));
  margin-inline: auto;
  padding-inline: var(--space-gutter);
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Sticky nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.brand-link {
  display: flex;
  flex-shrink: 0;
  white-space: nowrap;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink) !important;
  font-weight: 700;
}

@media (max-width: 575px) {
  .wide-only {
    display: none;
  }
}

@media (max-width: 359px) {
  .roomy-only {
    display: none;
  }
}

@media (max-width: 380px) {
  .site-nav ul {
    gap: 0.6rem;
  }

  .site-nav a {
    font-size: 0.95rem;
  }
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

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

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-toggle .moon,
[data-theme-active='dark'] .theme-toggle .sun {
  display: none;
}

[data-theme-active='dark'] .theme-toggle .moon {
  display: block;
}

/* Hero band: dark in both schemes, like the tool pages. */
.hero-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #0b0b14;
  color: #f8fafc;
}

.hero-band::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 75%);
}

.hero-band::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(40rem 28rem at 78% 45%, rgb(234 88 12 / 0.3), transparent 70%);
}

.hero {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
  padding-block: var(--space-section);
}

.hero > *,
.hero-copy > * {
  min-width: 0;
}

@media (min-width: 992px) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
  }
}

.hero .eyebrow {
  color: #fdba74;
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(90deg, #fb923c, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 36rem;
  margin: 0 0 2rem;
  font-size: 1.125rem;
  color: #cbd5e1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #ea580c;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: #c2410c;
}

.button.ghost {
  background: transparent;
  border-color: rgb(255 255 255 / 0.25);
  color: #f8fafc;
}

.button.ghost:hover {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.5);
}

/* The rack: the seven logos hung on the wall over the bench. */
.rack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 20px;
  background: rgb(255 255 255 / 0.03);
  list-style: none;
}

.rack li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(0.68rem, 2.6vw, 0.8rem);
  color: #cbd5e1;
  text-align: center;
  white-space: nowrap;
}

.rack a {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.rack img {
  width: clamp(3rem, 8vw, 4.5rem);
  height: auto;
  aspect-ratio: 1;
  transition: transform 0.2s ease;
}

.rack a:hover img {
  transform: translateY(-3px) rotate(-3deg);
}

.rack .bench-mark {
  grid-column: span 1;
  justify-content: center;
  color: #fdba74;
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* Sections */
main > section {
  padding-block: var(--space-section);
}

main > section + section {
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 44rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

/* Pitch: three principles. */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.principles li {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.principles h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.principles p {
  margin: 0;
  color: var(--muted);
}

/* How they fit */
.fit-figure {
  margin: 0;
  overflow-x: auto;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.fit-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

/* A tall diagram for phones, a wide one from 640px up. */
.fit-wide {
  display: none !important;
}

@media (min-width: 640px) {
  .fit-wide {
    display: block !important;
  }

  .fit-narrow {
    display: none !important;
  }
}

.fit-narrow .job {
  font-size: 12px;
}

.fit-figure figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.fit .layer rect {
  fill: color-mix(in srgb, var(--tint) 10%, var(--surface));
  stroke: color-mix(in srgb, var(--tint) 55%, transparent);
  stroke-width: 1.5;
}

.fit .layer.planned rect {
  stroke-dasharray: 6 5;
}

.fit .job {
  fill: var(--muted);
  font: 600 13px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fit .name {
  fill: var(--tint);
  font: 800 22px var(--font);
}

.fit .note {
  fill: var(--muted);
  font: 500 14px var(--font);
}

.fit .base rect {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.fit .base text {
  fill: var(--ink);
  font: 600 15px var(--font);
}

/* Tool cards, grouped by job */
/* Groups sit in one grid; the two-tool group is two columns wide. */
.groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: 3rem 1.5rem;
}

.group {
  display: flex;
  flex-direction: column;
}

.group .cards {
  flex: 1;
}

@media (min-width: 760px) {
  .group[data-group='forms'] {
    grid-column: span 2;
  }
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin-bottom: 1.25rem;
}

.group-head h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.group-head p {
  margin: 0;
  color: var(--muted);
}

.group-head {
  min-height: 3.5rem;
  flex-direction: column;
  flex-wrap: nowrap;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.5rem;
}

.card {
  --tint: var(--accent);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tint);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -18px color-mix(in srgb, var(--tint) 60%, transparent);
}

.card .hero-link {
  display: block;
  aspect-ratio: 1200 / 630;
  background: #0b0b14;
}

.card .hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.4rem 1.4rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.card h4 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card h4 a {
  color: var(--ink);
  text-decoration: none;
}

.card h4 a:hover {
  color: var(--tint);
}

.card-title img {
  width: 1.75rem;
  height: 1.75rem;
}

.tag-anywhere,
.status {
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-anywhere {
  border: 1px solid var(--line);
  color: var(--muted);
}

.status {
  background: var(--accent-soft);
  color: var(--accent);
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: auto 0 0;
  padding: 0.5rem 0 0;
  list-style: none;
}

.card-links a {
  color: var(--tint);
  font-weight: 600;
  text-decoration: none;
}

.card-links a:hover {
  text-decoration: underline;
}

.card-note {
  margin-top: auto !important;
  padding-top: 0.5rem;
  font-size: 0.9rem;
}

/* Install */
.terminal {
  position: relative;
  max-width: 52rem;
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: var(--radius);
  background: #0d1117;
}

.terminal pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  color: #e2e8f0;
  font-size: clamp(0.78rem, 0.7rem + 0.3vw, 0.9rem);
  line-height: 1.75;
}

.terminal .c {
  color: #8b98a9;
}

.terminal .copy {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 8px;
  background: #161b22;
  color: #e2e8f0;
  font: 600 0.8rem var(--font);
  cursor: pointer;
}

.terminal .copy:hover {
  border-color: rgb(255 255 255 / 0.4);
}

.install-note {
  max-width: 52rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* About */
.about {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  max-width: 44rem;
}

.about img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent);
}

.about h2 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.about p {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

@media (max-width: 480px) {
  .about {
    grid-template-columns: 1fr;
  }
}

/* Footer */
body > footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

body > footer a {
  color: inherit;
}

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

  .card,
  .rack img {
    transition: none;
  }

  .card:hover,
  .rack a:hover img {
    transform: none;
  }
}
