/**
 * styles.css — Urbania Plan, design system
 * ──────────────────────────────────────────────────────────────────────────
 * Design direction: "working drawing" — this whole project's soul is a
 * to-scale, hand-measured floor plan (46 px = 1 m, real coordinates, door
 * clearances, compass bearings, sun angles). The site borrows that language
 * instead of dressing it up as a generic real-estate brochure: warm paper
 * background, a fine ruler/grid rhythm, small monospaced coordinate/code
 * labels the way the source document labels objects (P01, C3, PR2…), and a
 * terracotta/blueprint-blue accent pair lifted straight from that document's
 * own palette (terracotta = the doc's --acc; blueprint blue = its
 * "portes / réserve d'eau" category color) for visual continuity across the
 * whole property (this site + the linked terrace dossier).
 *
 * Token system
 *   Color:  --paper (warm cream ground) · --ink (heading/body text) ·
 *           --muted (secondary text) · --line (hairlines) ·
 *           --terracotta (primary accent — CTAs, active nav, emphasis) ·
 *           --blueprint (secondary accent — links, technical/plan bits) ·
 *           --sun (tertiary accent, used sparingly — highlights, tags)
 *   Type:   display = serif (headings, character, used with restraint) ·
 *           body = system sans (long-form reading) ·
 *           mono = system monospace (eyebrows, codes, coordinates, meta)
 *   Space:  4px base unit, scale exposed as --space-1..8
 *   Radius: --radius-sm/md/lg — soft but not pill-shaped; this is a technical
 *           document, not a consumer app
 *   Motion: transitions only on interactive states; reduced-motion respected
 *
 * Signature element: the "ruler" motif — a thin tick-marked rule under the
 * header (a nod to the plan's axis labels) and small corner coordinate tags
 * on cards (a nod to object codes/coordinates throughout the source
 * document). Used once, quietly, not repeated into a gimmick.
 *
 * No web fonts are loaded — everything above runs on system font stacks so
 * the site renders identically with or without network access, matching the
 * base document's own file://-first, no-build-step philosophy (only that
 * document's #rendu3d WebGL section depends on the network, and it degrades
 * gracefully when offline).
 * ──────────────────────────────────────────────────────────────────────────
 */

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  /* Color */
  --paper: #FBF6F0;
  --paper-raised: #FFFFFF;
  --ink: #2E2013;
  --muted: #7A6A5C;
  --muted-2: #9C8D7E;
  --line: #E4D9C8;
  --line-strong: #D6C7B2;
  --terracotta: #8A4530;
  --terracotta-dark: #6E3624;
  --terracotta-tint: #F3E3DB;
  --blueprint: #2E6E9E;
  --blueprint-dark: #23577E;
  --blueprint-tint: #E3EDF3;
  --sun: #D4A857;
  --sun-tint: #F7EDDB;
  --focus-ring: #2E6E9E;

  /* Type */
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "URW Palladio L", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  --text-xs: 0.6875rem;   /* 11px */
  --text-sm: 0.8125rem;   /* 13px */
  --text-base: 0.9375rem; /* 15px */
  --text-md: 1.0625rem;   /* 17px */
  --text-lg: 1.3125rem;   /* 21px */
  --text-xl: 1.75rem;     /* 28px */
  --text-2xl: 2.5rem;     /* 40px */
  --text-3xl: 3.25rem;    /* 52px */

  /* Space (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Layout */
  --content-width: 1160px;
  --header-h: 64px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 180ms;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #221A13;
    --paper-raised: #2B2119;
    --ink: #F3E9DC;
    --muted: #B9A794;
    --muted-2: #8E7C6A;
    --line: #3B2E22;
    --line-strong: #4A3A2A;
    --terracotta: #E08A62;
    --terracotta-dark: #F0A785;
    --terracotta-tint: #3A251C;
    --blueprint: #7CB2DC;
    --blueprint-dark: #A4CCEA;
    --blueprint-tint: #1E2E38;
    --sun: #E6C583;
    --sun-tint: #3A3120;
    --focus-ring: #7CB2DC;
    color-scheme: dark;
  }
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--text-base) / 1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blueprint); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; color: var(--ink); }
p { margin: 0 0 var(--space-4); color: var(--ink); }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Layout helpers ────────────────────────────────────────────────────── */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
@media (max-width: 640px) {
  .container { padding: 0 var(--space-4); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

/* ── Signature: the ruler rule ─────────────────────────────────────────── */
/* A thin tick-marked rule — echoes the source plan's axis-label ruler.
   Used once under the header; not repeated elsewhere. */
.ruler {
  height: 10px;
  width: 100%;
  background-image: repeating-linear-gradient(
    to right,
    var(--line-strong) 0,
    var(--line-strong) 1px,
    transparent 1px,
    transparent 24px
  );
  background-position: 0 0;
  background-repeat: repeat-x;
  background-size: 100% 6px;
  border-bottom: 1px solid var(--line);
  opacity: 0.9;
}

/* Faint graph-paper wash, used sparingly behind hero/section content — a
   quiet nod to the 46px/m grid in the source plan's SVG. Opt-in via class,
   not applied globally, so it stays a signature rather than wallpaper. */
.bg-grid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
}

/* ── Header / nav ──────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: var(--header-h);
  padding: var(--space-3) 0;
}
.site-brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--ink);
}
.site-brand__mark {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--terracotta);
  border: 1px solid var(--terracotta);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.02em;
}
.site-brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}
.site-brand__name small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.site-nav__link {
  position: relative;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--muted);
  padding: var(--space-2) 0;
  transition: color var(--dur) var(--ease);
}
.site-nav__link:hover { color: var(--ink); }
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -1px;
  height: 2px;
  background: var(--terracotta);
  transition: right var(--dur) var(--ease);
}
.site-nav__link:hover::after { right: 0; }

/* Active-link convention: each page adds `is-active` by hand to its own
   nav link (see PARTIALS.md). Do not rely on JS to compute this. */
.site-nav__link.is-active {
  color: var(--terracotta);
  font-weight: 700;
}
.site-nav__link.is-active::after { right: 0; }

.site-nav__link--external {
  color: var(--blueprint);
}
.site-nav__link--external:hover { color: var(--blueprint-dark); }
.site-nav__link--external::before {
  content: "↗";
  margin-right: 3px;
  font-size: 0.85em;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--terracotta);
  color: #FFF8F3;
}
.btn--primary:hover { background: var(--terracotta-dark); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--terracotta); color: var(--terracotta); }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}
.card {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -14px rgba(46, 32, 19, 0.28);
}
.card__tag {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted-2);
  letter-spacing: 0.03em;
}
.card__title {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
  padding-right: var(--space-6);
}
.card__body { color: var(--muted); font-size: var(--text-sm); }
.card__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: var(--space-2);
  vertical-align: middle;
}

/* ── Hero (available for index.html's real content pass) ─────────────────*/
.hero {
  padding: var(--space-8) 0 var(--space-7);
}
.hero__eyebrow { margin-bottom: var(--space-4); }
.hero__title {
  font-size: var(--text-3xl);
  max-width: 16ch;
  letter-spacing: -0.015em;
}
.hero__lead {
  margin-top: var(--space-4);
  max-width: 56ch;
  font-size: var(--text-md);
  color: var(--muted);
}
.hero__actions {
  margin-top: var(--space-6);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .hero__title { font-size: var(--text-2xl); }
}

/* ── Section rhythm ────────────────────────────────────────────────────── */
main { display: block; }
.section {
  padding: var(--space-7) 0;
  border-top: 1px solid var(--line);
}
.section:first-child { border-top: none; }
.section__heading { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-5); }
.section__num {
  font-family: var(--font-mono);
  color: var(--terracotta);
  font-size: var(--text-sm);
}
.section__title { font-size: var(--text-xl); }
.section__lead { color: var(--muted); max-width: 68ch; margin: var(--space-2) 0 var(--space-5); }

/* ── Notice / placeholder ──────────────────────────────────────────────── */
.notice {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: center;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-6) 0 var(--space-7);
  color: var(--muted);
  font-size: var(--text-sm);
}
.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.site-footer__brand {
  font-family: var(--font-mono);
  color: var(--muted-2);
  letter-spacing: 0.02em;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--terracotta); }

/* ── Responsive: mobile nav wrap ───────────────────────────────────────── */
@media (max-width: 760px) {
  .site-header__bar { flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) 0; }
  .site-nav { gap: var(--space-4); }
}
