/* =====================================================================
   HerbiTail · colors_and_type.css
   Tokens for the HerbiTail Design System
   ===================================================================== */

/* ---------- Webfonts ----------------------------------------------- */
/* Avenir Next LT Pro — licensed brand font, served from /fonts/.      */
/* Nunito Sans       — Google Fonts (exact match).                     */
/* PK Maehongson     — licensed Thai brand font, served from /fonts/.  */
/* LINE Seed Sans TH — licensed Thai body-support font, served from    */
/*                     /fonts/.                                        */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700&display=swap');

/* LINE Seed Sans TH — licensed Thai body-support font.
   Supplied weights: Thin, Regular, Bold, ExtraBold, Heavy. */
@font-face {
  font-family: 'LINE Seed Sans TH';
  src: url('fonts/LINESeedSansTH_Th.otf') format('opentype');
  font-weight: 100; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'LINE Seed Sans TH';
  src: url('fonts/LINESeedSansTH_Rg.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
/* Medium (500) is not supplied — per direction, map it to Bold. */
@font-face {
  font-family: 'LINE Seed Sans TH';
  src: url('fonts/LINESeedSansTH_Bd.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'LINE Seed Sans TH';
  src: url('fonts/LINESeedSansTH_Bd.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'LINE Seed Sans TH';
  src: url('fonts/LINESeedSansTH_XBd.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'LINE Seed Sans TH';
  src: url('fonts/LINESeedSansTH_He.otf') format('opentype');
  font-weight: 900; font-style: normal; font-display: swap;
}

@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-UltLt.otf') format('opentype');
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-UltLtIt.otf') format('opentype');
  font-weight: 200; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-It.otf') format('opentype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-Medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-MediumIt.otf') format('opentype');
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-Demi.otf') format('opentype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-DemiIt.otf') format('opentype');
  font-weight: 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-BoldIt.otf') format('opentype');
  font-weight: 700; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-Heavy.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro';
  src: url('fonts/AvenirNextLTPro-HeavyIt.otf') format('opentype');
  font-weight: 800; font-style: italic; font-display: swap;
}

/* Condensed family — exposed as a separate stack for tight wordmark / display use. */
@font-face {
  font-family: 'Avenir Next LT Pro Condensed';
  src: url('fonts/AvenirNextLTPro-Cn.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro Condensed';
  src: url('fonts/AvenirNextLTPro-MediumCn.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro Condensed';
  src: url('fonts/AvenirNextLTPro-DemiCn.otf') format('opentype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro Condensed';
  src: url('fonts/AvenirNextLTPro-BoldCn.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Avenir Next LT Pro Condensed';
  src: url('fonts/AvenirNextLTPro-HeavyCn.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}

/* PK Maehongson — licensed Thai brand font. Full family supplied. */
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-Light.otf') format('opentype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-LightItalic.otf') format('opentype');
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-Italic.otf') format('opentype');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-Medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-MediumItalic.otf') format('opentype');
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-SemiBold.otf') format('opentype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-SemiBoldItalic.otf') format('opentype');
  font-weight: 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-Bold.otf') format('opentype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PK Maehongson';
  src: url('fonts/PKMaehongson-BoldItalic.otf') format('opentype');
  font-weight: 700; font-style: italic; font-display: swap;
}

:root {
  /* ---------- Brand palette (from guideline) ------------------------ */
  --primary-green: #1D442D;
  --off-white:     #F3F4EC;
  --sage-green:    #63846E;
  --mist-green:    #D8E3D8;

  /* Working tints derived from the four core colors                    */
  --primary-green-90: #2A523B;
  --primary-green-80: #3A6149;
  --primary-green-10: #E2E8E0;
  --sage-green-60:   rgba(99, 132, 110, 0.6);
  --sage-green-30:   rgba(99, 132, 110, 0.3);
  --sage-green-15:   rgba(99, 132, 110, 0.15);

  /* Off-white deeper variant for cards on cards                        */
  --off-white-2: #ECEEE3;

  /* Inferred accent — warm clay used very sparingly only               */
  --accent-clay: #B85C2A;

  /* ---------- Semantic surface tokens ------------------------------- */
  --surface-canvas:  var(--off-white);
  --surface-raised:  #FFFFFF;
  --surface-soft:    var(--mist-green);
  --surface-deep:    var(--primary-green);

  --fg-1:            var(--primary-green);   /* primary type            */
  --fg-2:            var(--sage-green);      /* secondary type          */
  --fg-3:            #8A9C90;                /* muted captions          */
  --fg-on-deep:      var(--off-white);       /* text on primary-green   */

  --border-hairline: rgba(99, 132, 110, 0.25);
  --border-input:    var(--mist-green);
  --border-focus:    var(--primary-green);

  /* ---------- Radii ------------------------------------------------- */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-pill: 999px;

  /* ---------- Elevation -------------------------------------------- */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(29, 68, 45, 0.04);
  --shadow-2: 0 4px 16px rgba(29, 68, 45, 0.06);
  --shadow-3: 0 12px 32px rgba(29, 68, 45, 0.08);
  --shadow-4: 0 24px 64px rgba(29, 68, 45, 0.10);

  /* ---------- Spacing (8px base) ----------------------------------- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10:128px;

  /* ---------- Motion ----------------------------------------------- */
  --ease-out:      cubic-bezier(0.22, 0.61, 0.36, 1); /* @kind other */
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1); /* @kind other */
  --dur-micro:     120ms; /* @kind other */
  --dur-standard:  220ms; /* @kind other */
  --dur-expressive:480ms; /* @kind other */

  /* ---------- Type families ---------------------------------------- */
  --font-display:    'Avenir Next LT Pro', 'Avenir Next', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-condensed:  'Avenir Next LT Pro Condensed', 'Avenir Next LT Pro', system-ui, sans-serif;
  --font-body:       'Nunito Sans', 'Avenir Next LT Pro', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-thai:       'PK Maehongson', system-ui, sans-serif;
  /* LINE Seed Sans TH is the licensed Thai body-support font.
     Noto Sans Thai Looped is kept in the stack as the brand-approved
     fallback for environments where the licensed file isn't loaded. */
  --font-thai-body:  'LINE Seed Sans TH', 'Noto Sans Thai Looped', 'PK Maehongson', system-ui, sans-serif;

  /* ---------- Type scale (display fluid via clamp) ----------------- */
  --fs-eyebrow:  12px;
  --fs-caption:  13px;
  --fs-body-sm:  14px;
  --fs-body:     16px;
  --fs-body-lg:  18px;
  --fs-h6:       18px;
  --fs-h5:       22px;
  --fs-h4:       28px;
  --fs-h3:       36px;
  --fs-h2:       clamp(36px, 4.4vw, 56px); /* @kind font */
  --fs-h1:       clamp(44px, 6vw, 88px); /* @kind font */
  --fs-display:  clamp(56px, 9vw, 128px); /* @kind font */

  /* ---------- Line-heights ----------------------------------------- */
  --lh-tight:  1.05; /* @kind other */
  --lh-snug:   1.18; /* @kind other */
  --lh-normal: 1.45; /* @kind other */
  --lh-relaxed:1.65; /* @kind other */

  /* ---------- Letter-spacing --------------------------------------- */
  --ls-eyebrow:  0.14em; /* @kind other */
  --ls-tight:    -0.02em; /* @kind other */
  --ls-snug:     -0.01em; /* @kind other */
  --ls-normal:    0; /* @kind other */
}

/* ====================================================================
   Base reset & body
   ==================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-canvas);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ====================================================================
   Semantic typography classes
   ==================================================================== */
.display,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  color: var(--fg-1);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  margin: 0;
  text-wrap: pretty;
}
.display { font-size: var(--fs-display); font-weight: 800; }
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); letter-spacing: var(--ls-snug); }
.h3 { font-size: var(--fs-h3); letter-spacing: var(--ls-snug); line-height: var(--lh-snug); }
.h4 { font-size: var(--fs-h4); font-weight: 700; line-height: var(--lh-snug); }
.h5 { font-size: var(--fs-h5); font-weight: 600; line-height: var(--lh-snug); }
.h6 { font-size: var(--fs-h6); font-weight: 600; line-height: var(--lh-snug); }

.body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-relaxed); color: var(--fg-1); }
.body    { font-size: var(--fs-body);    line-height: var(--lh-relaxed); color: var(--fg-1); }
.body-sm { font-size: var(--fs-body-sm); line-height: var(--lh-normal);  color: var(--fg-2); }
.caption { font-size: var(--fs-caption); line-height: var(--lh-normal);  color: var(--fg-2); }

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-1);
}

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: var(--fs-body-sm); }

/* ====================================================================
   Buttons (canonical)
   ==================================================================== */
.btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-body);
  letter-spacing: 0;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  cursor: pointer;
  transition: background var(--dur-standard) var(--ease-out),
              color      var(--dur-standard) var(--ease-out),
              transform  var(--dur-micro)    var(--ease-out),
              box-shadow var(--dur-standard) var(--ease-out);
  text-decoration: none;
  user-select: none;
}
.btn:active   { transform: scale(0.985); }
.btn:focus-visible {
  outline: 2px solid var(--primary-green);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--primary-green);
  color: var(--off-white);
}
.btn-primary:hover { background: #143424; }

.btn-secondary {
  background: transparent;
  color: var(--primary-green);
  box-shadow: inset 0 0 0 1.5px var(--primary-green);
}
.btn-secondary:hover { background: var(--primary-green); color: var(--off-white); }

.btn-ghost {
  background: transparent;
  color: var(--primary-green);
}
.btn-ghost:hover { background: var(--sage-green-15); }

/* ====================================================================
   Form controls
   ==================================================================== */
.input {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--fg-1);
  background: var(--surface-raised);
  border: 1.5px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  width: 100%;
  transition: border-color var(--dur-standard) var(--ease-out);
}
.input::placeholder { color: var(--fg-3); }
.input:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* ====================================================================
   Card (canonical)
   ==================================================================== */
.card {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--space-6);
  transition: box-shadow var(--dur-standard) var(--ease-out),
              transform var(--dur-standard) var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.card.soft {
  background: var(--surface-soft);
  box-shadow: none;
}

/* ====================================================================
   Utility
   ==================================================================== */
.divider {
  height: 1px;
  background: var(--border-hairline);
  border: none;
  margin: var(--space-6) 0;
}

a.link {
  color: var(--primary-green);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
a.link:hover { color: #143424; }
