/* Saasuke Labs — paper, ink and one vermilion accent, taken from the fox logo. */

:root {
  --paper: #f4efe6;
  --paper-raised: #fbf8f2;
  --paper-sunk: #ebe4d7;
  --ink: #1c1917;
  --ink-soft: #57504a;
  --line: #d8cfbf;
  --accent: #c2352b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(194, 53, 43, 0.1);
  --code-bg: #211d1a;
  --code-ink: #f1ebe0;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06), 0 8px 24px rgba(28, 25, 23, 0.06);

  --font-display: "Shippori Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15120f;
    --paper-raised: #1e1a16;
    --paper-sunk: #100e0c;
    --ink: #f1ebe0;
    --ink-soft: #b3a999;
    --line: #38312a;
    --accent: #ea5b4e;
    --accent-ink: #15120f;
    --accent-soft: rgba(234, 91, 78, 0.14);
    --code-bg: #0c0a09;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #15120f;
  --paper-raised: #1e1a16;
  --paper-sunk: #100e0c;
  --ink: #f1ebe0;
  --ink-soft: #b3a999;
  --line: #38312a;
  --accent: #ea5b4e;
  --accent-ink: #15120f;
  --accent-soft: rgba(234, 91, 78, 0.14);
  --code-bg: #0c0a09;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

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

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 20;
  background: var(--paper-raised);
  padding: 8px 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  white-space: nowrap;
}

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

.brand img {
  width: 34px;
  height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: #f4efe6;
  padding: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.2vw, 26px);
  font-size: 0.95rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav .btn {
  color: var(--accent-ink);
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

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

@media (max-width: 640px) {
  .site-nav .nav-optional {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-header .wrap {
    gap: 8px;
  }

  .brand {
    font-size: 1rem;
    gap: 8px;
  }

  .site-nav {
    gap: 8px;
    font-size: 0.88rem;
  }

  .site-nav a[href="/#tools"] {
    display: none;
  }

  .site-nav .btn {
    padding: 6px 12px;
  }
}

/* ---------- Buttons, tags ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

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

.btn.small {
  padding: 6px 14px;
  font-size: 0.88rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.tag.version {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.version:empty {
  display: none;
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 80px);
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.2rem);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .lede {
  margin-top: 22px;
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  color: var(--ink-soft);
  max-width: 34em;
}

.hero .actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-mark {
  position: relative;
  justify-self: center;
  width: min(100%, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.hero-mark::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.92;
}

.hero-mark img {
  position: relative;
  width: 74%;
  border-radius: 18px;
  background: #f4efe6;
  padding: 10px;
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
}

@media (max-width: 760px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }

  .hero-mark {
    order: -1;
    width: 150px;
    justify-self: start;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(48px, 7vw, 88px) 0;
  border-top: 1px solid var(--line);
}

.section.sunk {
  background: var(--paper-sunk);
}

.section-head {
  max-width: 44em;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

.section-head p {
  margin-top: 14px;
  color: var(--ink-soft);
}

/* ---------- Tool cards ---------- */

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.tool {
  display: flex;
  flex-direction: column;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.tool-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tool h3 {
  font-size: 1.7rem;
}

.tool .kind {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tool .what {
  margin-top: 14px;
}

.tool ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.tool li {
  padding-left: 20px;
  position: relative;
  margin-top: 6px;
}

.tool li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 8px;
  height: 2px;
  background: var(--accent);
}

.tool pre {
  margin-top: 18px;
}

.tool .links {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ---------- Code ---------- */

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

pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.55;
}

:not(pre) > code {
  background: var(--accent-soft);
  padding: 0.1em 0.4em;
  border-radius: 5px;
}

pre .dim {
  opacity: 0.55;
}

/* ---------- Flow (how the tools fit) ---------- */

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper-raised);
}

.flow > div {
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 -1px -1px 0;
}

.flow .step {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.flow h3 {
  margin-top: 8px;
  font-size: 1.2rem;
}

.flow p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---------- Releases ---------- */

.release-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.release-list li {
  display: grid;
  grid-template-columns: 7.5em 9em minmax(0, 1fr) auto;
  gap: 6px 18px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.release-list time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.release-list .product {
  font-family: var(--font-display);
  font-weight: 800;
}

.release-list .summary {
  color: var(--ink-soft);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .release-list li {
    grid-template-columns: 1fr auto;
  }

  .release-list .summary {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .release-list time {
    grid-column: 1 / -1;
  }
}

.more {
  margin-top: 22px;
  font-weight: 600;
}

.release {
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.release-head h2,
.release-head h3 {
  font-size: 1.45rem;
}

.release-head time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.release-head .gh {
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 600;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.filters button {
  appearance: none;
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- Prose (release notes, long-form pages) ---------- */

.prose {
  max-width: 46em;
}

.prose > * + * {
  margin-top: 1em;
}

.prose h1 {
  font-size: clamp(2rem, 4.6vw, 3rem);
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 1.8em;
}

.prose h3 {
  font-size: 1.15rem;
  margin-top: 1.5em;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.3em;
}

.prose pre {
  margin-top: 1em;
}

.notes {
  margin-top: 14px;
  font-size: 0.97rem;
  overflow-wrap: anywhere;
}

.notes h1,
.notes h2,
.notes h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-top: 1.2em;
}

.notes a {
  color: var(--ink-soft);
}

/* ---------- Sponsor ---------- */

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  min-width: 0;
}

.card h3 {
  font-size: 1.2rem;
}

.card p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

.card .btn {
  margin-top: 18px;
}

.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 20px;
  padding: clamp(26px, 5vw, 48px);
}

.cta h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

.cta p {
  margin-top: 12px;
  opacity: 0.8;
  max-width: 38em;
}

.cta .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta .btn.ghost {
  color: var(--paper);
  border-color: color-mix(in srgb, var(--paper) 35%, transparent);
}

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

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

.sponsor-wall {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  color: var(--ink-soft);
}

.page-head {
  padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px);
}

.page-head h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  max-width: 18em;
}

.page-head p {
  margin-top: 18px;
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 40em;
}

/* ---------- Product docs (pages in each product repo's docs/ folder) ---------- */

.crumbs {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.crumbs a {
  text-decoration: none;
}

.crumbs span {
  color: var(--accent);
}

.page-head .title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.page-head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.docs {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.docs-toc {
  position: sticky;
  top: 88px;
  font-size: 0.92rem;
}

.docs-toc h2 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.docs-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.docs-toc a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--ink);
  border-left-color: var(--accent);
}

.docs .prose h2 {
  font-size: 1.7rem;
  margin-top: 2.2em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}

.docs .prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.docs .prose h3 {
  scroll-margin-top: 80px;
}

.table-scroll {
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--line);
}

.prose th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.prose td:first-child {
  white-space: nowrap;
}

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--paper-raised);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  font-size: 0.95rem;
}

/* Rendered diagrams keep a light card so they read the same in both themes. */
.figure {
  margin: 1em 0 0;
  background: #fbf8f2;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

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

.figure figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #57504a;
}

/* Diagrams rendered with the dark theme keep a dark canvas in both site themes. */
.figure.dark {
  background: #16110f;
  border-color: #3a302b;
}

.figure.dark figcaption {
  color: #b9aea6;
}

.docs .prose h3 {
  margin-top: 2em;
}

/* ---------- Home: Nagare showcase ---------- */

.showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.showcase .figure {
  margin: 0;
}

.showcase pre {
  font-size: 0.76rem;
  max-height: 420px;
  overflow: auto;
}

@media (max-width: 900px) {
  .showcase {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-toc {
    position: static;
  }

  .docs-toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    border-left: 0;
  }

  .docs-toc a {
    padding-left: 0;
    border-left: 0;
  }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.site-footer h4 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li + li {
  margin-top: 6px;
}

.site-footer a {
  text-decoration: none;
}

@media (max-width: 720px) {
  .site-footer .wrap {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer .about {
    grid-column: 1 / -1;
  }
}

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

  .btn {
    transition: none;
  }
}
