/* =============================================================================
   LocoWise – palette (edit app-wide colors only here)
   --accent: primary orange | --accent-on: text/icons on dark orange areas
   --ink: main text | --bg-deep / --bg-soft: page backgrounds
   ============================================================================= */
:root {
  --accent: #E56F31;
  --accent-on: #FFFFFF;
  --ink: #0f1a24;
  --ink-muted: rgba(15, 26, 36, 0.72);
  --bg-deep: #20384B;
  --bg-soft: #3E7388;
  --surface: #f7f2eb;
  --surface-2: #ede6dc;
  --border-subtle: rgba(32, 56, 75, 0.15);
  --shadow: 0 12px 40px rgba(15, 26, 36, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --max: 1100px;
  --read-line: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

/* reading progress (unique strip — tied to scroll) */
.read-meter {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 200;
  background: rgba(32, 56, 75, 0.2);
  pointer-events: none;
}

.read-meter__fill {
  height: 100%;
  width: var(--read-line, 0%);
  background: linear-gradient(90deg, var(--accent), #f4a06a);
  transition: width 0.1s ease-out;
}

a {
  color: var(--bg-deep);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

/* ----- layout: story rail (left TOC on large screens) ----- */
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: minmax(200px, 240px) 1fr;
  }
}

.story-rail {
  position: relative;
  background: linear-gradient(180deg, var(--bg-deep) 0%, #1a2d3d 100%);
  color: var(--accent-on);
  padding: 1.5rem 1rem 2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 959px) {
  .story-rail {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.story-rail__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.story-rail__logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.story-rail h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
}

.story-rail p.sub {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: 500;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.toc a[aria-current="page"] {
  background: rgba(229, 111, 49, 0.2);
  border-left-color: var(--accent);
  color: #fff;
}

.toc a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.toc__label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.5;
  margin: 1rem 0 0.4rem 0.75rem;
}

.toc__label:first-child {
  margin-top: 0;
}

/* main column */
main {
  min-width: 0;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

/* hero – angled panel + demo strip (unique) */
.hero {
  position: relative;
  padding: 2.5rem 0 2rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -2px -4px auto;
  height: 120%;
  background: linear-gradient(
    160deg,
    var(--bg-soft) 0%,
    var(--bg-deep) 55%,
    #152433 100%
  );
  transform: skewY(-2.5deg);
  transform-origin: 100% 0;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  color: var(--accent-on);
}

.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.9;
  margin-bottom: 0.75rem;
}

.hero h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.hero__lead {
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.95;
  max-width: 52ch;
  margin: 0 0 1.5rem;
}

/* rotating story seed – one unique widget */
.story-seed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  max-width: 100%;
  margin-bottom: 1.5rem;
}

.story-seed__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
  flex: 0 0 100%;
}

.story-seed__text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  min-height: 1.4em;
  flex: 1 1 200px;
}

.story-seed__dots {
  display: flex;
  gap: 4px;
}

.story-seed__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: seedPulse 1.2s ease-in-out infinite;
}

.story-seed__dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.story-seed__dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes seedPulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.story-seed__rotor {
  position: relative;
  display: block;
  min-height: 1.4em;
}

.story-seed__rotor span {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  animation: lineCycle 18s infinite;
}

.story-seed__rotor span:nth-child(1) {
  animation-delay: 0s;
}
.story-seed__rotor span:nth-child(2) {
  animation-delay: 3s;
}
.story-seed__rotor span:nth-child(3) {
  animation-delay: 6s;
}
.story-seed__rotor span:nth-child(4) {
  animation-delay: 9s;
}
.story-seed__rotor span:nth-child(5) {
  animation-delay: 12s;
}
.story-seed__rotor span:nth-child(6) {
  animation-delay: 15s;
}

@keyframes lineCycle {
  0%,
  2% {
    opacity: 0;
  }
  3%,
  14% {
    opacity: 1;
  }
  16%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-seed__rotor span,
  .story-seed__dots span {
    animation: none;
  }
  .story-seed__rotor span:first-child {
    opacity: 1;
    position: static;
  }
  .story-seed__rotor span:not(:first-child) {
    display: none;
  }
  html {
    scroll-behavior: auto;
  }
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badges span {
  font-size: 0.7rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* screenshots – horizontal “filmstrip” (unique) */
.film {
  position: relative;
  margin: -1rem 0 2.5rem;
  z-index: 1;
}

.film__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1.25rem 1.25rem 1.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 4%,
    #000 96%,
    transparent 100%
  );
}

.film__frame {
  flex: 0 0 auto;
  width: min(200px, 55vw);
  scroll-snap-align: center;
  border-radius: 20px;
  background: #111;
  padding: 6px;
  box-shadow: var(--shadow);
  position: relative;
}

.film__frame::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 70%;
  height: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  filter: blur(4px);
}

.film__frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #1a1a1a;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
}

.film__caption {
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
}

.dots-deco {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--bg-soft);
  margin: 0.5rem 0 0;
}

/* feature bands – offset cards */
.band {
  margin: 2.5rem 0;
}

.band h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--bg-deep);
  margin: 0 0 0.5rem;
}

.band p {
  margin: 0 0 1rem;
  color: var(--ink-muted);
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.35rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 24px rgba(32, 56, 75, 0.06);
  position: relative;
  overflow: hidden;
}

.card:nth-child(odd) {
  transform: translateY(4px);
}

.card:nth-child(even) {
  transform: translateY(-2px);
}

@media (min-width: 640px) {
  .card:nth-child(odd) {
    transform: translateY(6px);
  }
  .card:nth-child(even) {
    transform: translateY(-4px);
  }
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--bg-soft));
  opacity: 0.85;
}

.card h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--bg-deep);
}

.card p {
  font-size: 0.95rem;
  margin: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.pill-list span {
  font-size: 0.75rem;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

/* library strip */
.library-strip {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.library-strip__item {
  font-size: 0.7rem;
  padding: 0.4rem 0.65rem;
  background: var(--bg-deep);
  color: #fff;
  border-radius: 6px;
  opacity: 0.9;
}

/* audience block */
.audience {
  background: linear-gradient(135deg, var(--surface-2) 0%, #e8dfd2 100%);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  margin: 2rem 0;
  border: 1px dashed var(--border-subtle);
}

.audience h3 {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
  color: var(--bg-deep);
}

.audience ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-muted);
}

.audience li {
  margin: 0.35rem 0;
}

/* CTA */
.cta {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  background: var(--bg-deep);
  color: var(--accent-on);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.cta::after {
  content: "";
  position: absolute;
  right: -20%;
  top: -40%;
  width: 200px;
  height: 200px;
  background: var(--accent);
  opacity: 0.2;
  border-radius: 50%;
  filter: blur(40px);
}

.cta p {
  position: relative;
  z-index: 1;
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-family: var(--font-display);
}

.cta .fine {
  font-size: 0.8rem;
  opacity: 0.7;
  margin: 0.75rem 0 0;
}

/* footer */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 600px) {
  .site-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* legal + article pages */
.page-hero--simple {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.page-hero--simple h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  color: var(--bg-deep);
  margin: 0 0 0.35rem;
}

.page-hero--simple .meta {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.prose {
  max-width: 65ch;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--bg-deep);
  margin: 1.75rem 0 0.5rem;
}

.prose p,
.prose li {
  color: var(--ink-muted);
  margin: 0.6rem 0;
}

.prose ul {
  padding-left: 1.2rem;
}

.prose strong {
  color: var(--ink);
}

/* contacts */
.grid-2 {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 800px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.vcard {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 6px 28px rgba(32, 56, 75, 0.08);
}

.vcard h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 1rem;
  color: var(--bg-deep);
}

.vcard dl {
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.vcard dt {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin: 0;
}

.vcard dd {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
}

/* FORM: set action= to your server endpoint, or use a form service */
.form {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--border-subtle);
}

.form h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 1rem;
  color: var(--bg-deep);
}

.form label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.form input,
.form textarea {
  width: 100%;
  margin-bottom: 0.9rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
}

.form textarea {
  min-height: 100px;
  resize: vertical;
}

.form code {
  font-size: 0.9em;
  background: rgba(32, 56, 75, 0.08);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-on);
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* decorative svg block between sections */
.filigree {
  display: block;
  margin: 1.5rem auto;
  color: var(--bg-soft);
  opacity: 0.5;
}

/* skip link */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}
