/* Lathe: the marketing site.
   A quiet, gallery-like page; the product does the talking. The pieces of Lathe
   shown on the page (song history, a note thread, the AI conversation) are built
   in HTML below, styled like Lathe's own windows, so changing them is a text edit. */

@font-face {
  font-family: "Archivo";
  src: url(fonts/archivo.woff2) format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}

:root {
  --wall: #f4f3f0;
  --ink: #1b1b1a;
  --ink-2: #4a4945;
  --muted: #85837d;
  --hair: #dedcd6;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;

  /* Lathe's own UI colours (Source/UI/Theme.h), for the pieces of the app */
  --ui-window: #2b2b2b;
  --ui-panel: #333333;
  --ui-raised: #3b3b3b;
  --ui-header: #383838;
  --ui-sel: #464646;
  --ui-lane: #262626;
  --ui-control: #4a4a4a;
  --ui-text: #dadada;
  --ui-dim: #8e8e8e;
  --ui-accent: #e9a23b;
  --ui-record: #db4b40;
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1em; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 40px; }

/* --- top ----------------------------------------------------------------------- */
.top .wrap { display: flex; align-items: center; gap: 32px; padding-top: 26px; padding-bottom: 26px; }
.mark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.mark img { width: 22px; height: 22px; }
.top nav { margin-left: auto; display: flex; gap: 28px; font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--ink-2); }
.top nav a:hover { color: var(--ink); }

/* --- type ---------------------------------------------------------------------- */
h1 { font-size: clamp(2.6rem, 5.2vw, 4.4rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.025em; margin: 0; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.3rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 14px; }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 30em; }

/* A label on the wall beside an exhibit. */
.label { max-width: 26rem; font-size: 1.12rem; line-height: 1.55; color: var(--ink-2); }
.label::before { content: ""; display: block; width: 28px; height: 2px; background: var(--ink); margin-bottom: 18px; }
.label h2 { font-size: clamp(1.75rem, 2.5vw, 2.2rem); }
.label .what { font: 500 0.98rem var(--sans); color: var(--muted); margin-bottom: 8px; display: block; }

.btn {
  display: inline-block; padding: 13px 20px; border-radius: 3px;
  background: var(--ink); color: var(--wall); text-decoration: none; font-weight: 600; font-size: 0.98rem;
  border: 0; cursor: pointer; font-family: var(--sans);
}
.btn:hover { background: #000; color: #fff; }
.btn .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ui-record); margin-right: 9px; vertical-align: 1px; }

/* --- hero ---------------------------------------------------------------------- */
.hero { padding: 56px 0 120px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 40px; align-items: center; }
.hero .lede { margin: 26px 0 32px; }
.hero .actions { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.hero .meta { margin-top: 22px; font: 400 0.92rem var(--sans); color: var(--muted); }

.stage { perspective: 1700px; perspective-origin: 30% 40%; }
.window {
  width: 165%; border-radius: 8px; overflow: hidden; background: var(--ui-window);
  border: 1px solid #1a1a1a;
  transform-origin: 0% 50%;
  transform: rotateY(-28deg) rotateX(6deg) rotateZ(-1.5deg);
  box-shadow: 40px 50px 70px rgba(30, 28, 24, 0.22), 10px 14px 20px rgba(30, 28, 24, 0.16);
}
.window .bar { display: flex; gap: 6px; padding: 9px 12px; background: #232323; }
.window .bar i { width: 10px; height: 10px; border-radius: 50%; background: #4b4b4b; }

/* --- exhibits: label beside a piece of the app, alternating sides ---------------- */
.exhibit { padding: 110px 0; }
.exhibit .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; align-items: center; }
.exhibit .piece { grid-column: 1 / span 7; }
.exhibit .label { grid-column: 8 / span 5; }
.exhibit.flip .piece { grid-column: 6 / span 7; grid-row: 1; }
.exhibit.flip .label { grid-column: 1 / span 5; grid-row: 1; }
.exhibit .label { padding-left: 48px; }
.exhibit.flip .label { padding-left: 0; padding-right: 48px; }

/* --- the pieces of Lathe, in HTML ------------------------------------------------ */
.ui {
  font: 13px/1.4 var(--ui-font); color: var(--ui-text);
  background: var(--ui-window); border-radius: 8px; overflow: hidden;
  box-shadow: 0 30px 60px rgba(30, 28, 24, 0.18), 0 8px 18px rgba(30, 28, 24, 0.12);
  border: 1px solid #1a1a1a;
}
.ui .titlebar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #232323; color: var(--ui-dim); font-size: 12px; }
.ui .titlebar i { width: 10px; height: 10px; border-radius: 50%; background: #4b4b4b; }
.ui .titlebar span { margin-left: 10px; }
.ui .dim { color: var(--ui-dim); }
.ui .b {
  display: inline-block; padding: 4px 11px; border-radius: 3px; background: var(--ui-control); color: var(--ui-text);
  font-size: 12px; border: 1px solid #222;
}
.ui .b.on { background: var(--ui-accent); color: #1e1e1e; }

/* The AI conversation: any MCP-capable assistant, shown generically */
.chat { background: #fbfbfa; color: var(--ink); font: 15px/1.55 var(--sans); padding: 26px 28px; border-radius: 10px; border: 1px solid var(--hair);
  box-shadow: 0 30px 60px rgba(30, 28, 24, 0.12); }
.chat .you { margin-left: auto; max-width: 78%; background: #ebe9e4; padding: 10px 14px; border-radius: 14px 14px 4px 14px; margin-bottom: 14px; width: fit-content; }
.chat .ai { max-width: 92%; margin-bottom: 18px; }
.chat .tool { font: 400 0.8rem var(--sans); color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.chat .tool::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5fa86a; }
.chat code { font: 600 0.95em var(--sans); background: #ebe9e4; padding: 1px 5px; border-radius: 3px; }
.chat-wrap { position: relative; }
.chat-wrap .ui.mini { position: absolute; right: -28px; bottom: -46px; width: 270px; font-size: 12px; }
.chat-wrap .ui.mini .body { padding: 12px 14px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.check i { width: 14px; height: 14px; border-radius: 3px; background: var(--ui-accent); display: inline-grid; place-items: center; color: #1e1e1e; font-style: normal; font-size: 10px; font-weight: 700; }
.ui .on-text { color: var(--ui-accent); font-size: 11px; }

/* --- the quieter parts ------------------------------------------------------------ */
.plain { padding: 100px 0; border-top: 1px solid var(--hair); }
.two { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; }
.two > .l { grid-column: 1 / span 4; }
.two > .r { grid-column: 6 / span 7; }

.bullets { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 40px; }
.bullets li { break-inside: avoid; padding: 0 0 18px; color: var(--ink-2); font-size: 0.97rem; }
.bullets b { color: var(--ink); display: block; font-weight: 600; }

.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.downloads a { padding: 12px 18px; border: 1px solid var(--ink); border-radius: 3px; text-decoration: none; font-weight: 600; }
.downloads a span { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 0.85rem; }
.downloads a:hover { background: var(--ink); color: var(--wall); }
.downloads a:hover span { color: #bbb; }
.small { font-size: 0.88rem; color: var(--muted); }

.prices { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prices th, .prices td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.prices thead th { font: 500 0.85rem var(--sans); color: var(--muted); }
.prices td.p { font-weight: 600; white-space: nowrap; }
.scroll { overflow-x: auto; }

/* beta */
.beta { padding: 110px 0; background: #e9e7e1; }
form { background: var(--wall); padding: 30px; border-radius: 6px; }
label, legend { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; padding: 0; }
label .muted { font-weight: 400; color: var(--muted); }
input[type=email], input[type=text], textarea {
  width: 100%; font: 1rem var(--sans); color: var(--ink); background: #fff; border: 1px solid #c9c6be; border-radius: 3px;
  padding: 11px 12px; margin: 0 0 18px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.radios { display: flex; gap: 20px; }
.radios label { font-weight: 400; display: flex; gap: 7px; align-items: center; margin: 0; cursor: pointer; }
.radios input { accent-color: var(--ink); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
form .btn { width: 100%; padding: 14px; }
.fine { font-size: 0.83rem; color: var(--muted); margin: 12px 0 0; }
.formmsg { display: none; margin: 0 0 16px; padding: 11px 13px; border-radius: 3px; font-size: 0.93rem; }
.formmsg.ok { display: block; background: #e2ecdc; }
.formmsg.err { display: block; background: #f3dfda; }

.faq { columns: 2; column-gap: 48px; }
.faq div { break-inside: avoid; margin-bottom: 26px; }
.faq h3 { font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
.faq p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }

footer { padding: 36px 0 60px; color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--hair); }
footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer .r { margin-left: auto; display: flex; gap: 20px; }

@media (max-width: 960px) {
  .wrap { padding: 0 22px; }
  .hero-grid { grid-template-columns: 1fr; }
  .stage { perspective: none; }
  .window { width: 100%; transform: none; }
  .exhibit .wrap, .two { display: block; }
  .exhibit .label { margin-top: 48px; max-width: none; padding: 0; }
  .exhibit.flip .label { margin: 0 0 40px; padding: 0; }
  .exhibit { padding: 70px 0; }
  .chat-wrap .ui.mini { position: static; width: auto; margin-top: 16px; }
  .bullets, .faq { columns: 1; }
  .two > .r { margin-top: 26px; }
  .top nav a:not(:last-child) { display: none; }
}


/* --- colour: each section sits on one of Lathe's track colours ------------------- */
/* Lighter, flatter versions of the clip colours in the app, so dark text reads on them. */
.c-amber  { background: #f0b450; }   /* Lathe's accent (playhead, selection) */
.c-blue   { background: #7fb4d8; }   /* bass */
.c-pink   { background: #eb9bb6; }   /* vocal */
.c-purple { background: #c3a5e6; }   /* lead */
.c-green  { background: #b8cd78; }   /* keys */
.c-yellow { background: #ecd07a; }   /* guitar */
.c-orange { background: #e3a07c; }   /* drums */
.c-red    { background: #d9473b; color: #fff6f0; }   /* record */
.c-dark   { background: #232221; color: #e9e6df; }   /* the app's window */

body { background: #f0b450; }
.top { border: 0; }
.top nav a { color: var(--ink); }
section.plain, footer { border-top: 0; }
.c-amber .meta, .c-blue .what, .c-pink .what, .c-purple .what { color: rgba(27, 27, 26, 0.62); }
.label, .label p, .small, .lede { color: rgba(27, 27, 26, 0.82); }
.c-green .small, .c-yellow .small, .c-orange .small { color: rgba(27, 27, 26, 0.7); }
.bullets li { color: rgba(27, 27, 26, 0.82); }
.prices th, .prices td { border-bottom-color: rgba(27, 27, 26, 0.22); }
.prices thead th { color: rgba(27, 27, 26, 0.62); }
.downloads a { border-color: var(--ink); background: rgba(255, 255, 255, 0.25); }

/* shadows read as darker versions of the field, not grey */
.ui, .window { box-shadow: 0 30px 60px rgba(20, 16, 40, 0.28), 0 8px 18px rgba(20, 16, 40, 0.18); }
.chat { border: 0; box-shadow: 0 30px 60px rgba(40, 20, 70, 0.25); }

/* the beta, on record red */
.c-red h2, .c-red p { color: #fff6f0; }
.c-red .small, .c-red .small a { color: rgba(255, 246, 240, 0.85); }
.c-red form { background: #fff8f2; color: var(--ink); }
.c-red form .btn { background: var(--ink); }
.c-red form .btn .dot { background: #d9473b; }

/* questions and footer, on the app's dark grey */
.c-dark h2, .c-dark h3 { color: #f2efe8; }
.c-dark .faq p { color: #b9b5ad; }
footer.c-dark, footer.c-dark a { color: #9a968e; }

/* --- screenshots, straight from Lathe (tools/screenshots.sh) -------------------- */
.shot { margin: 0; }
.shot .frame {
  border-radius: 8px; overflow: hidden; background: #2b2b2b; border: 1px solid #1a1a1a;
  box-shadow: 0 30px 60px rgba(20, 16, 40, 0.28), 0 8px 18px rgba(20, 16, 40, 0.18);
}
.shot .frame::before { content: ""; display: block; height: 26px; background: #232323 radial-gradient(circle at 16px 13px, #4b4b4b 5px, transparent 5.5px), #232323; }
.shot .frame::before {
  background:
    radial-gradient(circle at 16px 13px, #4b4b4b 4.5px, transparent 5px),
    radial-gradient(circle at 32px 13px, #4b4b4b 4.5px, transparent 5px),
    radial-gradient(circle at 48px 13px, #4b4b4b 4.5px, transparent 5px),
    #232323;
}
.shot.mixer { margin-top: 48px; }
.shot.mixer img, img.crop { aspect-ratio: 1440 / 560; object-fit: cover; object-position: top left; width: 100%; }

/* --- the beta form: a yellow card with the track colours across the top ------- */
.c-red form.beta-form {
  position: relative; overflow: hidden;
  background: #ecd07a; color: var(--ink); padding: 40px 30px 30px; border-radius: 6px;
  box-shadow: 0 24px 50px rgba(90, 20, 10, 0.3);
}
.beta-form::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px;
  background: linear-gradient(90deg,
    #7fb4d8 0 16.66%, #eb9bb6 0 33.33%, #c3a5e6 0 50%,
    #b8cd78 0 66.66%, #f0b450 0 83.33%, #e3a07c 0);
}
.beta-form label, .beta-form legend { color: var(--ink); }
.beta-form input[type=email], .beta-form textarea { background: #fffaf0; border: 1.5px solid var(--ink); }
.beta-form input:focus, .beta-form textarea:focus { outline: 3px solid #7fb4d8; outline-offset: 1px; }
/* Mac / Windows / Linux each wear a track colour; the chosen one fills in. */
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills label { margin: 0; cursor: pointer; font-weight: 400; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span {
  --pill: #7fb4d8;
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px;
  background: #fffaf0; border: 1.5px solid var(--ink); border-radius: 999px; font-size: 0.95rem;
}
.pills span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pill); border: 1.5px solid var(--ink); }
.pills label:nth-child(2) span { --pill: #b8cd78; }
.pills label:nth-child(3) span { --pill: #c3a5e6; }
.pills input:checked + span { background: var(--pill); font-weight: 600; box-shadow: 2px 2px 0 var(--ink); }
.pills input:checked + span::before { background: var(--ink); }
.pills input:focus-visible + span { outline: 2px solid #d9473b; outline-offset: 2px; }
.beta-form .btn { width: 100%; padding: 14px; margin-top: 2px; }
.beta-form .fine { color: rgba(27, 27, 26, 0.7); }
.beta-form .muted { color: rgba(27, 27, 26, 0.6); }

/* --- the logo: a tile with a turned profile cut out of it ------------------------ */
/* Ink on light and coloured sections, cream on dark ones. */
:root { --logo-body: #1b1b1a; }
.c-dark { --logo-body: #f2efe8; }
.logo { width: 26px; height: 26px; flex: none; }
.small-mark { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: inherit; color: inherit; }
.small-mark .logo { width: 18px; height: 18px; }

/* --- song history, drawn in HTML after Lathe's History window ----------------- */
.ui.hist { font-size: 14px; box-shadow: 0 30px 60px rgba(20, 40, 70, 0.32), 0 8px 18px rgba(20, 40, 70, 0.2); }
.hist-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; padding: 12px; }
.hist-list { list-style: none; margin: 0; padding: 0; background: var(--ui-lane); border-radius: 4px; overflow: hidden; }
.hist-list li { display: flex; gap: 14px; padding: 10px 14px; border-bottom: 1px solid #1f1f1f; }
.hist-list li b { color: var(--ui-accent); width: 22px; flex: none; }
.hist-list li.sel { background: var(--ui-sel); }
.hist-list .dim { font-size: 12px; margin-top: 2px; }
.hist .kept { color: var(--ui-accent); }
.hist-detail { background: var(--ui-panel); border: 1px solid #1f1f1f; border-radius: 4px; padding: 14px 16px; }
.hist-detail > .t { font-weight: 600; }
.hist-detail > .dim { font-size: 12px; }
.hist-detail .h { margin: 16px 0 8px; color: var(--ui-dim); font-size: 12px; }
.hist-detail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist-detail li { display: flex; align-items: baseline; gap: 8px; }
.hist-detail li i { flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--t); align-self: center; }
.hist-detail li span { font-weight: 600; }
.hist-foot { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px; }
.hist-foot .dim { margin-right: auto; font-size: 12px; }
@media (max-width: 860px) {
  .hist-body { grid-template-columns: 1fr; }
  .hist-foot .dim { display: none; }
}

/* masthead wordmark, a bit bigger */
.top .mark { font-size: 1.6rem; gap: 12px; letter-spacing: -0.01em; }
.top .mark .logo { width: 36px; height: 36px; }
