/* =========================================================
   Workshop Legal IA — Design System
   ========================================================= */

:root {
  color-scheme: light;

  /* Palette (spec) */
  --areia: #F5F0EA;
  --areia-escuro: #EDE6DC;
  --quase-preto: #2C2420;
  --marrom-suave: #4A3F38;
  --terracota: #C4785A;
  --terracota-claro: #E8D5C4;
  --terracota-medio: #7A6A5A;

  /* Type */
  --ff-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-serif: 'Newsreader', Georgia, serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Scale */
  --fs-label: 11px;
  --fs-body: 16px;
  --fs-lg: 20px;
  --fs-xl: 28px;
  --fs-2xl: 42px;
  --fs-3xl: 64px;
  --fs-4xl: 88px;

  /* Rhythm */
  --page-max: 1200px;
  --gutter: clamp(20px, 4vw, 56px);

  /* Lines */
  --rule: rgba(44, 36, 32, 0.12);
  --rule-strong: rgba(44, 36, 32, 0.25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--quase-preto);
  background: var(--areia);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

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

/* ---------------- Shared atoms ---------------- */

.shell {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.label {
  font-family: var(--ff-sans);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracota-medio);
}

.label--dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--terracota);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: 2px;
}

.muted { color: var(--terracota-medio); }

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
}

/* ---------------- Button / CTA ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  background: var(--quase-preto);
  color: var(--areia);
  font-family: var(--ff-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.btn:hover { background: #1d1814; }
.btn .arrow {
  width: 18px; height: 9px; position: relative; align-self: center;
  flex: none;
}
.btn .arrow::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: currentColor; transform: translateY(-50%);
}
.btn .arrow::after {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translate(0, -50%) rotate(45deg);
}

.btn--ghost {
  background: transparent;
  color: var(--quase-preto);
  border: 1px solid var(--rule-strong);
  padding: 17px 25px;
}
.btn--ghost:hover { background: var(--areia-escuro); border-color: var(--quase-preto); }

.btn--terracota {
  background: var(--terracota);
  color: #fff;
}
.btn--terracota:hover { background: #b06a4e; }

/* ---------------- Global header ---------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--areia) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.top__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 22px; padding-bottom: 22px;
}
.wordmark {
  font-family: var(--ff-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--quase-preto);
}
.wordmark span { color: var(--terracota-medio); font-weight: 400; }

.nav {
  display: flex; gap: 34px;
  font-size: 14px;
  color: var(--marrom-suave);
}
.nav a { transition: color .15s; }
.nav a:hover { color: var(--quase-preto); }

.nav a.is-active { color: var(--quase-preto); }

@media (max-width: 720px) {
  .top__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .wordmark {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .wordmark span { display: none; }
  .nav {
    gap: 20px;
    font-size: 13px;
    width: 100%;
    flex-wrap: wrap;
  }
  section { padding: 64px 0; }
  section.tight { padding: 48px 0; }
  .eyebrow { margin-bottom: 24px; }
  .foot { margin-top: 64px; padding: 48px 0 28px; }
  .foot .shell { grid-template-columns: 1fr; gap: 32px; }
  .foot__brand { grid-column: span 1; }
  .foot__base { flex-direction: column; gap: 8px; align-items: flex-start; }
  .tweaks { right: 12px; bottom: 12px; width: calc(100vw - 24px); max-width: 320px; }
}

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

.foot {
  margin-top: 120px;
  padding: 80px 0 40px;
  background: var(--quase-preto);
  color: var(--areia);
}
.foot .shell { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 40px; }
.foot__brand { grid-column: span 2; }
.foot h4 {
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(245, 240, 234, 0.5);
  margin-bottom: 18px;
}
.foot ul { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.foot a:hover { color: var(--terracota); }
.foot__base {
  border-top: 1px solid rgba(245, 240, 234, 0.12);
  margin-top: 64px;
  padding-top: 28px;
  display: flex; justify-content: space-between;
  font-size: 13px; color: rgba(245, 240, 234, 0.5);
}
.foot__wm {
  font-size: 22px; font-weight: 500; letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.foot__wm span { color: var(--terracota-claro); font-weight: 400; }
.foot__blurb { font-size: 14px; color: rgba(245, 240, 234, 0.6); max-width: 32ch; line-height: 1.6; }

/* ---------------- Section scaffolding ---------------- */

section { padding: 120px 0; }
section.tight { padding: 80px 0; }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracota-medio);
  font-weight: 500;
  margin-bottom: 40px;
}
.eyebrow::before {
  content: ""; width: 32px; height: 1px; background: var(--terracota);
}

/* ---------------- Placeholder (striped SVG) ---------------- */
.portrait-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  border: 1px solid var(--rule);
}
.ph {
  position: relative;
  background-color: var(--areia-escuro);
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 9px,
    rgba(44, 36, 32, 0.06) 9px,
    rgba(44, 36, 32, 0.06) 10px
  );
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--terracota-medio);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ph--dark {
  background-color: #1d1814;
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 9px,
    rgba(245, 240, 234, 0.05) 9px,
    rgba(245, 240, 234, 0.05) 10px
  );
  border-color: rgba(245, 240, 234, 0.1);
  color: rgba(245, 240, 234, 0.45);
}

/* Switcher (Tweaks — injected) */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--quase-preto);
  color: var(--areia);
  padding: 18px;
  font-family: var(--ff-sans);
  font-size: 13px;
  z-index: 200;
  width: 260px;
  display: none;
  box-shadow: 0 20px 40px rgba(44,36,32,0.25);
}
.tweaks.open { display: block; }
.tweaks h5 {
  font-size: var(--fs-label); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(245,240,234,0.5);
  margin-bottom: 14px;
}
.tweaks label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(245,240,234,0.55);
  margin: 14px 0 8px;
}
.tweaks .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.tweaks .opts button {
  flex: 1; min-width: 0;
  padding: 8px 10px;
  background: transparent;
  color: var(--areia);
  border: 1px solid rgba(245,240,234,0.18);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.tweaks .opts button:hover { border-color: rgba(245,240,234,0.4); }
.tweaks .opts button.active {
  background: var(--terracota);
  border-color: var(--terracota);
}
.tweaks .swatches { display: flex; gap: 8px; }
.tweaks .swatches button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(245,240,234,0.2);
  cursor: pointer; padding: 0;
}
.tweaks .swatches button.active { border-color: var(--areia); }
