/* Merienda Systems website. Placeholder brand (ube + mango) until the official kit arrives: change the
   five --ms-* colors below and the whole site follows. */
:root {
  --ms-primary: #4B2E83;      /* ube */
  --ms-primary-deep: #34205E;
  --ms-accent: #F4A83A;       /* mango */
  --ms-accent-soft: #FDEBCB;
  --ms-cream: #FBF7F0;
  --ms-ink: #1F1A24;
  --ms-text: #3A3443;
  --ms-muted: #6B6475;
  --ms-line: #E9E2D6;
  --ms-surface: #FFFFFF;
  --ms-tint: #F3EEF9;
  --ms-green: #1F7A4D;
  --ms-radius: 16px;
  --ms-font: "Satoshi", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ms-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ms-wrap: 1180px;
  --ms-shadow: 0 1px 2px rgba(31, 26, 36, .05), 0 8px 28px rgba(31, 26, 36, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--ms-font); color: var(--ms-text); background: var(--ms-cream); font-size: 17px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ms-primary); text-underline-offset: 3px; }
a:hover { color: var(--ms-primary-deep); }
h1, h2, h3, h4 { color: var(--ms-ink); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(40px, 5.4vw, 64px); font-weight: 900; }
h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 900; }
h3 { font-size: 21px; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--ms-accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: var(--ms-wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ms-muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ms-ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: 16px; text-decoration: none; border: 2px solid transparent; transition: background .15s, transform .15s, border-color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; font-size: 15px; border-radius: 10px; }
.btn-lg { padding: 15px 24px; font-size: 17px; }
.btn-primary { background: var(--ms-primary); color: #fff; }
.btn-primary:hover { background: var(--ms-primary-deep); color: #fff; }
.btn-accent { background: var(--ms-accent); color: var(--ms-ink); }
.btn-accent:hover { background: #E8962A; color: var(--ms-ink); }
.btn-ghost { background: transparent; color: var(--ms-ink); border-color: var(--ms-line); }
.btn-ghost:hover { border-color: var(--ms-primary); color: var(--ms-primary); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover { border-color: #fff; color: #fff; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 247, 240, .9); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--ms-line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.ms-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ms-ink); font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.ms-logo b { font-weight: 900; margin-left: 4px; }
.ms-mark { flex: none; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { color: var(--ms-text); text-decoration: none; font-weight: 500; font-size: 16px; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current] { color: var(--ms-primary); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--ms-line); border-radius: 10px; background: var(--ms-surface); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav-toggle span { width: 18px; height: 2px; background: var(--ms-ink); border-radius: 2px; }

/* Eyebrows, badges, chips */
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ms-primary); margin-bottom: 14px; }
.dash { width: 24px; height: 3px; border-radius: 3px; background: var(--ms-accent); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--ms-tint); color: var(--ms-primary); }
.badge-live { background: #E3F4EA; color: var(--ms-green); }
.badge-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(31,122,77,.18); }
.chips { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 14px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: var(--ms-cream); border: 1px solid var(--ms-line); }

/* Hero */
.hero { padding: 72px 0 88px; background: radial-gradient(80% 60% at 90% 10%, #F1E6FA 0%, transparent 60%), radial-gradient(60% 50% at 0% 100%, #FDEFD6 0%, transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 64px; align-items: center; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--ms-accent-soft) 62%); }
.lead { font-size: 20px; color: var(--ms-text); max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.hero-note { color: var(--ms-muted); font-size: 15px; margin-top: 18px; }
.menu-board { background: var(--ms-surface); border-radius: 22px; box-shadow: var(--ms-shadow); border: 1px solid var(--ms-line); padding: 22px; display: grid; gap: 12px; transform: rotate(1.2deg); }
.menu-head { display: flex; justify-content: space-between; font-weight: 700; color: var(--ms-ink); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; padding: 0 4px 6px; border-bottom: 2px dashed var(--ms-line); }
.menu-time { font-family: var(--ms-mono); color: var(--ms-primary); }
.menu-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; text-decoration: none; color: var(--ms-ink); }
.menu-item b { display: block; font-size: 18px; }
.menu-item small { display: block; color: var(--ms-muted); font-size: 14px; }
.menu-live { background: #FFF8E3; border: 1px solid #F6E2A8; transition: transform .15s; }
.menu-live:hover { transform: translateX(3px); color: var(--ms-ink); }
.menu-live img { border-radius: 10px; }
.menu-soon { border: 2px dashed var(--ms-line); grid-template-columns: 44px 1fr; }
.soon-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ms-tint); color: var(--ms-primary); font-weight: 900; font-family: var(--ms-mono); }
.menu-foot { text-align: center; font-size: 14px; color: var(--ms-muted); padding-top: 6px; }

/* Sections */
.section { padding: 96px 0; }
.section-lead { font-size: 19px; max-width: 760px; color: var(--ms-text); margin-bottom: 40px; }
.section-warm { background: #FFF7E8; border-block: 1px solid #F3E4C4; }
.section-ink { background: var(--ms-ink); color: #D9D3E2; }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .section-lead { color: #CFC8DA; }
.section-ink .eyebrow { color: var(--ms-accent); }
.fine { margin-top: 28px; font-weight: 700; }
.fine a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.product-card { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 20px; padding: 28px; box-shadow: var(--ms-shadow); display: flex; flex-direction: column; }
.product-card h3 { font-size: 28px; font-weight: 900; margin-bottom: 4px; }
.product-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.product-icon { border-radius: 14px; }
.product-tagline { font-weight: 700; color: var(--ms-primary); }
.product-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.product-soon { background: transparent; border: 2px dashed var(--ms-line); box-shadow: none; }
.product-soon h3 { color: var(--ms-muted); }

.spotlight { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.spot-logo { width: 260px; margin-bottom: 22px; }
.ticks { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 12px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.ticks svg { color: var(--ms-green); margin-top: 4px; }
.ticks.small { font-size: 16px; gap: 9px; }
.spot-shots { position: relative; margin: 0; padding-bottom: 40px; }
.shot-desktop { border-radius: 14px; box-shadow: var(--ms-shadow); border: 1px solid var(--ms-line); }
.shot-phone { position: absolute; width: 30%; right: -12px; bottom: 0; border-radius: 22px; border: 6px solid var(--ms-ink); box-shadow: 0 18px 40px rgba(31,26,36,.25); }

.deploy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.deploy-card { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 4px; }
.deploy-card h3 { font-size: 26px; font-weight: 900; margin: 14px 0 0; }
.deploy-sub { color: var(--ms-muted); margin-bottom: 14px; }
.deploy-for { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--ms-line); font-weight: 700; color: var(--ms-ink); font-size: 15px; margin-bottom: 0; }
.deploy-featured { border: 2px solid var(--ms-primary); box-shadow: 0 10px 30px rgba(75,46,131,.14); }

.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.demo-card { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; padding: 22px; border-radius: 20px; background: #2A2431; border: 1px solid #3A3343; text-decoration: none; color: #D9D3E2; transition: border-color .15s, transform .15s; }
.demo-card:hover { border-color: var(--ms-accent); transform: translateY(-2px); color: #D9D3E2; }
.demo-card img { border-radius: 16px; border: 4px solid #0F0C12; }
.demo-card .badge { background: #3A3343; color: var(--ms-accent); }
.demo-card h3 { margin-top: 10px; font-size: 24px; }
.demo-url { display: inline-flex; align-items: center; gap: 6px; font-family: var(--ms-mono); font-size: 14px; color: var(--ms-accent); }
.tv-shot { margin: 28px 0 0; }
.tv-shot img { border-radius: 16px; border: 1px solid #3A3343; }
.tv-shot figcaption { font-size: 15px; color: #A79FB3; margin-top: 10px; text-align: center; }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.values > div { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 18px; padding: 24px; }
.values h3 { font-size: 19px; }
.values p { margin: 0; color: var(--ms-text); font-size: 16px; }

.cta-band { background: var(--ms-primary); color: #E9E1F7; padding: 64px 0; }
.cta-band h2 { color: #fff; font-size: clamp(28px, 3vw, 38px); }
.cta-row { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-row p { margin: 0; font-size: 18px; }
.cta-row .hero-actions { margin: 0; }

/* Footer */
.site-footer { background: var(--ms-surface); border-top: 1px solid var(--ms-line); padding: 56px 0 28px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ms-muted); margin-bottom: 12px; }
.footer-grid a, .footer-grid span { display: block; color: var(--ms-text); text-decoration: none; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--ms-primary); }
.footer-brand p { color: var(--ms-muted); margin-top: 14px; max-width: 300px; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--ms-line); color: var(--ms-muted); font-size: 14px; }

/* ── Docs ─────────────────────────────────────────────────────────────── */
.docs-hub { padding: 64px 0 96px; }
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 48px; padding-top: 36px; padding-bottom: 96px; align-items: start; }
.docs-side { position: sticky; top: 96px; max-height: calc(100vh - 110px); overflow: auto; font-size: 15px; padding-right: 6px; }
.docs-product { display: flex; align-items: center; gap: 10px; font-weight: 900; color: var(--ms-ink); text-decoration: none; font-size: 18px; margin-bottom: 18px; }
.docs-product img { border-radius: 8px; }
.docs-side h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ms-muted); margin: 20px 0 6px; }
.docs-side a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ms-text); text-decoration: none; }
.docs-side a:hover { background: var(--ms-tint); color: var(--ms-primary); }
.docs-side a[aria-current] { background: var(--ms-tint); color: var(--ms-primary); font-weight: 700; }
.docs-filter { width: 100%; padding: 9px 12px; border: 1px solid var(--ms-line); border-radius: 10px; font: inherit; font-size: 15px; background: var(--ms-surface); margin-bottom: 4px; }
.docs-toc { position: sticky; top: 96px; font-size: 14px; }
.docs-toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ms-muted); margin-bottom: 8px; }
.docs-toc a { display: block; color: var(--ms-muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 2px solid var(--ms-line); }
.docs-toc a:hover, .docs-toc a.active { color: var(--ms-primary); border-left-color: var(--ms-primary); }
.docs-toc a.h3 { padding-left: 24px; font-size: 13px; }
.crumbs { font-size: 14px; color: var(--ms-muted); margin-bottom: 14px; }
.crumbs a { color: var(--ms-muted); text-decoration: none; }
.crumbs a:hover { color: var(--ms-primary); }

.prose { max-width: 780px; }
.prose h1 { font-size: clamp(34px, 4vw, 46px); margin-bottom: 12px; }
.prose .doc-lead { font-size: 20px; color: var(--ms-muted); margin-bottom: 32px; }
.prose h2 { font-size: 28px; margin: 52px 0 14px; padding-top: 8px; scroll-margin-top: 90px; }
.prose h3 { font-size: 20px; margin: 32px 0 10px; scroll-margin-top: 90px; }
.prose h2 a.anchor, .prose h3 a.anchor { color: var(--ms-line); text-decoration: none; margin-left: 8px; opacity: 0; transition: opacity .15s; }
.prose h2:hover a.anchor, .prose h3:hover a.anchor { opacity: 1; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 1.1em; }
.prose li { margin-bottom: 6px; }
.prose li > ul { margin-top: 6px; }
.prose code { font-family: var(--ms-mono); font-size: .86em; background: var(--ms-tint); color: var(--ms-primary-deep); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--ms-ink); color: #EDE7F5; padding: 18px 20px; border-radius: 14px; overflow: auto; font-size: 14px; line-height: 1.55; margin: 0 0 1.4em; }
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.prose .table-wrap { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--ms-line); border-radius: 14px; background: var(--ms-surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--ms-line); vertical-align: top; }
.prose th { background: #FAF6EF; color: var(--ms-ink); font-weight: 700; }
.prose td:first-child { min-width: 150px; }
.prose tr:last-child td { border-bottom: 0; }
.prose blockquote { margin: 0 0 1.4em; padding: 14px 18px; border-radius: 12px; background: var(--ms-tint); border-left: 4px solid var(--ms-primary); }
.prose blockquote p:last-child { margin: 0; }
.prose blockquote.tip { background: #E9F6EF; border-left-color: var(--ms-green); }
.prose blockquote.warn { background: #FFF4E0; border-left-color: var(--ms-accent); }
.prose img { border-radius: 14px; border: 1px solid var(--ms-line); margin: 8px 0 18px; }
.prose figure { margin: 0 0 1.6em; }
.prose figcaption { font-size: 14px; color: var(--ms-muted); text-align: center; }
.prose .shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.prose .shots img { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--ms-line); margin: 40px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 1.6em; }
.cards a { display: block; padding: 18px; border-radius: 14px; background: var(--ms-surface); border: 1px solid var(--ms-line); text-decoration: none; color: var(--ms-text); transition: border-color .15s, transform .15s; }
.cards a:hover { border-color: var(--ms-primary); transform: translateY(-2px); }
.cards b { display: block; color: var(--ms-ink); font-size: 17px; margin-bottom: 4px; }
.cards span { font-size: 15px; color: var(--ms-muted); }
.diagram { background: var(--ms-surface); border: 1px solid var(--ms-line); border-radius: 16px; padding: 20px; margin: 0 0 1.6em; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 560px; height: auto; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 1.4em; }
.flow span { padding: 6px 12px; border-radius: 999px; background: var(--ms-surface); border: 1px solid var(--ms-line); font-weight: 700; font-size: 14px; color: var(--ms-ink); }
.flow i { color: var(--ms-muted); font-style: normal; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a { padding: 16px 18px; border: 1px solid var(--ms-line); border-radius: 14px; text-decoration: none; background: var(--ms-surface); }
.pager a:hover { border-color: var(--ms-primary); }
.pager small { display: block; color: var(--ms-muted); font-size: 13px; }
.pager b { color: var(--ms-ink); }
.pager .next { text-align: right; grid-column: 2; }
.doc-meta { margin-top: 40px; font-size: 14px; color: var(--ms-muted); }

/* Responsive */
@media (max-width: 1100px) {
  .docs-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 900px) {
  .hero-grid, .spotlight, .demo-grid { grid-template-columns: 1fr; }
  .deploy-grid, .values { grid-template-columns: 1fr 1fr; }
  .menu-board { transform: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: flex; }
  .site-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--ms-cream); border-bottom: 1px solid var(--ms-line); padding: 8px 24px 20px; }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--ms-line); }
  .site-nav .btn { margin-top: 14px; justify-content: center; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .docs-side { position: static; max-height: none; border: 1px solid var(--ms-line); border-radius: 14px; padding: 14px; background: var(--ms-surface); }
  .docs-side details:not([open]) .docs-nav { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .hero { padding: 44px 0 56px; }
  .deploy-grid, .values { grid-template-columns: 1fr; }
  .demo-card { grid-template-columns: 96px 1fr; gap: 14px; padding: 16px; }
  .shot-phone { width: 34%; right: 0; }
  .prose .shots { grid-template-columns: 1fr 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Docs sidebar header (a <details> so phones can fold it) */
.docs-side summary { list-style: none; cursor: default; }
.docs-side summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) {
  .docs-side summary { cursor: pointer; margin-bottom: 0; justify-content: space-between; }
  .docs-side summary::after { content: "Menu ▾"; font-size: 14px; font-weight: 700; color: var(--ms-primary); }
  .docs-side details[open] summary { margin-bottom: 14px; }
  .docs-side details[open] summary::after { content: "Close ▴"; }
}
