/* romty.dev
 *
 * The palette is romty's own, lifted from internal/ui/styles.go so the site
 * and the program share a face. Dark is the default because that is where a
 * terminal lives; the toggle and the system preference both still apply.
 */

:root {
  --text: #e2e8f0;
  --muted: #8492a6;
  --border: #334155;
  --surface: #1e293b;
  --canvas: #0f172a;
  --raised: #172033;
  --accent: #5eead4;
  --accent-surface: #134e4a;
  --accent-text: #f0fdfa;
  --danger: #fb7185;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
  --speed: 0.25s;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  --text: #0f172a;
  --muted: #64748b;
  --border: #cbd5e1;
  --surface: #e2e8f0;
  --canvas: #f8fafc;
  --raised: #ffffff;
  --accent: #0f766e;
  --accent-surface: #ccfbf1;
  --accent-text: #115e59;
  --danger: #be123c;

  --shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
}

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

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--canvas);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--speed) ease, color var(--speed) ease;
}

.container {
  width: min(1080px, 100% - 3rem);
  margin: 0 auto;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

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

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--canvas) 85%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* --------------------------------------------------------------- hero */

.hero {
  padding: 5.5rem 0 3rem;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  background: var(--accent-surface);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  margin-bottom: 1.6rem;
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(3rem, 9vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero .lead {
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  max-width: 44ch;
  margin: 0 auto 1.2rem;
  font-weight: 500;
  text-wrap: balance;
}

.hero .sub {
  color: var(--muted);
  max-width: 62ch;
  margin: 0 auto 2.2rem;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform var(--speed) ease, background-color var(--speed) ease,
    border-color var(--speed) ease, color var(--speed) ease;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--canvas);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn svg {
  width: 1.05em;
  height: 1.05em;
  fill: currentColor;
}

/* ------------------------------------------------------------ install */

.copy-line {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.75rem 0.7rem 1.1rem;
  max-width: 100%;
}

.copy-line .prompt {
  color: var(--accent);
  user-select: none;
}

.copy-line code {
  overflow-x: auto;
  white-space: nowrap;
  /* A flex item will not shrink below its content without this, which is how
     a long command pushes the page into a horizontal scroll on a phone. */
  min-width: 0;
}

.copy-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  transition: color var(--speed) ease, background-color var(--speed) ease;
}

.copy-btn:hover {
  color: var(--accent);
  background: var(--accent-surface);
}

/* ------------------------------------------------------ terminal demo */

.demo {
  padding: 2rem 0 4rem;
}

.window {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border);
}

.dot.red {
  background: #ec6a5e;
}

.dot.amber {
  background: #f4bf4f;
}

.dot.green {
  background: #61c554;
}

.window-title {
  margin-left: 0.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.screen {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
  display: grid;
  grid-template-columns: 15rem 1fr;
  min-height: 20rem;
}

.tree {
  border-right: 1px solid var(--border);
  padding: 0.9rem 1rem;
  overflow: hidden;
}

.tree-title {
  color: var(--muted);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.tree-root {
  font-weight: 700;
}

.tree-item {
  color: var(--muted);
  padding-left: 1.1rem;
  display: flex;
  justify-content: space-between;
}

.tree-item.current {
  color: var(--accent);
  font-weight: 600;
}

.tree-item .running {
  color: var(--accent);
}

.pane {
  padding: 0.9rem 1.1rem;
  overflow: hidden;
}

.tabs {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
}

.tabs .active {
  color: var(--accent);
  font-weight: 700;
}

.pane pre {
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  color: var(--muted);
}

.pane .path {
  color: var(--accent);
}

.pane .branch {
  color: #c4b5fd;
}

:root[data-theme="light"] .pane .branch {
  color: #7c3aed;
}

.pane .ok {
  color: #86efac;
}

:root[data-theme="light"] .pane .ok {
  color: #15803d;
}

.pane .art {
  color: var(--text);
}

.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* The blinking caret is the loudest motion here, but the lifting cards and
   buttons are motion too. Someone who asked for less of it meant all of it. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .btn:hover,
  .card:hover,
  .theme-toggle:hover {
    transform: none;
  }
}

.statusbar {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 0.55rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.statusbar b {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.35rem;
}

/* ------------------------------------------------------------ sections */

section.band {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 60ch;
  margin-bottom: 2.6rem;
}

.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  margin-bottom: 0.7rem;
}

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

/* ----------------------------------------------------------- features */

.grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform var(--speed) ease, border-color var(--speed) ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.96rem;
}

.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-surface);
  color: var(--accent-text);
  margin-bottom: 1.1rem;
}

.card .icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------ install */

.install-grid {
  display: grid;
  gap: 1.4rem;
  /* The commands are long; three columns cut them off rather than wrap. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
}

.install-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

pre.block {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.88rem;
  color: var(--text);
}

pre.block .prompt {
  color: var(--accent);
  user-select: none;
}

pre.block .comment {
  color: var(--muted);
}

/* ----------------------------------------------------------- shortcuts */

.keys {
  display: grid;
  gap: 0.6rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.key-row {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.key-row span {
  color: var(--muted);
  font-size: 0.95rem;
}

kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 7px;
  padding: 0.15rem 0.5rem;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
}

.key-row .caps {
  display: flex;
  gap: 0.35rem;
  flex: 0 0 8.5rem;
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 2rem;
}

/* -------------------------------------------------------- architecture */

.arch {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}

.arch pre {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.8;
}

.arch pre b {
  color: var(--accent);
  font-weight: 700;
}

.arch p {
  color: var(--muted);
}

.arch p:first-child {
  margin-top: 0;
}

/* ------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 3rem 0 2rem;
  font-size: 0.92rem;
}

.footer .row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer p {
  color: var(--muted);
  margin: 0.4rem 0 0;
  max-width: 48ch;
}

.footer-links {
  display: flex;
  gap: 1.4rem;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

/* -------------------------------------------------------- theme toggle */

.theme-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--raised);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform var(--speed) ease, border-color var(--speed) ease;
  z-index: 30;
}

.theme-toggle:hover {
  transform: scale(1.08);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* -------------------------------------------------------- narrow view */

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

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

  .tree {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 560px) {
  .nav-links a[data-optional] {
    display: none;
  }

  .hero {
    padding-top: 3.5rem;
  }

  .key-row .caps {
    flex-basis: 7rem;
  }
}
