/* LoopToSong Toolkit: the shared look of every page. A control room: charcoal ground,
   sage for type, selected states and metal, orange only for what matters (actions, peaks, warnings).
   Each tool keeps its own scoped stylesheet and maps its colour variables onto these tokens. */

@font-face {
  font-family: "Archivo";
  src: url("/vendor/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/vendor/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* ground and surfaces */
  --p-bg: #2A2B2A;
  --p-deep: #1E1F1E;
  --p-panel: #323432;
  --p-panel-2: #3A3C3A;
  --p-panel-3: #424542;
  --p-line: rgba(244, 243, 236, 0.14);
  --p-line-2: rgba(244, 243, 236, 0.26);
  --p-border: #6D736E;
  /* type */
  --p-text: #ECEDE8;
  --p-head: #F4F3EC;
  --p-muted: #A9ADA8;
  --p-faint: #A2A6A0; /* 4.7:1 on --p-panel, 5.3:1 on --p-bg */
  /* sage: headings, selected, calm accents */
  --p-sage: #F4F3EC;
  --p-sage-hi: #F4F3EC;
  --p-sage-2: #C9CCC5;
  --p-sage-dim: rgba(244, 243, 236, 0.14);
  /* orange: actions, peaks, warnings */
  --p-orange: #F06A3B;
  --p-orange-hi: #F2875C;
  --p-orange-dim: rgba(240, 106, 59, 0.16);
  --p-ink: #222322;
  /* meaning (keep them apart by lightness too, not hue alone) */
  --p-good: #ECEDE8;
  --p-warn: #E2C27D;   /* sand: warnings are no longer orange */
  --p-bad: #F06A3B;
  /* fills */
  --p-fill: linear-gradient(180deg, #F27548 0%, #F06A3B 55%, #E35E30 100%);
  --p-fill-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 10px 20px -12px rgba(0, 0, 0, 0.7);
  --p-sel: linear-gradient(180deg, #F4F3EC 0%, #F4F3EC 60%, #E4E5E0 100%);
  --p-screen: repeating-linear-gradient(180deg, #282A28 0 7px, #1E1F1E 7px 10px);
  --p-rib: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.12) 70%, rgba(0, 0, 0, 0.22)), repeating-linear-gradient(90deg, #E4E5E0 0 5px, #F4F3EC 5px 8px, #ECEDE8 8px 12px, #A3BFA8 12px 14px);
  /* type */
  --p-font: Archivo, "Helvetica Neue", Arial, sans-serif;
  --p-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100vh; background: var(--p-bg); color: var(--p-text); font-family: var(--p-font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--p-bg); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--p-sage-hi); outline-offset: 3px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.p-wrap { max-width: 1280px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
@media (min-width: 900px) { .p-wrap { padding-left: max(56px, env(safe-area-inset-left, 0px)); padding-right: max(56px, env(safe-area-inset-right, 0px)); } }
.p-label { font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.3; }

/* ---------- the shell: header on every page ---------- */
.p-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: var(--p-bg); border-bottom: 1px solid var(--p-line); }
.p-top .p-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.p-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--p-sage); white-space: nowrap; }
.p-brand svg { width: 30px; height: 30px; }
.p-brand .p-bar { width: 2px; height: 24px; background: var(--p-sage); }
.p-brand b { font-stretch: 125%; font-weight: 600; font-size: 17px; letter-spacing: 0.06em; }
.p-brand b span { color: var(--p-orange); }
.p-brand small { font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--p-muted); }
.p-nav { display: flex; align-items: center; gap: 22px; }
.p-nav a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--p-text); white-space: nowrap; }
.p-nav a:hover { color: var(--p-text); text-decoration: underline; text-underline-offset: 4px; }
/* the header button never competes with the page's own action: sage outline, not orange */
.p-nav .p-btn-o { background: transparent; color: var(--p-sage); box-shadow: inset 0 0 0 1.5px var(--p-sage); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.p-nav .p-btn-o:hover { color: var(--p-sage); background: var(--p-sage-dim); filter: none; text-decoration: none; }
.p-top .acc .acc-in { font-size: 14px; letter-spacing: 0; text-transform: none; }
.p-top .acc .acc-in:hover { color: var(--p-text); }
.p-nav .p-btn { min-height: 42px; padding: 0 16px; }
@media (max-width: 560px) { .p-brand small, .p-nav .p-hide-sm { display: none; } .p-brand b { font-size: 15px; } }

/* buttons */
.p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 4px; font: 700 13px var(--p-font); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.p-btn-o { background: var(--p-fill); color: var(--p-ink); box-shadow: var(--p-fill-shadow); }
.p-btn-o:hover { color: var(--p-ink); filter: brightness(1.05); }
.p-btn-s { background: transparent; color: var(--p-sage); box-shadow: inset 0 0 0 1.5px var(--p-sage); }
.p-btn-s:hover { background: var(--p-sage-dim); }

/* the strip under the header on a tool page: where you are */
.p-crumb { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--p-line-2); color: var(--p-muted); font-size: 14px; letter-spacing: 0; text-transform: none; }
.p-crumb a { text-decoration: none; color: var(--p-sage-hi); }
.p-crumb a:hover { text-decoration: underline; text-underline-offset: 4px; }
.p-crumb .p-phase { color: var(--p-muted); }
@media (max-width: 560px) { .p-crumb .p-phase { display: none; } }

/* ---------- footer on every page ---------- */
.p-foot { margin-top: 80px; }
.p-foot .p-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--p-line-2); color: var(--p-muted); font-size: 14px; }
.p-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.p-foot nav a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--p-sage-hi); }
.p-foot nav a:hover { color: var(--p-text); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

/* very small phones: room for the brand, the account control and the button even before the account control has loaded */
@media (max-width: 359px) { .p-brand > svg, .p-brand .p-bar { display: none; } .p-nav .p-btn { padding: 0 12px; } }

/* headlines are off-white; a key phrase in <em> stays sage (2026-11-07) */
h1 em, h2 em { font-style: normal; color: var(--p-orange); }

/* ---------------------------------------------------------------------------------------------
   Depth for tool pages (2026-11-07). Roland: the tool pages were "one plane, everything melts in".
   .t-kick   a monospaced label above the title, with one small orange square
   .t-metal  sage "painted metal" panel for the controls you choose with (chips, cards, tabs):
             text on it turns dark, the keys on it stay dark charcoal, the chosen key turns orange
   .t-device sage frame that holds one or more dark screens (graphs, maps)
   .t-bezel  the same frame as a ring around a single dark screen
   .t-flow   a three-step strip under the intro, like a phase timeline
   --------------------------------------------------------------------------------------------- */
.t-kick { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font: 600 12px/1.3 var(--p-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--p-sage-2); }
.t-kick::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; background: var(--p-orange); }
.t-metal {
  --p-text: #1F201F; --p-head: #1F201F; --p-muted: #3A3C3A; --p-faint: #4A4C49; --p-sage-hi: #1F201F; --p-sage-2: #3A3C3A;
  --p-line: rgba(31, 32, 31, 0.18); --p-line-2: rgba(31, 32, 31, 0.3); --p-sel: var(--p-orange); --p-ink: #1F201F;
  color: #1F201F; background: var(--p-sage) !important; border: 0 !important; border-radius: 14px;
  padding: clamp(18px, 3vw, 32px) !important;
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.35) !important;
}
/* keys on the metal: dark, with light text again */
.t-metal :where(button, .chip, .p-chip, [role="tab"], [role="radio"], select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"])) {
  --p-text: #ECEDE8; --p-head: #F4F3EC; --p-muted: #A9ADA8; --p-faint: #A2A6A0; --p-sage-hi: #F4F3EC; --p-sage-2: #C9CCC5;
  --p-line: rgba(244, 243, 236, 0.14); --p-line-2: rgba(244, 243, 236, 0.26);
}
.t-metal :where(button, .chip, .p-chip, [role="tab"], [role="radio"]):not([class*="fill"]):not([class*="primary"]):not(.on):not(.is-on):not(.active):not(.is-active):not([aria-pressed="true"]):not([aria-selected="true"]):not([aria-checked="true"]) {
  background: #2A2B2A; color: #ECEDE8; border-color: #2A2B2A;
}
.t-metal :where(button, .chip, .p-chip, [role="tab"], [role="radio"]):is(.on, .is-on, .active, .is-active, [aria-pressed="true"], [aria-selected="true"], [aria-checked="true"]) {
  background: var(--p-orange); color: #1F201F; border-color: var(--p-orange);
}
.t-device { background: linear-gradient(180deg, #F4F3EC, #E4E5E0) !important; border-radius: 18px; padding: 12px !important; box-shadow: 0 40px 70px -34px rgba(0, 0, 0, 0.9), inset 0 2px 0 rgba(255, 255, 255, 0.4) !important; }
.t-bezel { border-radius: 14px; box-shadow: 0 0 0 10px #F4F3EC, 0 0 0 11px rgba(0, 0, 0, 0.3), 0 40px 70px -30px rgba(0, 0, 0, 0.9) !important; }
@media (max-width: 560px) { .t-bezel { box-shadow: 0 0 0 6px #F4F3EC, 0 0 0 7px rgba(0, 0, 0, 0.3), 0 30px 50px -26px rgba(0, 0, 0, 0.9) !important; } .t-device { padding: 8px !important; border-radius: 14px; } }
.t-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 980px; margin: 32px 0 40px; padding: 0; list-style: none; }
.t-flow li { margin: 0; padding: 14px 0 0; border-top: 3px solid var(--p-line-2); }
.t-flow li:first-child { border-top-color: var(--p-sage); }
.t-flow b { display: block; margin-bottom: 8px; font: 600 11px/1 var(--p-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--p-sage-2); }
.t-flow li:first-child b { color: var(--p-orange); }
.t-flow span { display: block; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--p-head); }
@media (max-width: 700px) { .t-flow { gap: 10px; margin: 22px 0 26px; } .t-flow li { padding-top: 10px; } .t-flow b { font-size: 10px; margin-bottom: 6px; } .t-flow span { font-size: 14px; } }

/* .t-cream: a full-width cream band (variant A, Roland 2026-11-10). Text on it turns ink, accents turn deep orange.
   Cream bands alternate with charcoal ones so the page has light and dark, not one tone. */
.t-cream {
  --p-text: #1F201F; --p-head: #1F201F; --p-muted: #4A4A45; --p-faint: #5E5E57; --p-sage: #B5401A; --p-sage-hi: #1F201F; --p-sage-2: #B5401A;
  --p-line: rgba(31, 32, 31, 0.14); --p-line-2: rgba(31, 32, 31, 0.25); --p-border: rgba(31, 32, 31, 0.25);
  color: #1F201F; background: #F2EEE3; box-shadow: 0 0 0 100vmax #F2EEE3; clip-path: inset(0 -100vmax);
}
.t-cream :where(h1, h2) em { color: #D9572B; }
.t-cream .t-kick { color: #B5401A; }
/* .t-dark: a dark card inside a cream band gets the dark-mode tokens back */
.t-dark, .t-cream :where(.pp-card) {
  --p-text: #ECEDE8; --p-head: #F4F3EC; --p-muted: #A9ADA8; --p-faint: #A2A6A0; --p-sage: #F4F3EC; --p-sage-hi: #F4F3EC; --p-sage-2: #C9CCC5;
  --p-line: rgba(244, 243, 236, 0.14); --p-line-2: rgba(244, 243, 236, 0.26); --p-border: #6D736E; color: var(--p-text);
}
/* .t-hero: the cream band at the top of a tool page (label, title, intro, steps); the working area below stays dark */
.t-hero { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(26px, 3.4vw, 40px); margin-bottom: clamp(28px, 4vw, 44px); }
.t-hero h1, .t-hero .t-flow span { color: #1F201F !important; }
.t-hero p:not(.t-kick) { color: #4A4A45 !important; }
.t-hero .t-kick { color: #B5401A !important; }
.t-hero .t-flow b { color: #6B6B63 !important; } .t-hero .t-flow li:first-child b { color: #B5401A !important; }
.t-hero .t-flow li { border-top-color: rgba(31, 32, 31, 0.2) !important; } .t-hero .t-flow li:first-child { border-top-color: var(--p-orange) !important; }
.t-hero .t-flow { margin-bottom: 0; }
/* the cream title band starts right under the bar above it: no strip of charcoal in between */
main:has(.t-hero), main :has(> .t-hero), main :has(.t-hero):not(:has(> :not(.t-hero) ~ .t-hero)) { padding-top: 0 !important; margin-top: 0 !important; }
.t-hero { margin-top: 0 !important; }
/* One substantial sage surface per tool (Codex review 33): .t-metal or .t-device is the one; .t-bezel becomes a thin quiet
   sage line around a dark screen. Flat colour, soft shadows, no metal gradients. */
.t-metal { box-shadow: 0 20px 40px -32px rgba(0, 0, 0, 0.7) !important; }
.t-device { background: #F4F3EC !important; border-radius: 14px; box-shadow: 0 20px 40px -32px rgba(0, 0, 0, 0.7) !important; }
.t-bezel { box-shadow: 0 0 0 1.5px rgba(244, 243, 236, 0.55), 0 20px 40px -32px rgba(0, 0, 0, 0.7) !important; }
@media (max-width: 560px) { .t-bezel { box-shadow: 0 0 0 1.5px rgba(244, 243, 236, 0.55) !important; } }
/* frames are hairlines (Codex review 34): the content leads, not the frame */
.t-bezel { box-shadow: 0 0 0 1px rgba(244, 243, 236, 0.32), 0 20px 40px -32px rgba(0, 0, 0, 0.7) !important; }
@media (max-width: 560px) { .t-bezel { box-shadow: 0 0 0 1px rgba(244, 243, 236, 0.32) !important; } }

/* ---------------------------------------------------------------------------------------------
   Lower parts (Codex review 39, 2026-11-10)
   .t-read  the reading part of a tool page (explanations, accordions, cheat sheets) on a full-width
            cream band after the dark working area: cream → dark work → cream reading → footer.
            Cards on it turn light with thin ink borders; headings ink, small accents deep orange.
   Headings are off-white on charcoal and ink on cream, never sage. Screens are flat (no slats) and
   the selected state is flat orange.
   --------------------------------------------------------------------------------------------- */
:root { --p-screen: #1F201F; --p-sel: #F06A3B; }
.t-read {
  --p-bg: #F2EEE3; --p-deep: #EAE5D8; --p-panel: #FAF7F0; --p-panel-2: #F4F0E6; --p-panel-3: #EAE5D8;
  --p-text: #1F201F; --p-head: #1F201F; --p-muted: #4A4A45; --p-faint: #5E5E57;
  --p-sage: #1F201F; --p-sage-hi: #1F201F; --p-sage-2: #B5401A; --p-sage-dim: rgba(31, 32, 31, 0.06);
  --p-line: rgba(31, 32, 31, 0.14); --p-line-2: rgba(31, 32, 31, 0.24); --p-border: rgba(31, 32, 31, 0.3);
  color: #1F201F; background: #F2EEE3; box-shadow: 0 0 0 100vmax #F2EEE3; clip-path: inset(0 -100vmax);
  margin-top: clamp(48px, 6vw, 72px); padding-top: clamp(36px, 5vw, 56px); padding-bottom: clamp(44px, 6vw, 72px);
}
.t-read :where(h1, h2, h3, h4, summary, b, strong) { color: #1F201F; }
.t-read .t-kick { color: #B5401A; }
.t-read a { color: #1F201F; }
/* the reading band runs straight into the footer */
body:has(main .t-read) .p-foot { margin-top: 0; }
body:has(main .t-read) .p-foot .p-wrap { border-top: 0; }
/* section kickers inside tools speak the same .t-kick language (mono caps, one orange square) */
html body :is(#p360-delay-grid .dg-kicker, #p360-terbeliseg .sec-n) {
  display: flex; align-items: center; gap: 10px; font: 600 12px/1.3 var(--p-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--p-muted);
}
html body :is(#p360-delay-grid .dg-kicker, #p360-terbeliseg .sec-n)::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; background: var(--p-orange); }
html body .t-read :is(.dg-kicker, .sec-n) { color: #B5401A; }
/* ink on every orange button, also where a tool re-colours its Play key (contrast 5.3:1) */
#p360-delay-grid button.p-btn-o:not(.dg-playing), #p360-phase button.p-btn-o:not(.is-playing):not(.playing) { color: #1F201F; }
/* cards on the cream reading band take the band's own colour; a hairline marks them (Roland 2026-11-11: white stood out) */
.t-read { --p-panel: transparent; --p-panel-2: rgba(31, 32, 31, 0.04); }

/* Tool pages are dark from top to bottom (Roland 2026-11-11, after a look at 16 tool and plugin sites): the title
   area (.t-top) and the reading part (.t-more) stay on charcoal; a hairline, room and a kicker set them apart. */
.t-top { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(26px, 3.4vw, 40px); margin-bottom: clamp(28px, 4vw, 44px); border-bottom: 1px solid rgba(244, 243, 236, 0.12); }
main:has(.t-top), main :has(> .t-top), main :has(.t-top):not(:has(> :not(.t-top) ~ .t-top)) { padding-top: 0 !important; margin-top: 0 !important; }
.t-top { margin-top: 0 !important; }
.t-top h1 { color: #F4F3EC; }
.t-top p:not(.t-kick) { color: #C9CCC5; }
:is(.t-top, .t-more) .t-kick { color: #C9CCC5; }
.t-more { margin-top: clamp(56px, 7vw, 88px); padding-top: clamp(36px, 5vw, 56px); border-top: 1px solid rgba(244, 243, 236, 0.14); }
.t-more :where(h1, h2, h3, h4) { color: #F4F3EC; }
.t-top .pro-note { color: #A9ADA8; }
.t-top .pro-note__k, .t-top .pro-note .pro-lock-icon { color: #F4F3EC; }
.t-top .pro-note a { color: #F28A62; }
.t-top .pro-note a:hover { color: #F4F3EC; }
.t-more { margin-top: clamp(40px, 5vw, 56px); padding-top: clamp(28px, 4vw, 40px); }   /* tighter break (Codex review 47) */
