/* ============================================================
   Maître Philippe CAMPS — Avocat au Barreau de Nice
   Main CSS — tokens, base, typography, utilities
   ============================================================ */

/* ============ TOKENS ============ */
:root {
  /* Colors — Nice patrimonial palette */
  --ink: #13131A;
  --ink-2: #3D3D47;
  --ink-3: #6E6E78;
  --paper: #F7F4ED;
  --paper-2: #EFEAE0;
  --bone: #FBFAF6;
  --carbon: #0F0F14;
  --carbon-2: #1A1A22;
  --rule: #D9D2C2;
  --rule-dark: #2A2A33;

  --accent: #A8743A;
  --accent-soft: #C8965C;
  --accent-deep: #7A4F22;
  --green: #2D4A3E;
  --red: #8B2E2E;

  /* Typography */
  --font-display: "Fraunces", "Source Serif 4", Georgia, serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-display: clamp(2.75rem, 7vw, 5.75rem);
  --fs-h1: clamp(2.25rem, 5vw, 4rem);
  --fs-h2: clamp(1.75rem, 3.5vw, 2.75rem);
  --fs-h3: clamp(1.375rem, 2.2vw, 1.75rem);
  --fs-h4: 1.25rem;
  --fs-eyebrow: 0.8125rem;
  --fs-body: 1.125rem;
  --fs-body-ui: 1rem;
  --fs-small: 0.9375rem;
  --fs-caption: 0.875rem;
  --fs-legal: 0.8125rem;

  --lh-display: 0.95;
  --lh-tight: 1.05;
  --lh-snug: 1.15;
  --lh-base: 1.5;
  --lh-relaxed: 1.65;

  --ls-tight: -0.02em;
  --ls-snug: -0.01em;
  --ls-normal: 0;
  --ls-eyebrow: 0.14em;

  /* Spacing */
  --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: 128px;
  --s-11: 192px;

  /* Containers */
  --container-prose: 680px;
  --container-narrow: 920px;
  --container-wide: 1280px;
  --pad-x: 1.5rem;

  /* Radius */
  --r-0: 0;
  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
  --r-full: 999px;

  /* Shadows */
  --shadow-0: none;
  --shadow-1: 0 1px 0 0 rgba(19, 19, 26, 0.06), 0 1px 3px rgba(19, 19, 26, 0.04);
  --shadow-2: 0 4px 6px -2px rgba(19, 19, 26, 0.06), 0 12px 24px -8px rgba(19, 19, 26, 0.08);
  --shadow-3: 0 20px 40px -12px rgba(19, 19, 26, 0.12);
  --shadow-inset: inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
  --shadow-ring: 0 0 0 2px var(--accent), 0 0 0 4px var(--paper);

  /* Transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index */
  --z-header: 100;
  --z-dropdown: 200;
  --z-drawer: 300;
  --z-modal: 400;
  --z-toast: 500;
}

@media (min-width: 768px) {
  :root {
    --pad-x: 2.5rem;
  }
}

@media (min-width: 1280px) {
  :root {
    --pad-x: 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ RESET / BASE ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  font-feature-settings: "kern", "liga", "calt";
  overflow-x: hidden;
}

img,
video,
picture,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-5);
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-3) var(--s-5);
  z-index: var(--z-toast);
  transition: top var(--t-base);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  border-radius: var(--r-md);
}
.skip-link:focus {
  top: var(--s-5);
}

/* ============ TYPOGRAPHY UTILITIES ============ */
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--ink-2);
  display: inline-block;
}

.eyebrow--accent {
  color: var(--accent);
}
.eyebrow--on-dark {
  color: var(--accent-soft);
}

.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-tight);
  font-variation-settings: "opsz" 144;
  margin: 0;
}

.h1 {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-snug);
  font-variation-settings: "opsz" 96;
  margin: 0;
}

.h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  margin: 0;
}

.h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: var(--lh-snug);
  margin: 0;
}

.h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-h4);
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.body {
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  font-variation-settings: "opsz" 24;
}

.body-ui {
  font-family: var(--font-sans);
  font-size: var(--fs-body-ui);
  line-height: var(--lh-base);
}

.caption {
  font-family: var(--font-sans);
  font-size: var(--fs-caption);
  line-height: 1.45;
  color: var(--ink-3);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
}

.legal {
  font-family: var(--font-sans);
  font-size: var(--fs-legal);
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}

/* Drop cap */
.prose > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 4em;
  line-height: 0.85;
  float: left;
  margin: 0.1em 0.08em 0 -0.04em;
  color: var(--accent-deep);
  font-variation-settings: "opsz" 144;
}

.prose em,
.prose i {
  font-style: italic;
  color: var(--ink-2);
}

.prose p {
  margin: 0 0 1.25em;
}

.prose h2,
.prose h3 {
  margin: 2em 0 0.75em;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  margin: 1em 0;
}

.prose li {
  margin-bottom: 0.5em;
  font-family: var(--font-serif);
}

/* ============ FILETS / RULES ============ */
.rule {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
  margin: var(--s-4) 0;
  border: 0;
}

.rule--md {
  width: 80px;
}
.rule--full {
  width: 100%;
}
.rule--top-bottom {
  margin: var(--s-6) 0;
}
.rule--on-dark {
  background: var(--accent-soft);
  opacity: 0.7;
}
.rule--center {
  margin-left: auto;
  margin-right: auto;
}

/* ============ CONTAINERS ============ */
.container {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

.container--prose {
  max-width: var(--container-prose);
}
.container--narrow {
  max-width: var(--container-narrow);
}
.container--full {
  max-width: 100%;
  padding: 0;
}

/* ============ SECTIONS ============ */
.section {
  padding-top: var(--s-9);
  padding-bottom: var(--s-9);
}

@media (min-width: 1024px) {
  .section {
    padding-top: var(--s-10);
    padding-bottom: var(--s-10);
  }
  .section--signature {
    padding-top: var(--s-11);
    padding-bottom: var(--s-11);
  }
}

.section--alt {
  background: var(--paper-2);
}
.section--dark {
  background: var(--carbon);
  color: var(--paper);
}
.section--dark .h1,
.section--dark .h2,
.section--dark .h3 {
  color: var(--paper);
}
.section--dark .caption,
.section--dark .eyebrow {
  color: rgba(247, 244, 237, 0.65);
}
.section--bone {
  background: var(--bone);
}

/* ============ ANIMATIONS — Scroll reveal ============ */
/* Progressive enhancement: armed by JS via .js-armed marker on <html>.
 * Without JS, all content is fully visible — safe for SEO/print/no-JS users. */
.js-armed [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js-armed [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media print {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

[data-reveal][data-delay="100"] {
  transition-delay: 100ms;
}
[data-reveal][data-delay="200"] {
  transition-delay: 200ms;
}
[data-reveal][data-delay="300"] {
  transition-delay: 300ms;
}
[data-reveal][data-delay="400"] {
  transition-delay: 400ms;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ============ UTILS ============ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.center {
  text-align: center;
}
.center-block {
  margin-left: auto;
  margin-right: auto;
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-3 {
  gap: var(--s-3);
}
.gap-4 {
  gap: var(--s-4);
}
.gap-5 {
  gap: var(--s-5);
}
.gap-6 {
  gap: var(--s-6);
}

.mt-3 {
  margin-top: var(--s-3);
}
.mt-4 {
  margin-top: var(--s-4);
}
.mt-5 {
  margin-top: var(--s-5);
}
.mt-6 {
  margin-top: var(--s-6);
}
.mt-7 {
  margin-top: var(--s-7);
}
.mt-8 {
  margin-top: var(--s-8);
}
.mb-3 {
  margin-bottom: var(--s-3);
}
.mb-4 {
  margin-bottom: var(--s-4);
}
.mb-5 {
  margin-bottom: var(--s-5);
}
.mb-6 {
  margin-bottom: var(--s-6);
}
