/* ==========================================================================
   Editorial Cloud — design system for sahammantul.com & naya.sahammantul.com
   N206 / RW2. Plain CSS, no build step. Load after the Google Fonts link.

   Theme: light by default. Dark mode is OPT-IN via <html data-theme="dark">
   (used by the Naya app shell, not by the marketing site).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces & ink */
  --paper:    #F0EEE9;   /* Cloud Dancer — main background */
  --paper-2:  #E7E4DD;   /* alternating sections, cards */
  --ink:      #141414;   /* headings, heavy rules, primary button */
  --ink-2:    #3A3935;   /* body copy */
  --muted:    #5C5A55;   /* labels, captions, kickers (5.9:1 on paper) */
  --rule:     #C9C5BC;   /* hairline dividers */

  /* Accents — NEVER used as text colour on a light surface */
  --neon:     #AAEE00;   /* highlighter, plan zone, active nav underline */
  --amber:    #F2B544;   /* "approaching" state in infographics */
  --on-accent:#141414;   /* text that sits ON neon/amber — always dark */

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --fs-h1:     clamp(2.125rem, 1.35rem + 3.9vw, 4rem);      /* 34 → 64 */
  --fs-h2:     clamp(1.5rem,   1.15rem + 1.75vw, 2.5rem);   /* 24 → 40 */
  --fs-h3:     clamp(1.125rem, 1rem + 0.6vw, 1.5rem);       /* 18 → 24 */
  --fs-body:   clamp(1rem,     0.97rem + 0.15vw, 1.0625rem);/* 16 → 17 */
  --fs-small:  0.875rem;
  --fs-kicker: clamp(0.6875rem, 0.66rem + 0.1vw, 0.75rem);  /* 11 → 12, hanya untuk label kapital */
  --fs-fine:   clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);  /* 12 → 13, untuk cetakan kecil yang dibaca */

  /* Rhythm */
  --gap:       1.25rem;
  --section-y: clamp(3rem, 2rem + 5vw, 6rem);
  --measure:   66ch;
  --radius:    3px;      /* editorial = tegas, bukan pil */
  --tap:       48px;     /* minimum touch target */

  color-scheme: light;
}

/* Dark mode — Naya app shell only. Same palette, ink becomes the ground. */
:root[data-theme="dark"] {
  --paper:   #141414;
  --paper-2: #1E1E1B;
  --ink:     #F0EEE9;
  --ink-2:   #D6D3CC;
  --muted:   #928F88;
  --rule:    #35342F;
  --neon:    #AAEE00;
  --amber:   #F2B544;
  --on-accent: #141414;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.ec-wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-left:  max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.ec-section { padding-block: var(--section-y); }
.ec-band    { background: var(--paper-2); }

.ec-stack      { display: flex; flex-direction: column; gap: var(--gap); }
.ec-stack--sm  { gap: 0.5rem; }
.ec-stack--lg  { gap: 2rem; }

.ec-cols {
  display: grid;
  gap: clamp(1.25rem, 1rem + 1.5vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.ec-cols > * { min-width: 0; }

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */
.ec-kicker {
  margin: 0;
  font-size: var(--fs-kicker);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.ec-h1, .ec-h2, .ec-h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
  font-variation-settings: "opsz" 96;
}
.ec-h1 { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.02em; }
.ec-h2 { font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.015em; }
.ec-h3 { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.01em; font-variation-settings: "opsz" 36; }

.ec-italic { font-style: italic; }

.ec-lead  { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); color: var(--ink-2); max-width: var(--measure); margin: 0; }
.ec-body  { max-width: var(--measure); margin: 0; }
.ec-small { font-size: var(--fs-small); color: var(--muted); margin: 0; }

/* Highlighter. Light: ink text, neon swipe across the lower half.
   Dark: a solid neon block, because dark text needs a filled ground. */
.ec-mark {
  background-image: linear-gradient(transparent 55%, var(--neon) 55%);
  padding-inline: 0.04em;
}
:root[data-theme="dark"] .ec-mark {
  background-image: none;
  background-color: var(--neon);
  color: var(--on-accent);
  padding-inline: 0.12em;
}

/* --------------------------------------------------------------------------
   5. Logo
   The wordmark is Montserrat ExtraBold, so it ships as an SVG file rather than
   live text — that keeps the site to two webfonts (Fraunces + Instrument Sans).
     naya-logo-B-stabilo.svg  + naya-logo-dark.svg          → hero, footer
     naya-logo-C-compact.svg  + naya-logo-dark-compact.svg  → nav, 40px tall
   Each pair shares a canvas, so swapping light↔dark keeps the wordmark size.
   -------------------------------------------------------------------------- */
.ec-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  min-height: var(--tap);   /* tautan logo juga target sentuh */
}
.ec-logo img {
  display: block;
  width: auto;
  height: var(--logo-h, 44px);
}
.ec-logo--nav  { --logo-h: 40px; }
.ec-logo--hero { --logo-h: clamp(56px, 4vw, 76px); }

/* Swap to the light-on-dark file when the app runs in dark mode. */
.ec-logo__dark { display: none; }
:root[data-theme="dark"] .ec-logo__light { display: none; }
:root[data-theme="dark"] .ec-logo__dark  { display: block; }

/* --------------------------------------------------------------------------
   6. Masthead & nav
   -------------------------------------------------------------------------- */
.ec-masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
  border-bottom: 1.5px solid var(--ink);
}
.ec-masthead__edition {
  font-size: var(--fs-kicker);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ec-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.ec-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.ec-nav a:hover { color: var(--ink); }
.ec-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--neon); }

/* --------------------------------------------------------------------------
   7. Rules & cards
   -------------------------------------------------------------------------- */
.ec-rule          { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.ec-rule--strong  { border-top: 1.5px solid var(--ink); }

.ec-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 0.9rem + 0.8vw, 1.75rem);
  display: flex; flex-direction: column; gap: 0.6rem;
}
.ec-band .ec-card { background: var(--paper); }
.ec-card--feature { border: 1.5px solid var(--ink); }

/* --------------------------------------------------------------------------
   8. Buttons
   -------------------------------------------------------------------------- */
.ec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: var(--tap);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.ec-btn--primary   { background: var(--ink); color: var(--paper); }
.ec-btn--primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.ec-btn--secondary { background: transparent; color: var(--ink); }
.ec-btn--secondary:hover { background: var(--ink); color: var(--paper); }
.ec-btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* --------------------------------------------------------------------------
   9. Garis posisi beranotasi  — the signature infographic
   Usage:
   <div class="ec-posline" style="--zone-a:34%;--zone-b:58%;--now:44%">
   -------------------------------------------------------------------------- */
.ec-posline {
  --zone-a: 35%;
  --zone-b: 60%;
  --now: 45%;
  position: relative;
  padding-block: 2.25rem 2.75rem;
}
.ec-posline__track {
  position: relative;
  height: 18px;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
}
.ec-posline__zone {
  position: absolute;
  inset-block: 0;
  left: var(--zone-a);
  right: calc(100% - var(--zone-b));
  background: var(--neon);
}
.ec-posline__zone--near { background: var(--amber); }
.ec-posline__dot {
  position: absolute;
  top: 50%;
  left: var(--now);
  width: 13px; height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--paper);
}
.ec-posline__tag {
  position: absolute;
  left: var(--at, 50%);
  transform: translateX(-50%);
  font-size: var(--fs-kicker);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  text-align: center;
}
.ec-posline__tag--above { bottom: calc(100% + 0.45rem); }
.ec-posline__tag--below { top: calc(100% + 0.45rem); }
.ec-posline__tag strong {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ec-posline__tag--edge-start { transform: none; left: 0; text-align: left; }
.ec-posline__tag--edge-end   { transform: none; left: auto; right: 0; text-align: right; }

/* -------------------------------------------------------------------------
   10. Table
   -------------------------------------------------------------------------- */
.ec-table-scroll { overflow-x: auto; }
.ec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
.ec-table th {
  text-align: left;
  font-size: var(--fs-kicker);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1.5px solid var(--ink);
  white-space: nowrap;
}
.ec-table td {
  padding: 0.85rem 0.75rem 0.85rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
}
.ec-table td:first-child { color: var(--ink); font-weight: 600; }
.ec-table .ec-num {
  text-align: right;
  padding-right: 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   11. Quote & disclaimer
   -------------------------------------------------------------------------- */
.ec-quote {
  margin: 0;
  padding-left: clamp(1rem, 0.7rem + 1vw, 1.75rem);
  border-left: 1.5px solid var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.875rem);
  line-height: 1.3;
  color: var(--ink);
  max-width: 34ch;
}
.ec-quote footer {
  margin-top: 0.9rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--fs-kicker);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.ec-disclaimer {
  font-size: var(--fs-fine);
  line-height: 1.5;
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

/* --------------------------------------------------------------------------
   12. Phone frame (app screenshots)
   -------------------------------------------------------------------------- */
.ec-phone {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 9 / 19;
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  padding: 10px;
  overflow: hidden;
}
.ec-phone__screen {
  height: 100%;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.85rem;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 0.6rem;
}

/* --------------------------------------------------------------------------
   13. Small tabs (Android / iPhone)
   -------------------------------------------------------------------------- */
.ec-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); }
.ec-tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  min-height: var(--tap);
  padding: 0 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.ec-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--neon); }

/* --------------------------------------------------------------------------
   14. Utilities
   -------------------------------------------------------------------------- */
.ec-num-tab { font-variant-numeric: tabular-nums; }
.ec-ink { color: var(--ink); }
.ec-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
