/* guia.troposfera.xyz — global stylesheet
   Fonts i colors heretats del theme.json de troposfera.xyz
   
   FONTS: puja els woff2 a /fonts/ amb aquesta estructura:
   /fonts/geomanist-extralight.woff2
   /fonts/geomanist-light.woff2
   /fonts/geomanist-regular.woff2
   /fonts/geomanist-book.woff2
   /fonts/geomanist-book-italic.woff2
   /fonts/geomanist-medium.woff2
   /fonts/geomanist-bold.woff2
   /fonts/geomanist-italic.woff2
   /fonts/chaney-regular.woff2
   /fonts/chaney-wide.woff2
   /fonts/JetBrainsMono-Variable.woff2
   /fonts/JetBrainsMono-Italic-Variable.woff2
*/

/* --------------------------------
   @font-face
   -------------------------------- */

@font-face {
  font-family: 'geomanist';
  font-weight: 100;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/geomanist-extralight-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'geomanist';
  font-weight: 200;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/geomanist-light-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'geomanist';
  font-weight: 200;
  font-style: italic;
  font-display: swap;
  src: url('/fonts/geomanist-italic-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'geomanist';
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/geomanist-light-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'geomanist';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/geomanist-regular-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'geomanist';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/geomanist-book-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'geomanist';
  font-weight: 500;
  font-style: italic;
  font-display: swap;
  src: url('/fonts/geomanist-book-italic-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'geomanist';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/geomanist-medium-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'geomanist';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/geomanist-bold-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'chaney';
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/chaney-regular-webfont.woff2') format('woff2');
}

@font-face {
  font-family: 'chaney';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/chaney-wide.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-Variable.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-Italic-Variable.woff2') format('woff2');
}

/* --------------------------------
   :root — troposfera.xyz tokens
   -------------------------------- */

:root {
  /* Colors */
  --bg: #efe8e8;
  --fg: #181819;
  --accent: hsl(17, 100%, 61%);
  --accent-2: hsl(45, 100%, 61%);
  --light: #FEFCFA;
  --muted: #867979;
  --dark: #080809;
  --accent-soft: hsl(17, 100%, 75%);
  --accent-2-soft: hsl(45, 100%, 75%);
  --rule: color-mix(in srgb, var(--fg) 12%, transparent);
  --tag-bg: color-mix(in srgb, var(--fg) 6%, transparent);
  --prohibit: hsl(17, 100%, 61%);
  --permit: hsl(150, 40%, 40%);

  /* Typography stacks */
  --sans: "geomanist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --display: "chaney", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", monospace;

  /* Font sizes — from theme.json */
  --fs-small: 0.875rem;
  --fs-regular: clamp(0.875rem, 0.833rem + 0.208vw, 1rem);
  --fs-medium: clamp(1rem, 0.958rem + 0.208vw, 1.125rem);
  --fs-large: clamp(1.125rem, 1.042rem + 0.417vw, 1.375rem);
  --fs-xl: clamp(1.75rem, 1.667rem + 0.417vw, 2rem);
  --fs-xxl: clamp(2.15rem, 1.867rem + 1.417vw, 3rem);
  --fs-xxxl: clamp(3.15rem, 2.867rem + 1.417vw, 4rem);
}

/* --------------------------------
   Reset & base
   -------------------------------- */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: var(--fs-large);
  line-height: 1.4;
  color: var(--fg);
  background: var(--bg);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------
   Layout
   -------------------------------- */

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 80px 24px 120px;
}

.container.centered {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: center;
  padding: 48px 24px;
  max-width: 480px;
}

/* --------------------------------
   Header
   -------------------------------- */

header {
  margin-bottom: 80px;
}

.domain {
  font-family: var(--mono);
  font-size: var(--fs-small);
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 24px;
}

.domain a {
  color: inherit;
  text-decoration: none;
}

header h1 {
  font-family: var(--sans);
  font-size: var(--fs-xxl);
  font-weight: 300;
  line-height: 1.125;
  letter-spacing: 0;
  margin-bottom: 20px;
}

header .subtitle {
  font-size: var(--fs-regular);
  font-weight: 300;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.5;
}

/* --------------------------------
   Typography
   -------------------------------- */

h2 {
  font-family: var(--sans);
  font-size: var(--fs-xl);
  font-weight: 300;
  line-height: 1.125;
  margin-bottom: 16px;
  letter-spacing: 0;
}

h3.sub {
  font-family: var(--mono);
  font-size: var(--fs-small);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
  margin-top: 32px;
}

h3.sub.red { color: var(--prohibit); }
h3.sub.neutral { color: var(--muted); }
h3.sub.green { color: var(--permit); }

p {
  margin-bottom: 12px;
  max-width: 600px;
}

p.muted {
  font-weight: 300;
  color: var(--muted);
}

.intro {
  font-size: var(--fs-regular);
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 48px;
  max-width: 360px;
  line-height: 1.5;
}

/* --------------------------------
   Sections
   -------------------------------- */

section {
  margin-bottom: 64px;
}

.section-label {
  font-family: var(--mono);
  font-size: var(--fs-small);
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.divider {
  height: 1px;
  background: var(--rule);
  margin: 64px 0;
}

/* --------------------------------
   TOC
   -------------------------------- */

.toc {
  margin-top: 32px;
  padding: 24px;
  background: var(--light);
}

.toc a {
  display: block;
  color: var(--fg);
  text-decoration: none;
  font-size: var(--fs-regular);
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  transition: color 0.15s;
}

.toc a:last-child { border-bottom: none; }
.toc a:hover { color: var(--accent); }

.toc .toc-num {
  color: var(--muted);
  margin-right: 12px;
  display: inline-block;
  width: 24px;
}

/* --------------------------------
   Principle grid
   -------------------------------- */

.principle-grid {
  display: grid;
  gap: 2px;
  margin-top: 24px;
}

.principle {
  background: var(--light);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: start;
}

.principle-num {
  font-size: var(--fs-xl);
  font-weight: 200;
  color: var(--muted);
  padding-top: 1px;
}

.principle-text {
  font-size: var(--fs-regular);
  line-height: 1.5;
}

.principle-text strong {
  font-weight: 500;
}

/* --------------------------------
   Rule items (prohibicions)
   -------------------------------- */

.rule-block {
  margin-top: 24px;
}

.rule-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.rule-item:last-child {
  border-bottom: none;
}

.rule-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  margin-top: 3px;
  flex-shrink: 0;
}

.rule-icon.no {
  background: var(--prohibit);
  color: var(--light);
}

.rule-icon.yes {
  background: var(--permit);
  color: var(--light);
}

.rule-content {
  font-size: var(--fs-regular);
  line-height: 1.5;
}

.rule-content code {
  font-family: var(--mono);
  font-size: calc(var(--fs-small) - 0.05rem);
  background: var(--tag-bg);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--prohibit);
}

.rule-content code.ok {
  color: var(--permit);
}

/* --------------------------------
   Example pairs (evitar / fer)
   -------------------------------- */

.example-pair {
  background: var(--light);
  margin-top: 16px;
  overflow: hidden;
}

.example-pair + .example-pair {
  margin-top: 2px;
}

.example-pair .ex-row {
  padding: 16px 20px;
  font-size: var(--fs-regular);
  line-height: 1.5;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
}

.example-pair .ex-row + .ex-row {
  border-top: 1px solid var(--rule);
}

.ex-label {
  font-family: var(--mono);
  font-size: calc(var(--fs-small) - 0.1rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-top: 3px;
}

.ex-label.bad { color: var(--prohibit); }
.ex-label.good { color: var(--permit); }

.ex-text {
  font-family: var(--sans);
  font-size: var(--fs-medium);
  font-style: italic;
  font-weight: 300;
  line-height: 1.5;
}

/* --------------------------------
   Vocab grid
   -------------------------------- */

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px;
  margin-top: 24px;
}

.vocab-item {
  background: var(--light);
  padding: 16px 20px;
}

.vocab-item .word {
  font-weight: 500;
  font-size: var(--fs-regular);
  margin-bottom: 4px;
}

.vocab-item .note {
  font-size: var(--fs-small);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.5;
}

/* --------------------------------
   Format notes
   -------------------------------- */

.format-note {
  background: var(--light);
  padding: 20px 24px;
  margin-top: 2px;
  font-size: var(--fs-regular);
  line-height: 1.5;
  border-left: 3px solid var(--accent);
}

.format-note:first-of-type {
  margin-top: 16px;
}

.format-note strong {
  font-weight: 500;
}

/* --------------------------------
   LIX box
   -------------------------------- */

.lix-box {
  background: var(--light);
  padding: 24px;
  margin-top: 24px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: start;
}

.lix-number {
  font-family: var(--sans);
  font-size: var(--fs-xxxl);
  font-weight: 200;
  line-height: 1;
  color: var(--fg);
  text-align: center;
}

.lix-number span {
  display: block;
  font-family: var(--mono);
  font-size: calc(var(--fs-small) - 0.1rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.lix-detail {
  font-size: var(--fs-regular);
  line-height: 1.5;
}

.lix-detail p {
  margin-bottom: 8px;
}

/* --------------------------------
   Corpus block
   -------------------------------- */

.corpus-block {
  margin-top: 24px;
}

.corpus-item {
  background: var(--light);
  padding: 16px 20px;
  margin-top: 2px;
  font-size: var(--fs-regular);
  line-height: 1.5;
}

.corpus-item:first-child {
  margin-top: 0;
}

.corpus-item strong {
  font-weight: 500;
}

/* --------------------------------
   Index — guide links
   -------------------------------- */

.guides {
  display: grid;
  gap: 2px;
}

.guide-link {
  background: var(--light);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--fg);
  display: grid;
  grid-template-columns: 1fr 20px;
  align-items: start;
  gap: 16px;
  transition: background 0.15s;
}

.guide-link:hover {
  background: color-mix(in srgb, var(--light) 60%, var(--bg));
}

.guide-link:hover .arrow {
  transform: translateX(4px);
  color: var(--accent);
}

.guide-name {
  font-family: var(--sans);
  font-size: var(--fs-xl);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 6px;
}

.guide-desc {
  font-size: var(--fs-small);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.5;
}

.arrow {
  font-size: var(--fs-xl);
  font-weight: 200;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
  padding-top: 2px;
}

/* --------------------------------
   Footer
   -------------------------------- */

.footer-mark {
  font-family: var(--mono);
  font-size: calc(var(--fs-small) - 0.1rem);
  font-weight: 300;
  color: var(--muted);
  margin-top: 80px;
  letter-spacing: 0.02em;
}

.container.centered .footer-mark {
  margin-top: 64px;
}

/* --------------------------------
   Responsive
   -------------------------------- */

@media (max-width: 600px) {
  .container { padding: 48px 16px 80px; }
  header { margin-bottom: 56px; }
  section { margin-bottom: 48px; }
  .principle { grid-template-columns: 1fr; gap: 4px; }
  .principle-num { font-size: var(--fs-large); }
  .vocab-grid { grid-template-columns: 1fr; }
  .lix-box { grid-template-columns: 1fr; }
}
