/* Studio home v3: a warm editorial page, deliberately unlike either product page.
   Serif headlines, ink on ivory, one dark band for the products. The studio mark is a
   small vermilion "local" light; it turns on when the page has read a file you gave it.
   Interactions are working demos: a real local file reader, a live request meter, and
   before/after sliders. */
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

body.h3 {
  --bg: #f4f1ea; --card: #fbfaf6; --ink: #17150f; --ink2: #47433a; --mute: #8a8476;
  --line: rgba(23, 21, 15, .14); --live: #e5481c; --live-soft: #fbe3d9;
  --night: #17150f; --night-ink: #efeadf; --night-mute: #a39d8f; --night-line: rgba(239, 234, 223, .16);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
  background: var(--bg);
  color: var(--ink2);
}
.h3 a { color: var(--ink); text-decoration-color: var(--live); text-decoration-thickness: 1.5px; }
.h3 a:hover { color: var(--live); }
.h3 :focus-visible { outline: 2px solid var(--live); outline-offset: 3px; }
.h3 h1, .h3 h2, .h3 h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; color: var(--ink); line-height: 1; }
.h3 em { font-style: italic; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the local light: grey when idle, vermilion once a file has been read here */
.led { display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: #c9c3b6; transition: background .4s var(--ease), box-shadow .4s var(--ease); }
.h3.lit .led { background: var(--live); box-shadow: 0 0 0 .22em var(--live-soft); }

.h3 .site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.h3 .wordmark { font: 400 1.75rem/1 var(--serif); letter-spacing: -.01em; color: var(--ink); gap: 0; }
.h3 .wordmark .led { width: .28em; height: .28em; margin: 0 0 .5em .1em; }
.h3 .site-nav a { color: var(--ink2); }
.h3 .site-nav a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 3.5rem 0 5rem; }
.h3 h1 { max-width: 12.5em; font-size: clamp(3.1rem, 7vw, 6.4rem); line-height: .94; letter-spacing: -.025em; }
.h3 h1 em { color: var(--ink2); }
.hero-lede { max-width: 34rem; margin-top: 1.5rem; font-size: 1.2rem; line-height: 1.55; }

.bench { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.5rem; margin-top: 2.5rem; align-items: start; }
.drop { position: relative; display: grid; place-content: center; min-height: 13rem; padding: 2rem; border: 1.5px dashed rgba(23, 21, 15, .35); border-radius: 18px; background: var(--card); text-align: center; cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease); }
.drop:hover, .drop.over { border-color: var(--live); background: #fffdf8; }
.drop.over { border-style: solid; }
.drop:has(input:focus-visible) { outline: 2px solid var(--live); outline-offset: 3px; }
.drop-big { font: 400 clamp(2rem, 4vw, 2.8rem)/1 var(--serif); color: var(--ink); }
.drop-small { max-width: 28rem; margin: .8rem auto 0; color: var(--mute); }
.drop-small u { color: var(--ink); text-decoration-color: var(--live); text-underline-offset: .2em; }
.samples { margin-top: 1rem; color: var(--mute); }
.samples button { padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: .2em; cursor: pointer; }
.samples button:hover { text-decoration-color: var(--live); color: var(--live); }

/* result: a receipt for what was read */
.result { margin-top: 1.5rem; padding: 1.6rem; border-radius: 18px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.result:not([hidden]) { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; translate: 0 10px; } }
.r-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.r-file b { font: 400 1.6rem/1.1 var(--serif); color: var(--ink); word-break: break-all; }
.r-file span { color: var(--mute); font: .85rem/1.4 var(--mono); }
.r-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; margin-top: 1.1rem; align-items: start; }
.r-facts { display: grid; gap: .35rem; }
.r-facts p { color: var(--ink2); }
.r-facts strong { color: var(--ink); font-weight: 600; }
.r-thumb { width: 9rem; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.r-table { border-collapse: collapse; font-size: .85rem; margin-top: .4rem; }
.r-table td, .r-table th { padding: .25rem .6rem; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.r-table th { background: #f0ece2; color: var(--ink); font-weight: 600; }
.r-go { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.3rem; }
.h3 .r-go a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.1rem; border-radius: 999px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600; transition: background .2s var(--ease); }
.h3 .r-go a:hover { background: var(--live); color: #fff; }
.h3 .r-go a.alt { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.h3 .r-go a.alt:hover { background: transparent; color: var(--live); box-shadow: inset 0 0 0 1.5px var(--live); }
.r-none { margin-top: 1.1rem; color: var(--mute); }
.r-sent { display: flex; align-items: center; gap: .5rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--ink); font-size: .92rem; }
.r-sent::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 .2rem var(--live-soft); }

/* live request meter */
.meter { position: sticky; top: 1rem; padding: 1.5rem; border-radius: 18px; background: var(--night); color: var(--night-mute); }
.meter h2 { display: flex; align-items: center; gap: .55rem; font: 600 .95rem/1.3 var(--body); color: var(--night-ink); letter-spacing: 0; }
.meter-big { display: flex; flex-direction: column; margin-top: 1.1rem; }
.meter-big span { font: 400 5.2rem/.9 var(--serif); color: var(--night-ink); font-variant-numeric: tabular-nums; }
.meter-big small { margin-top: .4rem; font-size: .9rem; }
.meter-note { margin-top: 1rem; color: var(--night-ink); min-height: 3em; }
.h3.lit .meter-big span { color: #fff; }
.meter-log { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--night-line); font-size: .85rem; }
.meter-log summary { cursor: pointer; color: var(--night-ink); }
.meter-log ol { max-height: 12rem; overflow: auto; margin: .6rem 0 0; padding: 0; list-style: none; font: .75rem/1.5 var(--mono); }
.meter-log li { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: .5rem; padding: .15rem 0; }
.meter-log li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-log li.after { color: var(--live); }
.meter-how { margin-top: 1rem; font-size: .8rem; line-height: 1.5; }

/* ---------- products: the one dark band ---------- */
.shelf { margin-top: 3rem; padding: 6rem 0 6.5rem; background: var(--night); color: var(--night-mute); }
.shelf h2 { font-size: clamp(2.6rem, 6vw, 5rem); color: var(--night-ink); }
.shelf h2 em { color: var(--night-mute); }
.shelf-lede { margin-top: 1rem; font-size: 1.1rem; }
.prod { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 3rem; align-items: center; margin-top: 4.5rem; }
.prod-chats { grid-template-columns: minmax(0, 1fr) 22rem; }
.prod-chats .prod-head { order: 2; }
.prod h3 { display: flex; align-items: center; gap: .8rem; font-size: 3rem; color: var(--night-ink); }
.prod h3 img { width: 2.6rem; height: 2.6rem; }
.prod-tag { margin-top: 1rem; font: italic 400 1.6rem/1.15 var(--serif); color: var(--night-ink); }
.prod-desc { margin-top: .9rem; line-height: 1.6; }
.prod-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.2rem; font-size: .85rem; }
.prod-meta span { padding: .2rem .65rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--night-line); color: var(--night-ink); }
.h3 .prod-go { display: inline-block; margin-top: 1.4rem; color: var(--night-ink); font-weight: 600; text-underline-offset: .25em; }
.h3 .prod-go::after { content: "→"; display: inline-block; margin-left: .4em; transition: translate .2s var(--ease); }
.h3 .prod-go:hover { color: #fff; }
.h3 .prod-go:hover::after { translate: 4px 0; }

/* before / after comparator: a native range input drives --p */
.ba { position: relative; aspect-ratio: 16 / 10.5; overflow: hidden; border-radius: 16px; background: #24211a; box-shadow: 0 0 0 1px var(--night-line); user-select: none; }
.ba-before, .ba-after { position: absolute; inset: 0; }
.ba-after { clip-path: inset(0 0 0 var(--p)); }
.ba-label { position: absolute; top: 1rem; z-index: 2; padding: .2rem .7rem; border-radius: 999px; font: italic 400 1.05rem/1.3 var(--serif); }
.ba-before .ba-label { left: 1rem; background: rgba(23, 21, 15, .75); color: var(--night-ink); }
.ba-after .ba-label { right: 1rem; background: var(--bg); color: var(--ink); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--p); z-index: 3; width: 2px; margin-left: -1px; background: var(--night-ink); pointer-events: none; }
.ba-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; translate: -50% -50%; border-radius: 50%; background: var(--night-ink); color: var(--ink); font: 600 1rem/1 var(--body); letter-spacing: .1em; transition: scale .2s var(--ease), background .2s var(--ease); }
.ba:hover .ba-handle::after { scale: 1.08; }
.ba:has(input:focus-visible) .ba-handle::after { background: var(--live); color: #fff; }
.ba input { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }

.ba-log { padding: 4rem 1.6rem 1.5rem; background: #201d17; color: #cfc8b8; }
.ba-log ol { margin: 0; padding: 0; list-style: none; font: .82rem/1.5 var(--mono); }
.ba-log li { padding: .45rem 0; border-top: 1px solid rgba(239, 234, 223, .08); }
.ba-log time { margin-right: 1rem; color: #7d776a; }
.ba-log code { color: #f0c9a0; }
.ba-log li:last-child { color: #7d776a; }
.ba-steps { background: #e9ecf3; }
.ba-steps img { position: absolute; left: 6%; top: 15%; width: 120%; max-width: none; height: auto; border-radius: 8px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5); }

.ba-chat { padding: 4rem 1.6rem 1.5rem; background: #212121; }
.bubbles { display: grid; gap: .8rem; max-width: 30rem; font-size: .9rem; line-height: 1.45; }
.bubbles p { padding: .7rem .95rem; border-radius: 18px; }
.bubbles .me { justify-self: end; max-width: 80%; background: #303030; color: #ececec; }
.bubbles .ai { max-width: 92%; color: #d8d8d8; padding-left: 0; }
.bubbles .more { justify-self: center; padding: .2rem .8rem; color: #8e8e8e; font-size: .8rem; box-shadow: inset 0 0 0 1px #3a3a3a; }
.ba-doc { background: #0b7a63; }
.ba-doc img { position: absolute; left: 50%; top: 13%; width: 54%; height: auto; translate: -30% 0; border-radius: 4px; box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .55); }
.ba-receipt { position: absolute; right: 1rem; bottom: 1rem; padding: .5rem .9rem; border-radius: 10px; background: #d4f1e7; color: #075a49; font-weight: 600; font-size: .9rem; }
.ba-receipt b { font: 400 1.5rem/1 var(--serif); margin-right: .2rem; }

/* ---------- free tools ---------- */
.tools { padding-top: 6rem; }
.tools h2 { font-size: clamp(2.4rem, 5vw, 4rem); max-width: 20ch; }
.tools h2 em { color: var(--ink2); }
.tl { margin: 2.5rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.tl li { border-bottom: 1px solid var(--line); }
.h3 .tl a { display: grid; grid-template-columns: minmax(0, 1fr) auto 1.5rem; gap: 1.5rem; align-items: baseline; padding: 1.3rem 0; text-decoration: none; color: var(--ink); }
.h3 .tl a::after { content: "→"; color: var(--mute); transition: translate .2s var(--ease), color .2s var(--ease); }
.h3 .tl a:hover::after { translate: 5px 0; color: var(--live); }
.tl-name { font: 400 clamp(1.6rem, 3vw, 2.2rem)/1.1 var(--serif); transition: color .2s var(--ease); }
.h3 .tl a:hover .tl-name { color: var(--live); }
.tl-io { color: var(--mute); font-size: .95rem; }
.tl-io code { padding: .1rem .4rem; border-radius: 4px; background: #ebe6da; color: var(--ink2); font: .8rem/1.4 var(--mono); }

/* ---------- principles ---------- */
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; padding-top: 6rem; }
.rules p { line-height: 1.6; }
.rules em { display: block; margin-bottom: .5rem; font: italic 400 1.9rem/1.1 var(--serif); color: var(--ink); }
.rules .hello { grid-column: 1 / -1; padding-top: 2rem; border-top: 1px solid var(--line); font-size: 1.1rem; color: var(--ink); }

.h3 .site-foot { border-top: 1px solid var(--line); }
.h3 .site-foot a { color: var(--mute); }

@media (max-width: 960px) {
  .bench { grid-template-columns: 1fr; }
  .meter { position: static; }
  .prod, .prod-chats { grid-template-columns: 1fr; gap: 2rem; }
  .prod-chats .prod-head { order: 0; }
}
@media (max-width: 640px) {
  .hero { padding-top: 3rem; }
  .drop { min-height: 11rem; padding: 1.5rem; }
  .r-body { grid-template-columns: 1fr; }
  .ba { aspect-ratio: 4 / 4.4; }
  .ba-steps img { width: 190%; top: 18%; }
  .ba-doc img { width: 78%; translate: -40% 0; }
  .bubbles { font-size: .82rem; }
  .ba-log ol { font-size: .72rem; }
  .ba-log time { margin-right: .5rem; }
  .h3 .tl a { grid-template-columns: minmax(0, 1fr) 1.5rem; }
  .tl-io { grid-column: 1; grid-row: 2; }
  .h3 .tl a::after { grid-row: 1; grid-column: 2; }
  .rules { grid-template-columns: 1fr; gap: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) { .result:not([hidden]) { animation: none; } }
