@layer reset, base, components, utilities;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
    color-scheme: dark;
  }

  body {
    margin: 0;
  }

  img,
  picture,
  svg {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
  }

  h1, h2, h3, p, ul, ol, figure {
    margin: 0;
  }

  ul, ol {
    padding-inline-start: 0;
    list-style: none;
  }
}

@layer base {
  :root {
    --bg-abyss: #060d1a;
    --bg-navy: #0b172c;
    --surface-card: rgba(13, 25, 48, 0.72);
    --surface-card-hover: rgba(19, 36, 68, 0.85);
    --border-gold: rgba(212, 175, 55, 0.32);
    --border-gold-strong: rgba(242, 201, 76, 0.65);

    --alliance-gold: #e8be5a;
    --alliance-gold-bright: #ffd97d;
    --alliance-blue: #2563eb;
    --alliance-blue-glow: rgba(37, 99, 235, 0.35);

    --text-main: #f1f5f9;
    --text-muted: #b8c7dc;
    --text-dark: #091221;

    --font-display: "Cinzel", Georgia, serif;
    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-card: 0 20px 50px rgba(2, 6, 18, 0.55);
  }

  body {
    position: relative;
    min-block-size: 100dvh;
    font-family: var(--font-sans);
    font-size: clamp(1rem, 0.96rem + 0.25vw, 1.125rem);
    line-height: 1.65;
    color: var(--text-main);
    background-color: var(--bg-abyss);
    overflow-x: clip;
  }

  h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.18;
    letter-spacing: 0.02em;
    color: var(--text-main);
  }

  h1 {
    font-size: clamp(2.1rem, 1.35rem + 2.8vw, 3.65rem);
    font-weight: 800;
  }

  h2 {
    font-size: clamp(1.65rem, 1.25rem + 1.6vw, 2.5rem);
    font-weight: 700;
  }

  h3 {
    font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.35rem);
    font-weight: 700;
  }

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

  :focus-visible {
    outline: 2px solid var(--alliance-gold-bright);
    outline-offset: 3px;
  }
}

@layer components {
  /* Lavis d'arrière-plan peint à l'encre/aquarelle + lavis CSS superposé */
  .lavis-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: var(--bg-abyss);
    background-image:
      radial-gradient(ellipse 80% 55% at 15% 10%, rgba(37, 99, 235, 0.22), transparent 65%),
      radial-gradient(ellipse 70% 50% at 88% 20%, rgba(232, 190, 90, 0.14), transparent 60%),
      radial-gradient(ellipse 90% 60% at 50% 95%, rgba(18, 42, 84, 0.45), transparent 70%),
      url("assets/lavis-bg.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }

  .lavis-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(6, 13, 26, 0.35) 0%,
      rgba(6, 13, 26, 0.55) 55%,
      rgba(6, 13, 26, 0.82) 100%
    );
  }

  .container {
    inline-size: min(1160px, 100% - 2.5rem);
    margin-inline: auto;
  }

  /* Header */
  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: rgba(6, 13, 26, 0.76);
    border-block-end: 1px solid rgba(212, 175, 55, 0.2);
  }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: safe center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.85rem;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .brand-crest {
    inline-size: 46px;
    block-size: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--border-gold-strong);
    object-fit: cover;
    box-shadow: 0 0 18px rgba(232, 190, 90, 0.28);
  }

  .brand-text {
    display: flex;
    flex-direction: column;
  }

  .brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--alliance-gold-bright);
    line-height: 1.1;
  }

  .brand-sub {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
  }

  .site-nav a {
    transition: color 0.2s ease;
  }

  .site-nav a:hover {
    color: var(--alliance-gold-bright);
  }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-weight: 700;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  }

  .btn-sm {
    padding: 0.5rem 1.05rem;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 0.9rem 1.75rem;
    font-size: 1rem;
  }

  .btn-gold {
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--alliance-gold-bright) 0%, #d49b2a 100%);
    box-shadow: 0 8px 28px rgba(232, 190, 90, 0.35);
  }

  .btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(255, 217, 125, 0.5);
  }

  .btn-outline {
    color: var(--text-main);
    background: rgba(15, 31, 61, 0.6);
    border-color: var(--border-gold);
  }

  .btn-outline:hover {
    background: rgba(25, 48, 92, 0.8);
    border-color: var(--border-gold-strong);
    transform: translateY(-2px);
  }

  /* Hero */
  .hero {
    padding-block: clamp(3rem, 6vw, 5.5rem);
  }

  .hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
    align-items: center;
    gap: clamp(2rem, 4vw, 3.5rem);
  }

  .eyebrow {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--alliance-gold);
    margin-block-end: 0.75rem;
  }

  .hero-lead {
    margin-block-start: 1.25rem;
    font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem);
    color: var(--text-muted);
    max-inline-size: 56ch;
  }

  .hero-lead strong {
    color: var(--alliance-gold-bright);
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-block-start: 2rem;
  }

  .hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-block-start: 1.75rem;
  }

  .hero-badges li {
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(16, 33, 66, 0.75);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 999px;
  }

  .hero-visual {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    background: linear-gradient(145deg, rgba(255, 217, 125, 0.45), rgba(37, 99, 235, 0.35));
    box-shadow: var(--shadow-card), 0 0 60px var(--alliance-blue-glow);
  }

  .hero-visual img {
    aspect-ratio: 16 / 9;
    inline-size: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-lg) - 5px);
  }

  .visual-badge {
    position: absolute;
    inset-block-end: 1.25rem;
    inset-inline-start: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--alliance-gold-bright);
    background: rgba(6, 13, 26, 0.88);
    border: 1px solid var(--border-gold-strong);
    backdrop-filter: blur(8px);
  }

  .pulse-dot {
    inline-size: 9px;
    block-size: 9px;
    border-radius: 50%;
    background: var(--alliance-gold-bright);
    box-shadow: 0 0 10px var(--alliance-gold-bright);
  }

  /* Sections */
  .section {
    padding-block: clamp(3rem, 5vw, 4.75rem);
  }

  .section-alt {
    background: rgba(7, 15, 30, 0.55);
    border-block: 1px solid rgba(212, 175, 55, 0.14);
  }

  .section-header {
    text-align: center;
    max-inline-size: 64ch;
    margin-inline: auto;
    margin-block-end: 2.5rem;
  }

  .section-header-left {
    text-align: start;
    margin-inline: 0;
    margin-block-end: 1.75rem;
  }

  .section-intro {
    margin-block-start: 0.75rem;
    color: var(--text-muted);
  }

  /* Cards Grid with Subgrid fallback */
  .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    grid-template-rows: auto auto 1fr;
    gap: 1.5rem;
  }

  .card {
    container: card / inline-size;
    grid-row: span 3;
    display: grid;
    grid-template-rows: auto auto 1fr;
    grid-template-rows: subgrid;
    gap: 0.75rem;
    padding: 1.75rem;
    border-radius: var(--radius-md);
    background: var(--surface-card);
    border: 1px solid var(--border-gold);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  }

  .card:hover {
    transform: translateY(-4px);
    border-color: var(--border-gold-strong);
    background: var(--surface-card-hover);
  }

  .card-icon {
    display: grid;
    place-content: center;
    inline-size: 3rem;
    block-size: 3rem;
    font-size: 1.5rem;
    border-radius: 12px;
    background: rgba(232, 190, 90, 0.12);
    border: 1px solid var(--border-gold);
  }

  .card p {
    color: var(--text-muted);
  }

  /* Objectives */
  .objectives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    align-items: center;
    gap: clamp(2rem, 4vw, 3.5rem);
  }

  .objectives-visual {
    border-radius: var(--radius-lg);
    padding: 0.45rem;
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.4), rgba(212, 175, 55, 0.35));
    box-shadow: var(--shadow-card);
  }

  .objectives-visual img {
    aspect-ratio: 16 / 9;
    inline-size: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-lg) - 4px);
  }

  .roadmap {
    display: grid;
    gap: 1rem;
  }

  .roadmap-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--surface-card);
    border: 1px solid rgba(148, 163, 184, 0.2);
  }

  .roadmap-item-highlight {
    border-color: var(--border-gold-strong);
    background: rgba(20, 38, 74, 0.85);
    box-shadow: 0 0 30px rgba(232, 190, 90, 0.14);
  }

  .roadmap-tag {
    padding: 0.28rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 999px;
    color: var(--alliance-gold-bright);
    background: rgba(232, 190, 90, 0.14);
    border: 1px solid var(--border-gold);
    white-space: nowrap;
  }

  .roadmap-item h3 {
    margin-block-end: 0.25rem;
  }

  .roadmap-item p {
    color: var(--text-muted);
    font-size: 0.96rem;
  }

  /* CTA Banner */
  .cta-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.75rem;
    padding: clamp(1.75rem, 4vw, 3rem);
    border-radius: var(--radius-lg);
    background: linear-gradient(125deg, rgba(16, 34, 68, 0.92), rgba(9, 19, 38, 0.94));
    border: 1.5px solid var(--border-gold-strong);
    box-shadow: var(--shadow-card), 0 0 50px rgba(37, 99, 235, 0.22);
  }

  .cta-crest {
    inline-size: 96px;
    block-size: 96px;
    border-radius: 50%;
    border: 2px solid var(--border-gold-strong);
    object-fit: cover;
  }

  .cta-body {
    flex: 1 1 320px;
  }

  .cta-body p:last-child {
    margin-block-start: 0.5rem;
    color: var(--text-muted);
  }

  /* Footer */
  .site-footer {
    padding-block: 2rem;
    border-block-start: 1px solid rgba(212, 175, 55, 0.18);
    background: rgba(4, 9, 18, 0.85);
    font-size: 0.9rem;
    color: var(--text-muted);
  }

  .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .site-footer a {
    color: var(--alliance-gold-bright);
    font-weight: 600;
  }

  .site-footer a:hover {
    text-decoration: underline;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .card {
    transition: none;
  }
}
