/* mintwork.github.io. Fonts are self-hosted (copied from @fontsource by build.mjs). */
@font-face {
  font-family: "Martian Mono";
  src: url("/assets/fonts/martian-mono.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-italic.woff2") format("woff2-variations");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --forest: #0f1211; /* page: graphite, only a trace of green */
  --moss: #171b1a; /* raised surfaces */
  --vein: #2a302e; /* lines and borders */
  --mint: #7ee2b8; /* brand, links, focus */
  --pollen: #f2e58a; /* the prompt sigil and confirmations only */
  --frost: #eef2f0; /* text */
  --sage: #a2aca8; /* secondary text */
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Schibsted Grotesk", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --max: 1160px;
  --measure: 66ch;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--forest);
  color: var(--frost);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--mint); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--mint); color: var(--forest); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--mint); color: var(--forest); padding: 8px 14px; border-radius: 8px; font-weight: 700; z-index: 20; }
.skip:focus { left: 8px; }

/* Header ------------------------------------------------------------------------------- */
.top { position: absolute; inset: 0 0 auto; z-index: 5; }
.top .bar { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--frost); text-decoration: none; font: 700 20px/1 var(--sans); letter-spacing: -0.02em; }
.brand .mark { width: 24px; height: 24px; color: var(--mint); }
.top ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.top nav a { color: var(--frost); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--mint); }

/* Hero: the flowing threads sit behind, the type does the work ------------------------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding: 140px 0 72px; }
.hero.home { min-height: min(100svh, 860px); display: flex; align-items: center; padding: 120px 0 80px; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: auto; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--forest)); }

.display {
  font-family: var(--mono);
  font-weight: 640;
  font-stretch: 87.5%;
  letter-spacing: -0.045em;
  line-height: 1.06;
  margin: 0 0 22px;
  max-width: 17ch;
}
.home .display { font-size: clamp(2rem, 3.5vw, 3.25rem); }
.tool .display { font-size: clamp(1.9rem, 3.4vw, 3rem); max-width: 22ch; }
.display .line { display: block; }

.lede { font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.55; color: var(--sage); max-width: 46ch; margin: 0 0 32px; }

.crumb { font: 500 15px/1 var(--sans); margin: 0 0 28px; color: var(--sage); }
.crumb a { color: var(--sage); text-decoration: none; }
.crumb a:hover { color: var(--mint); }
.crumb span { color: var(--mint); }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: 56px; align-items: center; width: 100%; }
.hero-stack { position: relative; aspect-ratio: 16 / 11; width: 100%; max-width: 560px; justify-self: end; }
.hero-stack .shot { margin: 0; position: relative; width: 100%; height: 100%; border-radius: 16px; overflow: hidden; background: #0b0d0c;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--vein); }
.hero-stack:not(.live) .shot { position: absolute; inset: 0; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shot figcaption { position: absolute; left: 12px; bottom: 12px; font: 600 13px/1 var(--sans); color: var(--frost);
  background: rgba(15, 18, 17, 0.82); border: 1px solid var(--vein); padding: 7px 11px; border-radius: 999px; backdrop-filter: blur(6px); }
.hero-stack .stack { cursor: grab; }

/* The command prompt ------------------------------------------------------------------- */
.prompt { min-height: 64px; }
.prompt-static { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font: 500 15px/1.4 var(--mono); color: var(--sage); }
.prompt-static a { color: var(--frost); text-decoration: none; }
.prompt-static a:hover { color: var(--mint); }
.prompt-live { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
/* Fixed width (the longest tool name), so the Copy button never moves. */
.prompt-live code { min-width: 34ch;
  display: inline-flex; align-items: center; font: 500 clamp(0.92rem, 1.4vw, 1.05rem)/1 var(--mono);
  background: rgba(23, 27, 26, 0.78); border: 1px solid var(--vein); border-radius: 12px; padding: 15px 18px;
  backdrop-filter: blur(6px); white-space: pre;
}
.sigil { color: var(--pollen); margin-right: 0.62em; }
.rotating { color: var(--mint); animation: name-in .35s ease-out; }
@keyframes name-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rotating { animation: none; } }
.prompt-link { font-weight: 500; }

/* Buttons ------------------------------------------------------------------------------ */
.actions { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; padding: 0; }
.btn { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; font-size: 16px; border-radius: 999px; font-weight: 600;
  text-decoration: none; color: var(--frost); border: 1px solid var(--vein); background: rgba(23, 27, 26, 0.7);
  transition: border-color .15s, background-color .15s; }
.btn:hover { border-color: var(--mint); }
.btn.primary { background: var(--mint); color: var(--forest); border-color: var(--mint); }
.btn.primary:hover { background: var(--frost); border-color: var(--frost); }

.copy { font: 600 13px/1 var(--sans); color: var(--frost); background: var(--moss); border: 1px solid var(--vein);
  border-radius: 999px; padding: 9px 14px; cursor: pointer; transition: border-color .15s, color .15s; }
.copy:hover { border-color: var(--mint); }
.copy[data-state="done"] { color: var(--forest); background: var(--pollen); border-color: var(--pollen); }

/* Code --------------------------------------------------------------------------------- */
code { font-family: var(--mono); font-size: 0.84em; }
:not(pre) > code { background: var(--moss); border: 1px solid var(--vein); border-radius: 6px; padding: 0.08em 0.4em; }
pre { position: relative; margin: 0; background: #0b0d0c; border: 1px solid var(--vein); border-radius: 14px;
  padding: 20px 22px; overflow-x: auto; font: 450 14.5px/1.75 var(--mono); color: var(--frost); }
pre code { font-size: inherit; }
pre[data-copy] { padding-right: 92px; }
pre .copy { position: absolute; top: 14px; right: 14px; }
.hero pre { max-width: 820px; background: rgba(11, 13, 12, 0.8); backdrop-filter: blur(6px); }

/* Sections ----------------------------------------------------------------------------- */
main > section:not(.hero) { padding: clamp(56px, 8vw, 104px) 0 0; }
h2 { font: 700 clamp(1.4rem, 2.2vw, 1.8rem)/1.2 var(--sans); letter-spacing: -0.025em; margin: 0 0 24px; }
h3 { font: 650 1.15rem/1.3 var(--sans); letter-spacing: -0.01em; margin: 0 0 6px; }
.prose > * { max-width: var(--measure); }
.prose > pre { max-width: 860px; }
.prose p { margin: 0 0 1.1em; }
.muted { color: var(--sage); }

/* Home: the index of tools ------------------------------------------------------------- */
.index-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.index-head p { color: var(--sage); margin: 0; }
.tools { list-style: none; margin: 16px -24px 0; padding: 0; }
.tools > li { border-top: 1px solid var(--vein); }
.tools > li:last-child { border-bottom: 1px solid var(--vein); }
.tools .row {
  display: grid; grid-template-columns: 132px minmax(0, 15rem) minmax(0, 1fr) 17rem; gap: 8px 32px; align-items: center;
  padding: 18px 24px; color: var(--frost); text-decoration: none; border-radius: 18px;
}
.row .name { white-space: nowrap; font: 640 clamp(1.15rem, 1.9vw, 1.5rem)/1.1 var(--mono); font-stretch: 87.5%; letter-spacing: -0.045em; color: var(--frost); transition: color .15s; }
.row:hover .name, .row:focus-visible .name { color: var(--mint); }
.row .what { color: var(--sage); font-size: 1rem; }
.row .thumb { width: 132px; height: auto; aspect-ratio: 16 / 11; object-fit: cover; object-position: top left; border-radius: 8px;
  border: 1px solid var(--vein); filter: saturate(0.85) brightness(0.9); transition: filter .2s; }
.row:hover .thumb { filter: none; }
.row code { color: var(--mint); background: none; border: 0; padding: 0; white-space: nowrap; font-size: 12.5px; justify-self: end; }

.principles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 56px; max-width: none; }
.principles strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.principles span { color: var(--sage); }

/* Tool pages --------------------------------------------------------------------------- */
.demo { display: block; width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--vein); background: #0b0d0c;
  box-shadow: 0 40px 120px -40px rgba(126, 226, 184, 0.18); }
.center { text-align: center; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 64px; }
.features li { padding-left: 22px; border-left: 2px solid var(--vein); }
.features li:hover { border-left-color: var(--mint); }
.features p { margin: 0; color: var(--sage); }
.cta { padding-bottom: 24px; }
.cta .lede { margin-bottom: 0; }

/* Footer ------------------------------------------------------------------------------- */
.foot { margin-top: clamp(72px, 10vw, 136px); border-top: 1px solid var(--vein); padding: 40px 0 56px; color: var(--sage); font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 20px 48px; justify-content: space-between; }
.foot p { margin: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.foot a { color: var(--frost); text-decoration: none; }
.foot a:hover { color: var(--mint); }

/* Small screens ------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .tools .row { grid-template-columns: 112px minmax(0, 13rem) minmax(0, 1fr); }
  .row .thumb { width: 112px; }
  .row code { grid-column: 3; justify-self: start; }
}
@media (max-width: 860px) {
  .tools .row { grid-template-columns: 96px minmax(0, 1fr); gap: 4px 18px; padding: 18px 24px; }
  .row .thumb { width: 96px; grid-row: span 3; align-self: start; }
  .row .name, .row .what, .row code { grid-column: 2; }
  .row code { justify-self: start; white-space: normal; }
  .features, .principles { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding-top: 128px; }
  .hero.home { min-height: 0; padding-top: 128px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-stack { justify-self: center; max-width: 520px; width: 88%; }
  .index-head { display: block; }
}
@media (max-width: 520px) {
  .top ul { gap: 18px; }
  .prompt-live code { width: 100%; font-size: 15px; padding: 16px; }
  pre[data-copy] { padding-right: 22px; padding-bottom: 62px; }
  pre .copy { top: auto; bottom: 14px; right: 14px; }
}
