/* Image Studio design system
   Source -> Transform -> Output.
   Geist + Geist Mono, graphite neutrals, one pear-lime accent.
   Geometry: 4px (tags, code), 8px (controls), 12px (frames, panels). 1px lines.
   Public pages use .s-*; the signed-in app is re-themed through the DaisyUI variables below. */

:root {
  --ink: #0b0d0e;
  --ink-2: #3a4046;
  --mute: #666d75;
  --line: #d9dcdf;
  --line-soft: #e8eaec;
  --mist: #f3f4f5;
  --paper: #fafafa;
  --white: #fff;
  --night: #0b0d0e;
  --night-2: #14181b;
  --night-line: #272d32;
  --night-mute: #9aa3ab;
  --accent: #c8f03c;
  --accent-ink: #3d6a00;
  --accent-soft: #eef9c4;
  --danger: #b42318;
  --r1: 4px;
  --r2: 8px;
  --r3: 12px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(11, 13, 14, 0.06), 0 8px 24px -12px rgba(11, 13, 14, 0.18);
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1240px;

  /* DaisyUI 5 theme variables: the signed-in app inherits the new identity */
  --color-base-100: #fff;
  --color-base-200: #f3f4f5;
  --color-base-300: #d9dcdf;
  --color-base-content: #0b0d0e;
  --color-primary: #c8f03c;
  --color-primary-content: #0b0d0e;
  --color-secondary: #0b0d0e;
  --color-secondary-content: #fff;
  --color-accent: #c8f03c;
  --color-accent-content: #0b0d0e;
  --color-neutral: #0b0d0e;
  --color-neutral-content: #fff;
  --color-info: #0b0d0e;
  --color-info-content: #fff;
  --color-success: #3d6a00;
  --color-success-content: #fff;
  --color-warning: #8a6100;
  --color-warning-content: #fff;
  --color-error: #b42318;
  --color-error-content: #fff;
  --radius-selector: 4px;
  --radius-field: 8px;
  --radius-box: 12px;
  --border: 1px;
}

/* ------------------------------------------------------------------ base */
.st {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.st *,
.st *::before,
.st *::after {
  box-sizing: border-box;
}
.st img {
  display: block;
  max-width: 100%;
}
.st a {
  color: inherit;
}
.st :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--r1);
}
.st .on-night :focus-visible,
.st .s-night :focus-visible {
  outline-color: var(--accent);
}
.s-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--r2);
  z-index: 100;
  transition: top 0.2s var(--ease);
}
.s-skip:focus {
  top: 12px;
}
.s-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.s-mono {
  font-family: var(--mono);
  font-feature-settings: "calt" 0;
}
h1.s-h,
h2.s-h,
h3.s-h {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}
.s-h1 {
  font-size: clamp(2.5rem, 6.4vw, 5rem);
}
.s-h2 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.06;
}
.s-h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.s-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-2);
  max-width: 54ch;
  text-wrap: pretty;
}
.s-kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}
.s-night {
  background: var(--night);
  color: #fff;
}
.s-night .s-lead,
.s-night .s-kicker {
  color: var(--night-mute);
}
.s-mark {
  background: linear-gradient(transparent 62%, var(--accent) 62%);
  padding: 0 0.06em;
}
.s-night .s-mark,
.s-auth__side .s-mark {
  background: none;
  color: var(--accent);
}

/* --------------------------------------------------------------- buttons */
.s-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r2);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff !important;
  font: 500 0.95rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s, color 0.18s, border-color 0.18s;
}
.s-btn:hover {
  transform: translateY(-1px);
}
.s-btn:active {
  transform: translateY(0) scale(0.99);
}
.s-btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink) !important;
}
.s-btn--ghost {
  background: transparent;
  color: var(--ink) !important;
  border-color: var(--line);
}
.s-btn--ghost:hover {
  border-color: var(--ink);
}
.s-night .s-btn--ghost {
  color: #fff !important;
  border-color: var(--night-line);
}
.s-night .s-btn--ghost:hover {
  border-color: #fff;
}
.s-btn--sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.875rem;
}
.s-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}
.s-link:hover {
  text-decoration-color: var(--ink);
}

/* ------------------------------------------------------------------- nav */
.s-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 250, 0.88);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.s-nav__in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}
.s-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.s-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.s-nav__links {
  display: flex;
  gap: 4px;
  margin: 0 auto 0 12px;
  padding: 0;
  list-style: none;
}
.s-nav__links a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r2);
  color: var(--mute);
  font-size: 0.925rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.s-nav__links a:hover {
  color: var(--ink);
  background: var(--mist);
}
.s-nav__links a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}
.s-nav__cta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.s-nav__toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--white);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.s-nav__toggle span,
.s-nav__toggle span::before,
.s-nav__toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}
.s-nav__toggle span {
  position: relative;
}
.s-nav__toggle span::before,
.s-nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.s-nav__toggle span::before {
  top: -6px;
}
.s-nav__toggle span::after {
  top: 6px;
}
.s-nav__toggle[aria-expanded="true"] span {
  background: transparent;
}
.s-nav__toggle[aria-expanded="true"] span::before {
  transform: translateY(6px) rotate(45deg);
}
.s-nav__toggle[aria-expanded="true"] span::after {
  transform: translateY(-6px) rotate(-45deg);
}
@media (max-width: 860px) {
  .s-nav__toggle {
    display: inline-flex;
  }
  .s-nav__links,
  .s-nav__cta {
    display: none;
  }
  .s-nav.is-open .s-nav__links,
  .s-nav.is-open .s-nav__cta {
    display: flex;
  }
  .s-nav.is-open .s-nav__in {
    flex-wrap: wrap;
    height: auto;
    padding-top: 8px;
    padding-bottom: 16px;
  }
  .s-nav.is-open .s-brand {
    height: 44px;
  }
  .s-nav.is-open .s-nav__links {
    order: 3;
    flex-direction: column;
    width: 100%;
    margin: 8px 0 0;
  }
  .s-nav.is-open .s-nav__links a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
    font-size: 1.05rem;
    box-shadow: none !important;
  }
  .s-nav.is-open .s-nav__cta {
    order: 4;
    width: 100%;
    margin-top: 12px;
  }
  .s-nav.is-open .s-nav__cta .s-btn {
    flex: 1;
  }
}

/* ------------------------------------------------- url + frames + chips */
.s-url {
  font-family: var(--mono);
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 0;
}
.s-url .u-host {
  color: var(--mute);
}
.s-url .u-key {
  color: #8a6100;
}
.s-url .u-path {
  color: var(--ink-2);
}
.s-url .u-tok {
  color: var(--accent-ink);
  font-weight: 500;
}
.s-night .s-url .u-host {
  color: var(--night-mute);
}
.s-night .s-url .u-key {
  color: #e9c46a;
}
.s-night .s-url .u-path {
  color: #d6dbe0;
}
.s-night .s-url .u-tok {
  color: var(--accent);
}
.s-frame {
  position: relative;
  margin: 0;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  overflow: hidden;
}
.s-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.s-frame--check {
  background-color: #fff;
  background-image: conic-gradient(#e3e5e7 25%, transparent 0 50%, #e3e5e7 0 75%, transparent 0);
  background-size: 16px 16px;
}
.s-frame--check img {
  object-fit: contain;
}
.s-night .s-frame {
  border-color: var(--night-line);
  background: var(--night-2);
}
.s-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: var(--r1);
  background: rgba(11, 13, 14, 0.82);
  color: #fff;
  font: 500 0.72rem/1.4 var(--mono);
  backdrop-filter: blur(6px);
}
.s-tag--accent {
  background: var(--accent);
  color: var(--ink);
}
.s-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: var(--white);
  font: 500 0.78rem/1.4 var(--mono);
  color: var(--ink);
}
.s-copy {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--white);
  font: 500 0.78rem/1.4 var(--mono);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.s-copy code {
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s-copy:hover {
  border-color: var(--ink);
}
.s-copy .s-copy__tag {
  flex: none;
  padding: 3px 8px;
  border-radius: var(--r1);
  background: var(--mist);
  color: var(--mute);
  font-size: 0.7rem;
}
.s-copy.is-done {
  border-color: var(--accent-ink);
  background: var(--accent-soft);
}
.s-copy.is-done .s-copy__tag {
  background: var(--accent);
  color: var(--ink);
}

/* ------------------------------------------------------------ reveal anim */
.s-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.s-in.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .s-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .st * {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------ flash */
.s-flash {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  padding: 10px 16px;
  border-radius: var(--r2);
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
}
.s-flash--alert {
  background: var(--danger);
}

/* ------------------------------------------------------------------ hero */
.s-hero {
  padding: clamp(32px, 6vw, 72px) 0 clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--line-soft);
}
.s-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.s-hero__copy > * + * {
  margin-top: 24px;
}
.s-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.s-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 0;
  list-style: none;
  color: var(--mute);
  font-size: 0.9rem;
}
.s-hero__facts li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 1px;
  background: var(--accent-ink);
  vertical-align: middle;
}

/* the lab: source -> transform -> output */
.s-lab {
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.s-lab__stage {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}
.s-lab__src {
  position: relative;
  border-right: 1px solid var(--line);
  background: var(--mist);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.s-lab__src img {
  width: 100%;
  height: auto;
  aspect-ratio: 736 / 1288;
  object-fit: cover;
  border-radius: var(--r1);
}
.s-lab__src small {
  font: 500 0.66rem/1.3 var(--mono);
  color: var(--mute);
}
.s-lab__out {
  position: relative;
  width: 100%;
  align-self: start;
  aspect-ratio: 1 / 1;
  background: var(--mist);
  overflow: hidden;
}
.s-lab__out img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
}
.s-lab__out img.is-off {
  opacity: 0;
  transform: scale(1.03);
}
.s-lab__out.is-check {
  background-color: #fff;
  background-image: conic-gradient(#e3e5e7 25%, transparent 0 50%, #e3e5e7 0 75%, transparent 0);
  background-size: 16px 16px;
}
.s-lab__out.is-check img {
  object-fit: contain;
}
.s-lab__url {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 84px;
  background: var(--paper);
}
.s-lab__url small {
  display: block;
  margin-bottom: 4px;
  font: 500 0.68rem/1.4 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}
.s-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
}
.s-pick {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--white);
  color: var(--ink);
  font: 500 0.85rem/1 var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.s-pick:hover {
  border-color: var(--ink);
}
.s-pick[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}
@media (max-width: 900px) {
  .s-hero__grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .s-lab__stage {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .s-lab__src {
    padding: 6px;
  }
}

/* --------------------------------------------------------------- sections */
.s-sec {
  padding: clamp(56px, 8vw, 112px) 0;
}
.s-sec--line {
  border-top: 1px solid var(--line-soft);
}
.s-sec__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 24px 48px;
  align-items: end;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.s-sec__head .s-lead {
  margin: 0;
}
@media (max-width: 800px) {
  .s-sec__head {
    grid-template-columns: 1fr;
  }
}

/* resize ladder: one source, three outputs, true proportions */
.s-ladder {
  display: grid;
  grid-template-columns: repeat(3, auto);
  align-items: end;
  justify-content: start;
  gap: clamp(12px, 2.5vw, 28px);
}
.s-ladder figure {
  margin: 0;
}
.s-ladder .s-frame {
  aspect-ratio: 736 / 1288;
}
.s-ladder figcaption {
  margin-top: 10px;
  font: 500 0.78rem/1.4 var(--mono);
  color: var(--ink-2);
}
.s-ladder figcaption b {
  display: block;
  color: var(--ink);
}

/* crop windows */
.s-crops {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  align-items: start;
}
.s-crops figure {
  margin: 0;
}
.s-crops figcaption {
  margin-top: 8px;
  font: 500 0.75rem/1.4 var(--mono);
  color: var(--mute);
}

/* before / after */
.s-ba {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r3);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--mist);
  --pos: 50%;
  touch-action: pan-y;
}
.s-ba img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.s-ba__top {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.s-ba input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.s-ba__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--accent);
  pointer-events: none;
}
.s-ba__bar::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(11, 13, 14, 0.18);
}
.s-ba:focus-within .s-ba__bar::after {
  box-shadow: 0 0 0 3px var(--ink);
}
.s-ba .s-tag {
  z-index: 2;
}
.s-ba .s-tag.r {
  left: auto;
  right: 10px;
}

/* token table */
.s-table {
  width: 100%;
  border-collapse: collapse;
}
.s-table th {
  text-align: left;
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--ink);
}
.s-table td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  font-size: 0.95rem;
}
.s-table code {
  font: 500 0.82rem/1.5 var(--mono);
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: var(--r1);
  white-space: nowrap;
}
.s-night .s-table th {
  border-bottom-color: #fff;
  color: var(--night-mute);
}
.s-night .s-table td {
  border-bottom-color: var(--night-line);
}
.s-night .s-table code {
  background: rgba(200, 240, 60, 0.12);
  color: var(--accent);
}
@media (max-width: 640px) {
  .s-table thead {
    display: none;
  }
  .s-table tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .s-table td {
    display: block;
    border: 0;
    padding: 2px 0;
  }
}

/* tabs / filters */
.s-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 24px;
}
.s-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--white);
  font: 500 0.88rem/1 var(--font);
  color: var(--ink);
  cursor: pointer;
}
.s-tabs button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}
.s-tabs button:hover {
  border-color: var(--ink);
}

/* pipeline steps: a horizontal line that draws itself */
.s-pipe {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: p;
}
.s-pipe::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  height: 1px;
  background: var(--night-line);
}
.s-pipe li {
  position: relative;
  padding-top: 44px;
  counter-increment: p;
}
.s-pipe li::before {
  content: counter(p);
  position: absolute;
  top: 0;
  left: 0;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: var(--r2);
  background: var(--accent);
  color: var(--ink);
  font: 600 0.85rem/1 var(--mono);
}
.s-pipe h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}
.s-pipe p {
  margin: 0;
  color: var(--night-mute);
  font-size: 0.95rem;
}
@media (max-width: 800px) {
  .s-pipe {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .s-pipe::before {
    left: 15px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 1px;
    height: auto;
  }
  .s-pipe li {
    padding: 2px 0 0 52px;
  }
}

/* capability rows (features) */
.s-cap {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(32px, 5vw, 64px) 0;
  border-top: 1px solid var(--night-line);
}
.s-cap:first-of-type {
  border-top: 0;
}
.s-cap--flip {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}
.s-cap--flip .s-cap__copy {
  order: 2;
}
.s-cap__copy > * + * {
  margin-top: 16px;
}
.s-cap__copy p {
  margin: 0;
  color: var(--night-mute);
  max-width: 46ch;
}
@media (max-width: 800px) {
  .s-cap,
  .s-cap--flip {
    grid-template-columns: 1fr;
  }
  .s-cap--flip .s-cap__copy {
    order: 0;
  }
}
.s-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.s-points > div {
  padding: 24px 24px 24px 0;
  border-bottom: 1px solid var(--line-soft);
}
.s-points h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}
.s-points p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------- footer */
.s-foot {
  background: var(--night);
  color: #fff;
  padding: clamp(48px, 7vw, 80px) 0 28px;
}
.s-foot__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
}
.s-foot h4 {
  margin: 0 0 14px;
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--night-mute);
}
.s-foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.s-foot a {
  color: #e6eaee;
  text-decoration: none;
  font-size: 0.95rem;
}
.s-foot a:hover {
  color: var(--accent);
}
.s-foot p {
  margin: 0;
  color: var(--night-mute);
  font-size: 0.92rem;
  max-width: 34ch;
}
.s-foot__social {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.s-foot__social a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--night-line);
  border-radius: var(--r2);
}
.s-foot__social a:hover {
  border-color: var(--accent);
}
.s-foot__bar {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--night-line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  color: var(--night-mute);
  font-size: 0.85rem;
}
.s-foot__bar a {
  color: var(--night-mute);
  font-size: 0.85rem;
}
@media (max-width: 860px) {
  .s-foot__grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .s-foot__grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------- page header */
.s-page {
  padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--line-soft);
}
.s-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
}
.s-page__grid > * + * {
  margin-top: 0;
}
.s-page__copy > * + * {
  margin-top: 20px;
}
@media (max-width: 800px) {
  .s-page__grid {
    grid-template-columns: 1fr;
  }
}

/* examples gallery: three column masonry, true proportions, hover compare */
.s-gal {
  columns: 3;
  column-gap: 16px;
}
.s-gal > figure {
  break-inside: avoid;
  margin: 0 0 16px;
}
.s-gal .s-frame {
  display: block;
}
.s-gal figcaption {
  padding: 10px 2px 0;
}
.s-gal figcaption b {
  display: block;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.s-gal figcaption span {
  display: block;
  margin: 2px 0 8px;
  color: var(--mute);
  font-size: 0.88rem;
}
.s-gal .s-frame img {
  height: auto;
  transition: transform 0.7s var(--ease);
}
.s-gal figure:hover .s-frame img {
  transform: scale(1.025);
}
@media (max-width: 900px) {
  .s-gal {
    columns: 2;
  }
}
@media (max-width: 520px) {
  .s-gal {
    columns: 1;
  }
}

/* legal / long text */
.s-prose {
  max-width: 68ch;
}
.s-prose h2 {
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  margin: 2.4em 0 0.6em;
  scroll-margin-top: 84px;
}
.s-prose h2:first-child {
  margin-top: 0;
}
.s-prose p,
.s-prose li {
  color: var(--ink-2);
}
.s-prose ul {
  padding-left: 1.2em;
}
.s-toc {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 2px;
  font-size: 0.92rem;
}
.s-toc a {
  display: block;
  padding: 6px 12px;
  border-left: 1px solid var(--line);
  color: var(--mute);
  text-decoration: none;
}
.s-toc a:hover,
.s-toc a.is-on {
  color: var(--ink);
  border-left-color: var(--ink);
}
.s-split {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
}
@media (max-width: 860px) {
  .s-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .s-toc {
    position: static;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .s-toc a {
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
}
.s-note {
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r2);
  color: var(--ink-2);
  font-size: 0.92rem;
  background: var(--white);
}

/* contact */
.s-channels {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}
.s-channel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--white);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.s-channel:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.s-channel--accent {
  background: var(--accent);
  border-color: var(--accent);
}
.s-channel small {
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.7;
}
.s-channel b {
  display: block;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.s-stack {
  display: grid;
  gap: 16px;
}
@media (max-width: 800px) {
  .s-channels {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------- auth page */
.s-auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.s-auth__side {
  position: relative;
  background: var(--night);
  color: #fff;
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
}
.s-auth__side .s-lead {
  color: var(--night-mute);
}
.s-auth__reel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.s-auth__reel .s-frame {
  aspect-ratio: 3 / 4;
}
.s-auth__main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px) var(--gutter);
}
.s-auth__box {
  width: 100%;
  max-width: 400px;
}
.s-auth__box > * + * {
  margin-top: 20px;
}
.s-field label,
.s-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}
.s-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  background: var(--white);
  color: var(--ink);
  font: 400 1rem var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.s-input:hover {
  border-color: #b7bcc1;
}
.s-input:focus {
  outline: 0;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent);
}
.s-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.s-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}
.s-alert {
  padding: 12px 14px;
  border: 1px solid #f1b8b2;
  border-radius: var(--r2);
  background: #fdf0ee;
  color: var(--danger);
  font-size: 0.92rem;
}
@media (max-width: 900px) {
  .s-auth {
    grid-template-columns: 1fr;
  }
  .s-auth__side {
    padding-bottom: 24px;
  }
  .s-auth__reel {
    display: none;
  }
  .s-auth__side .s-lead {
    display: none;
  }
}

/* ------------------------------------------------------------------ docs */
.d-wrap {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  padding-top: clamp(32px, 5vw, 64px);
  padding-bottom: clamp(48px, 7vw, 96px);
}
.d-side {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100dvh - 100px);
  overflow: auto;
  display: grid;
  gap: 2px;
  font-size: 0.9rem;
}
.d-side a {
  display: block;
  padding: 6px 12px;
  border-left: 1px solid var(--line);
  color: var(--mute);
  text-decoration: none;
}
.d-side a:hover,
.d-side a.is-on {
  color: var(--ink);
  border-left-color: var(--ink);
}
.d-main {
  min-width: 0;
  max-width: 820px;
}
.d-main section {
  scroll-margin-top: 84px;
  padding: 32px 0;
  border-top: 1px solid var(--line-soft);
}
.d-main h2 {
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.d-main h3 {
  font-size: 1.1rem;
  letter-spacing: -0.015em;
  margin: 24px 0 8px;
}
.d-main p,
.d-main li {
  color: var(--ink-2);
  max-width: 68ch;
}
.d-main :not(pre) > code {
  font: 500 0.84em var(--mono);
  background: var(--mist);
  border: 1px solid var(--line-soft);
  padding: 1px 6px;
  border-radius: var(--r1);
  color: var(--ink);
}
.d-code {
  position: relative;
  margin: 16px 0;
  border-radius: var(--r2);
  background: var(--night);
  color: #e6eaee;
}
.d-code pre {
  margin: 0;
  padding: 16px 56px 16px 16px;
  overflow-x: auto;
  font: 400 0.84rem/1.7 var(--mono);
}
.d-code button {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--night-line);
  border-radius: var(--r1);
  background: var(--night-2);
  color: #e6eaee;
  font: 500 0.72rem var(--mono);
  cursor: pointer;
}
.d-code button:hover {
  border-color: var(--accent);
}
.d-code button.is-done {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}
.d-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.92rem;
}
.d-main th {
  text-align: left;
  font: 500 0.72rem var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--ink);
}
.d-main td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.d-main .tbl {
  overflow-x: auto;
}
@media (max-width: 900px) {
  .d-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .d-side {
    position: static;
    max-height: none;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .d-side a {
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* ============================================================ signed-in app
   Same brand, a calmer mode: re-theme DaisyUI and the old kusuri classes. */
html.winter body,
body.app {
  font-family: var(--font);
  color: var(--ink);
  background: var(--mist);
}
body.app .bg-base-200 {
  background: var(--mist);
}
body.app a.link,
body.app .text-primary {
  color: var(--accent-ink);
}
body.app .btn {
  border-radius: var(--r2);
  font-weight: 500;
  box-shadow: none;
  text-transform: none;
}
body.app .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
body.app .btn-primary:hover {
  background: #bde030;
  border-color: #bde030;
}
body.app .card,
body.app .modal-box,
body.app .folder-section {
  border-radius: var(--r3);
  box-shadow: none;
  border-color: var(--line);
}
body.app .card {
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
body.app .card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: none;
}
body.app .input,
body.app .select,
body.app .textarea,
body.app .file-input {
  border-radius: var(--r2);
  border-color: var(--line);
  background: var(--white);
}
body.app .input:focus,
body.app .select:focus,
body.app .textarea:focus {
  outline: 0;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent);
}
body.app :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
body.app .fa-folder.text-warning {
  color: var(--ink);
}
body.app .kusuri-btn-main {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r2);
  background: var(--white);
  color: var(--ink);
  backdrop-filter: none;
  box-shadow: none;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
body.app .kusuri-btn-main::before {
  display: none;
}
body.app .kusuri-btn-main:hover {
  background: var(--ink);
  color: #fff;
  transform: none;
  box-shadow: none;
}
body.app .kusuri-btn-create,
body.app .kusuri-btn-upload {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}
body.app .kusuri-btn-create:hover,
body.app .kusuri-btn-upload:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent);
}
body.app .kusuri-btn-cancel {
  background: var(--white);
  border-color: var(--line);
  color: var(--danger);
}
body.app .kusuri-btn-cancel:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
body.app .brand-gradient {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--ink);
}
.app-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-nav__in {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.app-nav .s-brand {
  margin-right: 12px;
}
.app-nav__links {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.app-nav__links a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r2);
  color: var(--mute);
  font-size: 0.9rem;
  text-decoration: none;
}
.app-nav__links a:hover {
  background: var(--mist);
  color: var(--ink);
}
.app-nav__links a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}
.app-nav__end {
  margin-left: auto;
  position: relative;
}
.app-nav__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r2);
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--accent);
  font: 600 0.9rem var(--mono);
  cursor: pointer;
  list-style: none;
}
.app-nav__avatar::-webkit-details-marker {
  display: none;
}
.app-nav__menu {
  position: absolute;
  right: 0;
  top: 44px;
  width: 220px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  box-shadow: var(--shadow);
  display: grid;
}
.app-nav__menu a,
.app-nav__menu button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r1);
  background: none;
  color: var(--ink);
  font: 400 0.92rem var(--font);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.app-nav__menu a:hover,
.app-nav__menu button:hover {
  background: var(--mist);
}
.app-nav__menu hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 4px 0;
}
@media (max-width: 720px) {
  .app-nav__links {
    display: none;
  }
}

/* docs helpers */
.d-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.d-split {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin: 16px 0;
}
@media (max-width: 640px) {
  .d-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .d-split > .d-ex {
    max-width: 240px;
  }
}
.d-stack > * + * {
  margin-top: 14px;
}
.d-ex {
  margin: 0;
}
.d-ex .s-frame img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 6px;
}
.d-ex figcaption {
  margin-top: 8px;
}
.d-ex .s-copy {
  padding: 6px;
}
.d-ex .s-copy__tag {
  display: none;
}
.d-anatomy {
  margin: 16px 0;
  padding: 18px 20px;
  border-radius: var(--r2);
  overflow-x: auto;
}
.d-anatomy .s-url {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
.d-note {
  margin: 16px 0;
}
.d-note--warn {
  border-style: solid;
  border-color: #e0c06a;
  background: #fdf8e8;
}
.d-main section > .d-code:first-child {
  margin-top: 0;
}
.d-main ul,
.d-main ol {
  padding-left: 1.3em;
}
.d-main section > h2 + p {
  margin-top: 0;
}

body.app h1,
body.app h2 {
  letter-spacing: -0.03em;
}
body.app h1 {
  font-weight: 600;
}
body.app .table th {
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}
body.app .badge {
  border-radius: var(--r1);
  font-weight: 500;
}
@media (prefers-reduced-motion: reduce) {
  body.app * {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
