/* ============================================================
   IntelliBotique · Boutique design system
   Palette pulled directly from the Wolf & Robot artwork:
   cream paper, deep navy ink, signature ember orange, mineral teal.
   Fonts: Lora (display, italic), Source Sans Pro (text), Source Code Pro (technical).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Source+Code+Pro:wght@400;600&family=Source+Sans+Pro:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ---- Design Tokens ---------------------------------------- */
:root {
  /* Paper system */
  --paper:        #f4ecd8;   /* warm cream, slightly toasted */
  --paper-deep:   #eadfc4;   /* deeper cream surface */
  --paper-edge:   #d8cba8;   /* deckle / rule line */

  /* Ink */
  --ink:          #15213e;   /* deep navy primary */
  --ink-2:        #4a4a5e;   /* muted plum-grey secondary */
  --ink-soft:     #7d7a87;   /* tertiary / captions */

  /* Ember (signature accent, pulled from the logo's orange disc) */
  --ember:        #e5612c;
  --ember-deep:   #b04318;
  --ember-soft:   #f7d8c2;

  /* Mineral (the Wolf's cyan circuitry) */
  --mineral:      #4fa8a6;
  --mineral-deep: #1f6664;
  --mineral-soft: #cfe2e1;

  /* Type */
  --font-serif:   'Lora', ui-serif, Georgia, 'Times New Roman', serif;
  --font-sans:    'Source Sans Pro', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'Source Code Pro', ui-monospace, 'JetBrains Mono', monospace;

  /* Scale */
  --max-prose:    640px;
  --max-wide:     1080px;
  --max-full:     1280px;

  /* Spacing rhythm */
  --space-xs:     0.25rem;
  --space-sm:     0.5rem;
  --space-md:     1rem;
  --space-lg:     2rem;
  --space-xl:     4rem;
  --space-2xl:    7rem;

  --radius-sm:    3px;
  --radius-md:    6px;
  --radius-lg:    10px;

  --transition:   180ms ease;
  --transition-slow: 400ms cubic-bezier(.2,.7,.2,1);

  --rule:         1px solid var(--paper-edge);
  --rule-ink:     1px solid rgba(21,33,62,.12);
}

/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Subtle paper grain to keep the page from feeling sterile/SaaS */
  background-image:
    radial-gradient(circle at 18% 22%, rgba(229,97,44,.04) 0, transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(79,168,166,.04) 0, transparent 38%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.13 0 0 0 0 0.24 0 0 0 .025 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--ember); color: var(--paper); }

/* ---- Typography -------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.12;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

h1 em { font-style: italic; font-weight: 400; color: var(--ember-deep); }

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  letter-spacing: -0.02em;
}

h2 em { font-style: italic; color: var(--ember-deep); font-weight: 400; }

h3 { font-size: clamp(1.2rem, 2.4vw, 1.45rem); }
h4 { font-size: 1.05rem; font-weight: 500; }

p { max-width: var(--max-prose); }

/* Editorial small-caps label */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember-deep);
}

.label::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--ember);
}

.label--mineral { color: var(--mineral-deep); }
.label--mineral::before { background: var(--mineral); }

.label--ink { color: var(--ink); }
.label--ink::before { background: var(--ink); }

/* Drop cap for lede paragraphs */
.lede::first-letter {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 4.6em;
  font-weight: 500;
  float: left;
  line-height: .85;
  margin: 0.05em 0.12em 0 -0.05em;
  color: var(--ember-deep);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink);
  line-height: 1.65;
}

/* No. plate, used for editorial numbering */
.no {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ember-deep);
  letter-spacing: 0.04em;
}

.no::before {
  content: 'N\00ba ';
  font-style: italic;
}

/* Article rule */
.rule {
  border: none;
  border-top: var(--rule);
  margin-block: var(--space-xl);
}

.rule--center {
  text-align: center;
  position: relative;
  border: none;
  margin-block: var(--space-xl);
  height: 1px;
  background: var(--paper-edge);
}

.rule--center::after {
  content: '✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper);
  padding: 0 1rem;
  color: var(--ember);
  font-size: 0.85rem;
}

/* ---- Layout helpers --------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-wide);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.container--wide  { max-width: var(--max-full); }
.container--prose { max-width: var(--max-prose); }

section { padding-block: var(--space-xl); }

.section--surface {
  background: var(--paper-deep);
  position: relative;
}

.section--surface::before,
.section--surface::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--paper-edge);
}
.section--surface::before { top: 0; }
.section--surface::after { bottom: 0; }

.section--ink {
  background: var(--ink);
  color: var(--paper);
}

.section--ink h1,
.section--ink h2,
.section--ink h3 { color: var(--paper); }

.section--ink h1 em,
.section--ink h2 em { color: var(--ember-soft); }

.section--ink .label { color: var(--ember-soft); }
.section--ink .label::before { background: var(--ember); }

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.78rem 1.55rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  position: relative;
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 4px 14px -8px rgba(21,33,62,.4);
}
.btn--primary:hover {
  background: var(--ember-deep);
  color: var(--paper);
  transform: translateY(-1px);
}

.btn--ember {
  background: var(--ember);
  color: var(--paper);
  box-shadow: 0 4px 14px -8px rgba(229,97,44,.6);
}
.btn--ember:hover {
  background: var(--ember-deep);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  padding-inline: 0;
  font-weight: 600;
}
.btn--ghost::after {
  content: '→';
  transition: transform var(--transition);
}
.btn--ghost:hover { color: var(--ember-deep); }
.btn--ghost:hover::after { transform: translateX(4px); }

.btn--outline-light {
  background: transparent;
  color: var(--paper);
  border: 1.5px solid rgba(255,242,221,.55);
}
.btn--outline-light:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ---- Navigation ------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244,236,216,.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.site-nav.is-scrolled {
  border-bottom-color: var(--paper-edge);
  box-shadow: 0 6px 18px -16px rgba(21,33,62,.25);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--max-full);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}

.nav-logo .logo-mark {
  width: 32px;
  height: 32px;
  background: var(--ember);
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.nav-logo .logo-mark img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  object-position: center 65%;
  transform: scale(1.5);
}

.nav-logo .logo-text { display: flex; flex-direction: column; line-height: 1; }
.nav-logo .logo-text em {
  font-style: italic;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 3px;
  font-family: var(--font-sans);
}

.nav-logo .logo-name { color: var(--ink); }
.nav-logo .logo-name span { color: var(--ember); font-style: italic; font-weight: 500; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--ink-2);
  position: relative;
  transition: color var(--transition);
  padding-block: 0.4rem;
}

.nav-links a:hover { color: var(--ink); }

.nav-links a.is-current {
  color: var(--ink);
  font-weight: 600;
}
.nav-links a.is-current::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--ember);
}

.nav-cta { margin-left: var(--space-md); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--ink);
}

.nav-toggle svg { display: block; }

.mobile-nav {
  display: none;
  background: var(--paper);
  border-top: var(--rule);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.mobile-nav a {
  display: block;
  padding: 0.7rem 0;
  font-size: 1.05rem;
  color: var(--ink-2);
  border-bottom: var(--rule);
}

.mobile-nav a:last-child { border-bottom: none; }

.mobile-nav .btn {
  display: flex;
  justify-content: center;
  margin-top: var(--space-md);
}

@media (max-width: 880px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .mobile-nav.is-open { display: block; }
}

/* ---- Footer ----------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: rgba(244,236,216,.55);
  padding-block: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, var(--ember) 0%, var(--ember) 60%, var(--mineral) 60%, var(--mineral) 100%);
}

.footer-inner {
  max-width: var(--max-full);
  margin-inline: auto;
  padding-inline: var(--space-lg);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.footer-brand .nav-logo { color: rgba(244,236,216,.95); }
.footer-brand .nav-logo .logo-name { color: rgba(244,236,216,.95); }
.footer-brand .nav-logo .logo-text em { color: rgba(244,236,216,.55); }

.footer-brand p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 320px;
  color: rgba(244,236,216,.82);
  margin-top: var(--space-md);
}

.footer-colophon {
  margin-top: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(244,236,216,.6);
}

.footer-links h4 {
  color: rgba(244,236,216,.95);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
  font-size: 0.92rem;
  color: rgba(244,236,216,.72);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--ember-soft); }

.footer-ecosystem a { color: var(--mineral-soft); }
.footer-ecosystem a:hover { color: var(--paper); }

.footer-bottom {
  max-width: var(--max-full);
  margin-inline: auto;
  padding-inline: var(--space-lg);
  padding-top: var(--space-lg);
  margin-top: var(--space-xl);
  border-top: 1px solid rgba(244,236,216,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(244,236,216,.62);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: var(--space-lg); }
  .footer-bottom { flex-direction: column; gap: var(--space-sm); text-align: center; }
}

/* ---- Cards ------------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: 0 12px 32px -22px rgba(21,33,62,.35);
  transform: translateY(-2px);
  border-color: var(--ink);
}

.card--surface {
  background: var(--paper-deep);
  border-color: transparent;
}

/* ---- Grid helpers ----------------------------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Page hero -------------------------------------------- */
.page-hero {
  padding-block: var(--space-xl) var(--space-lg);
  border-bottom: var(--rule);
}

.page-hero .label { margin-bottom: var(--space-md); }
.page-hero h1 { margin-bottom: var(--space-md); }

.page-hero p {
  font-size: 1.15rem;
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 560px;
}

/* ---- Tag / category pill ---------------------------------- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.6rem;
  border-radius: 100px;
  background: var(--ink);
  color: var(--paper);
}

.tag--ember   { background: var(--ember-soft);   color: var(--ember-deep); }
.tag--mineral { background: var(--mineral-soft); color: var(--mineral-deep); }
.tag--ink     { background: var(--ink);          color: var(--paper); }
.tag--paper   { background: var(--paper);        color: var(--ink); border: 1px solid var(--paper-edge); }

/* ---- Form ------------------------------------------------- */
.form-group { margin-bottom: var(--space-md); }

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.78rem 0.95rem;
  border: 1.5px solid var(--paper-edge);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(229,97,44,.12);
}

.form-group textarea { min-height: 140px; resize: vertical; }

/* ---- Utility ---------------------------------------------- */
.text-center { text-align: center; }
.text-muted  { color: var(--ink-2); }
.text-ember  { color: var(--ember-deep); }
.text-mineral { color: var(--mineral-deep); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.italic { font-style: italic; }
.serif  { font-family: var(--font-serif); }
.mono   { font-family: var(--font-mono); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ---- Glyph (custom inline icon container) ----------------- */
.glyph {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  flex-shrink: 0;
}

.glyph svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.glyph--ember { color: var(--ember-deep); border-color: var(--ember); background: var(--ember-soft); }
.glyph--mineral { color: var(--mineral-deep); border-color: var(--mineral); background: var(--mineral-soft); }
