/* ============================================================
   The Lotus Eater — colors_and_type.css
   The single source of truth for color, type, spacing, motion.
   Import this once in any HTML file.
   ============================================================ */

/* ----- Webfonts (Google Fonts CDN — see README caveats) ----- */
@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;0,6..96,500;0,6..96,700;0,6..96,800;1,6..96,400;1,6..96,700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500;1,600&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ------------------------------------------------------------
     COLOR — Neutrals
     ------------------------------------------------------------
     Vellum is the default canvas. Bone is a one-step-warmer
     panel color. Ink is the only "black"; never use #000.
  */
  --vellum:        #F4EFE6;  /* primary background */
  --vellum-soft:   #EFE8DC;  /* alt background, slightly deeper */
  --bone:          #E9E1D2;  /* panel / surface 1 */
  --bone-deep:     #DDD2BF;  /* hover / surface 2 */
  --ink:           #1A1814;  /* default text & rules */
  --ink-soft:      #2B2722;  /* large display text on light bg */
  --pith:          #5A5249;  /* secondary text, captions */
  --pith-soft:     #847A6E;  /* tertiary text, meta */
  --ash:           #B6AC9E;  /* hairline rules, disabled */

  /* ------------------------------------------------------------
     COLOR — Accents
     ------------------------------------------------------------
     Used sparingly. Bruise is the link/CTA color. The rest are
     editorial accents — never as buttons.
  */
  --bruise:        #5B2940;  /* link, hover, primary CTA */
  --bruise-deep:   #3F1B2C;  /* bruise hover/press */
  --lotos:         #C8907E;  /* dusty rose; petal */
  --lotos-soft:    #E0BFB1;
  --verdigris:     #7E8A6E;  /* oxidized sage */
  --verdigris-deep:#5D6850;
  --saffron:       #C49447;  /* muted ochre */
  --saffron-soft:  #E3C28B;
  --tide:          #4A6B7C;  /* washed cobalt */

  /* ------------------------------------------------------------
     COLOR — Semantic
     ------------------------------------------------------------ */
  --bg:            var(--vellum);
  --bg-alt:        var(--bone);
  --fg:            var(--ink);
  --fg-2:          var(--pith);
  --fg-3:          var(--pith-soft);
  --rule:          var(--ink);
  --rule-soft:     var(--ash);
  --link:          var(--bruise);
  --link-hover:    var(--bruise-deep);
  --selection-bg:  var(--lotos);
  --selection-fg:  var(--vellum);

  /* ------------------------------------------------------------
     TYPE — Families
     ------------------------------------------------------------ */
  --font-display:  'Bodoni Moda', 'Bodoni 72', 'Didot', 'Times New Roman', serif;
  --font-body:     'EB Garamond', 'Garamond', 'Hoefler Text', 'Times New Roman', serif;
  --font-italic:   'Cormorant Garamond', 'Garamond', 'Hoefler Text', serif;
  --font-mono:     'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* ------------------------------------------------------------
     TYPE — Scale (editorial, not Material)
     ------------------------------------------------------------ */
  --t-mast:        clamp(56px, 9vw, 144px);   /* masthead */
  --t-display:     clamp(40px, 6vw, 96px);    /* page-opening display */
  --t-h1:          clamp(32px, 4vw, 56px);
  --t-h2:          clamp(24px, 3vw, 36px);
  --t-h3:          22px;
  --t-h4:          18px;
  --t-body:        18px;                       /* book-y, slightly large */
  --t-body-sm:     16px;
  --t-caption:     14px;
  --t-eyebrow:     12px;                       /* small-caps, letterspaced */
  --t-mono:        13px;

  /* ------------------------------------------------------------
     TYPE — Leading & spacing
     ------------------------------------------------------------ */
  --lh-tight:      1.05;
  --lh-display:    1.1;
  --lh-heading:    1.2;
  --lh-body:       1.55;
  --lh-loose:      1.7;

  --tracking-tight:   -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-eyebrow: 0.18em;

  /* ------------------------------------------------------------
     SPACING — 4px base, soft rhythm
     ------------------------------------------------------------ */
  --s-1:   4px;
  --s-2:   8px;
  --s-3:   12px;
  --s-4:   16px;
  --s-5:   24px;
  --s-6:   32px;
  --s-7:   48px;
  --s-8:   64px;
  --s-9:   96px;
  --s-10:  144px;

  /* ------------------------------------------------------------
     RADII (almost everything is 0)
     ------------------------------------------------------------ */
  --r-0:   0;
  --r-pill: 999px;     /* chips only */
  --r-circle: 50%;     /* monogram, avatar only */

  /* ------------------------------------------------------------
     RULES
     ------------------------------------------------------------ */
  --rule-hair:  0.5px solid var(--ink);
  --rule-1:     1px solid var(--ink);
  --rule-soft-1: 1px solid var(--ash);

  /* ------------------------------------------------------------
     SHADOWS (two, used rarely)
     ------------------------------------------------------------ */
  --shadow-paper: 0 1px 0 rgba(26,24,20,0.04), 0 16px 32px -16px rgba(26,24,20,0.18);
  --shadow-inset-line: inset 2px 0 0 var(--ink);

  /* ------------------------------------------------------------
     MOTION
     ------------------------------------------------------------ */
  --ease:          cubic-bezier(0.22, 0.61, 0.36, 1);
  --d-fast:        160ms;
  --d-base:        240ms;
  --d-slow:        400ms;
  --d-languid:     6s;     /* the one slow loop on the masthead */
}

/* ============================================================
   ELEMENT DEFAULTS
   ============================================================ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern", "liga", "onum", "pnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
h1 { font-size: var(--t-h1); line-height: var(--lh-display); }
h2 { font-size: var(--t-h2); line-height: var(--lh-heading); }
h3 { font-size: var(--t-h3); line-height: var(--lh-heading); font-weight: 500; }
h4 { font-size: var(--t-h4); line-height: var(--lh-heading); font-weight: 500; }

p { margin: 0 0 1em 0; }
p + p { text-indent: 1.25em; margin-top: -0.4em; }   /* book-style indent */

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

hr {
  border: 0;
  border-top: var(--rule-hair);
  margin: var(--s-7) 0;
}

code, kbd, pre {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
}

/* ============================================================
   SEMANTIC CLASSES (the public type API)
   ============================================================ */
.t-mast {
  font-family: var(--font-display);
  font-size: var(--t-mast);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}
.t-display {
  font-family: var(--font-display);
  font-size: var(--t-display);
  font-weight: 500;
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-tight);
}
.t-display--italic {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}
.t-eyebrow {
  font-family: var(--font-body);
  font-size: var(--t-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--pith);
}
.t-caption {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: var(--t-caption);
  color: var(--pith);
  line-height: var(--lh-body);
}
.t-meta {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--pith);
}
.t-quote {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.3;
  color: var(--ink-soft);
}
.t-lede {
  font-family: var(--font-body);
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ============================================================
   PRIMITIVE COMPONENTS
   ============================================================ */

/* Button — filled (Ink on Vellum) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--t-body-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 14px 28px;
  background: var(--ink);
  color: var(--vellum);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
}
.btn:hover { background: var(--bruise-deep); border-color: var(--bruise-deep); color: var(--vellum); }
.btn:active { transform: translateY(1px); }

/* Button — outline */
.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn--outline:hover { background: var(--ink); color: var(--vellum); }

/* Button — ghost (text-link with arrow) */
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: none;
  padding: 8px 0;
  border-bottom: 1px solid var(--ink);
}
.btn--ghost:hover { color: var(--bruise); border-bottom-color: var(--bruise); }

/* Tag / chip — only rounded thing besides avatars */
.chip {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--t-caption);
  font-style: italic;
  padding: 4px 12px;
  border: 1px solid var(--ash);
  border-radius: var(--r-pill);
  color: var(--pith);
  background: transparent;
}

/* Pull quote — inset line on left */
.pullquote {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.35;
  color: var(--ink-soft);
  padding: var(--s-3) var(--s-5);
  box-shadow: var(--shadow-inset-line);
  margin: var(--s-6) 0;
}

/* Input — bottom rule only */
.field {
  font-family: var(--font-body);
  font-size: var(--t-body);
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color var(--d-fast) var(--ease);
}
.field::placeholder { color: var(--pith-soft); font-style: italic; }
.field:focus { border-bottom-color: var(--bruise); }

/* Section break ornament */
.ornament {
  display: block;
  text-align: center;
  font-family: var(--font-italic);
  font-size: 24px;
  color: var(--pith);
  margin: var(--s-8) 0;
  letter-spacing: 1em;
  padding-left: 1em; /* compensate for letter-spacing trailing */
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s-6);
}
.container--narrow { max-width: 720px; }
.container--reading { max-width: 640px; }

/* Hairline divider */
.hr-hair { border: 0; border-top: var(--rule-hair); margin: 0; }
.hr-rule { border: 0; border-top: var(--rule-1); margin: 0; }

/* Image placeholder block — used in mocks */
.img-placeholder {
  background: var(--bone-deep);
  color: var(--pith);
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0, transparent 6px, rgba(26,24,20,0.04) 6px, rgba(26,24,20,0.04) 7px);
  pointer-events: none;
}
