/* ==========================================================================
   Neo Leaf — neoleaf.co.th

   Colour and type are taken from the two live Neo Leaf sites, not invented:
     neoleaf-manufacturing.com   navy #0e1b4d · mint #00d49e
     neoleaf-products.com        navy #081831 · mint #00d49e
   Both share the mint. The navy differs between them; this site follows
   products.com's #081831 because it is also the exact fill of the mono
   emblem artwork, which makes it the defensible one of the two.

   Every value is authored in :root and nowhere else, so correcting the
   scheme is a one-file edit.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Mainlux Light — self-hosted from the .woff2 already served by
   neoleaf-products.com's own CDN, so this is the same licensed webfont the
   products site uses rather than a desktop font pressed into web service.

   unicode-range is load-bearing, not an optimisation. Mainlux contains 372
   glyphs: Latin only, with NO Thai and NO Cyrillic. Declaring the range stops
   the browser trying Mainlux for Thai or Russian text and sends those
   characters straight to a font that can actually render them.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Mainlux";
  src: url("assets/fonts/mainlux-light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-017F, U+2000-206F, U+2122, U+2212;
}

:root {
  /* --- Brand, as actually used across the Neo Leaf properties */
  --nl-navy:      #081831;  /* products.com + the mono emblem fill */
  --nl-mint:      #00d49e;  /* the accent, shared by BOTH sites */
  --nl-mint-deep: #00b885;  /* manufacturing.com's darker variant */

  /* Neutrals, lifted from the live themes */
  --nl-white:     #ffffff;
  --nl-grey-100:  #f4f4f4;
  --nl-grey-200:  #eff0f5;
  --nl-grey-300:  #d1d5db;

  /* The emblem's green-to-blue gradient lives INSIDE the SVG. It is artwork,
     not a UI palette — all four stops sit near 2.4:1 on white and cannot
     legibly carry text. Recorded here for reference; not used below.
       #6bb96a  #4bb8a0  #32b9c9  #19b2e2                                   */

  /* --- Roles. Components reference these, never the brand values directly. */
  --nl-ground:     var(--nl-white);
  --nl-ink:        var(--nl-navy);          /* 17.7:1 on white */
  --nl-ink-muted:  #525d6f;                 /* navy mixed 30% into white, 6.4:1 */
  --nl-rule:       var(--nl-grey-300);
  --nl-rule-active: var(--nl-mint);
  /* Focus needs 3:1 minimum. The mint is 1.92:1 on white, so it cannot be the
     focus indicator no matter how on-brand it is. Navy carries it instead. */
  --nl-focus:      var(--nl-navy);
  --nl-accent-bar: var(--nl-mint);

  /* --- Type.
     Mainlux sets the Latin wordmark and tagline. The UI stack carries
     everything else and is ordered so that Thai and Cyrillic resolve to a
     face that has those glyphs: the Latin entries are first, then Thai system
     faces for macOS/iOS, Windows and Android in turn. Cyrillic is already
     covered by every Latin entry in the list.                              */
  --nl-font-ui:
      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      "Helvetica Neue", Arial,
      "Sukhumvit Set", "Thonburi", "Leelawadee UI", "Noto Sans Thai",
      sans-serif;
  --nl-font-display: "Mainlux", var(--nl-font-ui);

  --nl-wordmark-size: clamp(2rem, 1.1rem + 4.2vw, 3.25rem);
  --nl-wordmark-tracking: 0.14em;
  --nl-tagline-size: clamp(0.875rem, 0.78rem + 0.42vw, 1.0625rem);
  --nl-tagline-tracking: 0.08em;

  /* --- Space */
  --nl-space-1: 0.35rem;
  --nl-space-2: 1rem;
  --nl-space-3: 1.75rem;
  --nl-space-4: 3rem;

  /* --- Shape */
  --nl-radius: 10px;
  --nl-emblem-size: clamp(104px, 6rem + 8vw, 172px);
  --nl-measure: 40rem;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--nl-space-4) var(--nl-space-3);
  background: var(--nl-ground);
  color: var(--nl-ink);
  font-family: var(--nl-font-ui);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Stage
   ========================================================================== */

.stage {
  width: 100%;
  max-width: var(--nl-measure);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.emblem {
  width: var(--nl-emblem-size);
  height: auto;
  display: block;
}

.wordmark {
  margin: var(--nl-space-3) 0 0;
  font-family: var(--nl-font-display);
  font-size: var(--nl-wordmark-size);
  font-weight: 300;
  letter-spacing: var(--nl-wordmark-tracking);
  /* Tracking adds trailing space after the last letter, which reads as an
     off-centre wordmark. Half of it back as padding re-centres the word. */
  padding-left: var(--nl-wordmark-tracking);
  line-height: 1.1;
}

.tagline {
  margin: var(--nl-space-1) 0 0;
  font-family: var(--nl-font-display);
  font-size: var(--nl-tagline-size);
  font-weight: 300;
  letter-spacing: var(--nl-tagline-tracking);
  padding-left: var(--nl-tagline-tracking);
  color: var(--nl-ink-muted);
}

/* The accent rule, in the mint both live sites use. Purely decorative — it
   carries no meaning, so its low contrast on white is not a defect. */
.tagline::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  margin: var(--nl-space-3) auto 0;
  border-radius: 2px;
  background: var(--nl-accent-bar);
}

/* ==========================================================================
   Routes
   ========================================================================== */

.routes {
  margin-top: var(--nl-space-4);
  width: 100%;
  display: grid;
  gap: var(--nl-space-2);
  grid-template-columns: 1fr;
}

@media (min-width: 34rem) {
  .routes { grid-template-columns: 1fr 1fr; }
}

.route {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--nl-space-1);
  padding: var(--nl-space-3) var(--nl-space-2);
  border: 1px solid var(--nl-rule);
  border-radius: var(--nl-radius);
  text-decoration: none;
  color: inherit;
  background: var(--nl-ground);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.route:hover,
.route:focus-visible {
  border-color: var(--nl-rule-active);
  box-shadow: 0 0 0 1px var(--nl-rule-active);
  transform: translateY(-2px);
}

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

.route__name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.route__host {
  font-size: 0.8125rem;
  color: var(--nl-ink-muted);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .route { transition: none; }
  .route:hover,
  .route:focus-visible { transform: none; }
}
