@layer reset, base, primitives;

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

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

  body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
  }

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

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

  button {
    background: none;
    border: none;
    cursor: pointer;
  }

  ul, ol {
    list-style: none;
  }

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

  table {
    border-collapse: collapse;
    border-spacing: 0;
  }

  blockquote, q {
    quotes: none;
  }

  blockquote::before, blockquote::after,
  q::before, q::after {
    content: '';
    content: none;
  }

  hr {
    border: none;
    border-top: 1px solid currentColor;
    opacity: 0.25;
  }

  address {
    font-style: normal;
  }

  fieldset {
    border: none;
  }

  legend {
    padding: 0;
  }

  summary {
    cursor: pointer;
  }

  [hidden] {
    display: none !important;
  }
}

@layer base {
  :root {
    --color-amande: #8A9A5B;
    --color-amande-foncee: #5C6B3A;
    --color-rose-poudre: #F4C7C3;
    --color-rose-poudre-fonce: #D49A8C;
    --color-ivoire: #FDF8F0;
    --color-aubergine: #3D1F2E;
    --color-aubergine-clair: #6B4A5A;
    --color-blanc: #FFFFFF;

    --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: "Lato", "Helvetica Neue", Arial, sans-serif;

    --text-display: clamp(2.5rem, 1.8rem + 3.5vw, 3.5rem);
    --text-h1: clamp(2rem, 1.6rem + 2vw, 2.5rem);
    --text-h2: clamp(1.6rem, 1.35rem + 1.25vw, 2rem);
    --text-h3: 1.5rem;
    --text-body: 1rem;
    --text-small: 0.875rem;

    --leading-display: 1.1;
    --leading-h1: 1.2;
    --leading-h2: 1.3;
    --leading-h3: 1.4;
    --leading-body: 1.6;
    --leading-small: 1.5;

    --weight-display: 700;
    --weight-h1: 700;
    --weight-h2: 600;
    --weight-h3: 600;
    --weight-body: 400;
    --weight-small: 400;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    --container-max: 1200px;
    --container-padding: 1.5rem;
    --section-padding-y: var(--space-3xl);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-popup: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-button-hover: 0 2px 6px rgba(0, 0, 0, 0.08);

    --border-thin: 1px solid var(--color-amande-foncee);
    --border-rose: 1px solid var(--color-rose-poudre);

    --transition-smooth: 0.3s ease-in-out;

    --ratio-image-frame: 3 / 4;
  }

  html {
    font-family: var(--font-body);
    font-size: 100%;
    line-height: var(--leading-body);
    color: var(--color-aubergine);
    background-color: var(--color-ivoire);
  }

  body {
    font-size: var(--text-body);
    font-weight: var(--weight-body);
    color: var(--color-aubergine-clair);
    background-color: var(--color-ivoire);
    line-height: var(--leading-body);
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-aubergine);
    font-weight: var(--weight-h2);
    line-height: var(--leading-h2);
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  h1 {
    font-size: var(--text-h1);
    line-height: var(--leading-h1);
    font-weight: var(--weight-h1);
    margin-block-end: var(--space-lg);
  }

  h2 {
    font-size: var(--text-h2);
    line-height: var(--leading-h2);
    font-weight: var(--weight-h2);
    margin-block-end: var(--space-md);
  }

  h3 {
    font-size: var(--text-h3);
    line-height: var(--leading-h3);
    font-weight: var(--weight-h3);
    margin-block-end: var(--space-md);
  }

  h4, h5, h6 {
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-weight: var(--weight-h3);
    margin-block-end: var(--space-sm);
  }

  p {
    font-size: var(--text-body);
    line-height: var(--leading-body);
    color: var(--color-aubergine-clair);
    margin-block-end: var(--space-md);
    overflow-wrap: break-word;
  }

  ul, ol {
    margin-block-end: var(--space-md);
    padding-inline-start: var(--space-lg);
  }

  ul {
    list-style: disc;
  }

  ol {
    list-style: decimal;
  }

  li {
    margin-block-end: var(--space-xs);
    line-height: var(--leading-body);
  }

  blockquote {
    margin-block-end: var(--space-md);
    padding-inline-start: var(--space-lg);
    border-inline-start: 3px solid var(--color-amande);
    color: var(--color-aubergine-clair);
    font-style: italic;
  }

  figure {
    margin-block-end: var(--space-md);
  }

  figcaption {
    font-size: var(--text-small);
    line-height: var(--leading-small);
    color: var(--color-aubergine-clair);
    margin-block-start: var(--space-xs);
    font-variant: small-caps;
    letter-spacing: 0.02em;
  }

  small {
    font-size: var(--text-small);
    line-height: var(--leading-small);
    color: var(--color-aubergine-clair);
  }

  strong, b {
    font-weight: 700;
    color: var(--color-aubergine);
  }

  em, i {
    font-style: italic;
  }

  a {
    color: var(--color-amande-foncee);
    transition: color var(--transition-smooth);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
  }

  a:hover {
    color: var(--color-amande);
  }

  a:focus-visible {
    outline: 2px solid var(--color-amande);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }

  img {
    border-radius: var(--radius-md);
  }

  hr {
    border-color: var(--color-rose-poudre);
    margin-block: var(--space-lg);
  }

  code, pre {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
    font-size: 0.9em;
    background: var(--color-rose-poudre);
    border-radius: var(--radius-sm);
    padding: 0.15em 0.4em;
    color: var(--color-aubergine);
  }

  pre {
    padding: var(--space-md);
    overflow-x: auto;
    margin-block-end: var(--space-md);
  }

  pre code {
    background: none;
    padding: 0;
  }

  input, textarea, select {
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    color: var(--color-aubergine);
    background-color: var(--color-blanc);
    border: var(--border-thin);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
    width: 100%;
  }

  input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-amande);
    box-shadow: 0 0 0 3px var(--color-rose-poudre);
  }

  input::placeholder, textarea::placeholder {
    color: var(--color-aubergine-clair);
    opacity: 0.7;
  }

  textarea {
    min-height: 120px;
    resize: vertical;
  }

  select {
    appearance: auto;
    cursor: pointer;
  }

  label {
    display: inline-block;
    font-size: var(--text-small);
    line-height: var(--leading-small);
    color: var(--color-aubergine);
    font-weight: 600;
    margin-block-end: var(--space-xs);
  }

  button {
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-weight: 600;
    color: var(--color-ivoire);
    background-color: var(--color-amande);
    border: none;
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-lg);
    transition: background-color var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-height: 44px;
    text-align: center;
  }

  button:hover {
    background-color: var(--color-amande-foncee);
    box-shadow: var(--shadow-button-hover);
  }

  button:focus-visible {
    outline: 2px solid var(--color-amande-foncee);
    outline-offset: 2px;
  }

  button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
  }

  ::selection {
    background-color: var(--color-rose-poudre);
    color: var(--color-aubergine);
  }

  :focus-visible {
    outline: 2px solid var(--color-amande);
    outline-offset: 2px;
  }
}

@layer primitives {
  .container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
    width: 100%;
  }

  .section {
    padding-block: var(--section-padding-y);
  }

  .card {
    background-color: var(--color-blanc);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    overflow: hidden;
  }

  .card > :last-child {
    margin-block-end: 0;
  }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background-color: var(--color-rose-poudre);
    color: var(--color-aubergine);
    font-size: var(--text-small);
    line-height: var(--leading-small);
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-weight: 600;
    color: var(--color-ivoire);
    background-color: var(--color-amande);
    border: none;
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-lg);
    min-height: 44px;
    text-align: center;
    cursor: pointer;
    transition: background-color var(--transition-smooth), box-shadow var(--transition-smooth);
    text-decoration: none;
  }

  .btn:hover {
    background-color: var(--color-amande-foncee);
    box-shadow: var(--shadow-button-hover);
    color: var(--color-ivoire);
  }

  .btn:focus-visible {
    outline: 2px solid var(--color-amande-foncee);
    outline-offset: 2px;
  }

  .btn-secondary {
    background-color: var(--color-rose-poudre);
    color: var(--color-aubergine);
  }

  .btn-secondary:hover {
    background-color: var(--color-rose-poudre-fonce);
    color: var(--color-aubergine);
  }

  .btn-outline {
    background-color: transparent;
    color: var(--color-amande-foncee);
    border: 1px solid var(--color-amande-foncee);
  }

  .btn-outline:hover {
    background-color: var(--color-amande);
    color: var(--color-ivoire);
    border-color: var(--color-amande);
  }

  .btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.125rem;
    min-height: 52px;
  }

  .btn-small {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-small);
    line-height: var(--leading-small);
    min-height: 36px;
  }

  .image-frame {
    aspect-ratio: var(--ratio-image-frame);
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: var(--color-rose-poudre);
  }

  .image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    transition: transform var(--transition-smooth);
  }

  .image-frame:hover img {
    transform: scale(1.03);
  }

  .content-list {
    list-style: none;
    padding-inline-start: 0;
    margin-block-end: var(--space-md);
  }

  .content-list li {
    margin-block-end: var(--space-sm);
    padding-inline-start: var(--space-lg);
    position: relative;
  }

  .content-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-amande);
  }

  .content-list li:last-child {
    margin-block-end: 0;
  }

  .flex {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
  }

  .flex > * {
    min-width: 0;
    flex-shrink: 1;
  }

  .flex-nowrap {
    flex-wrap: nowrap;
  }

  .flex-column {
    flex-direction: column;
  }

  .flex-center {
    align-items: center;
    justify-content: center;
  }

  .flex-between {
    align-items: center;
    justify-content: space-between;
  }

  .flex-start {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .flex-end {
    align-items: flex-end;
    justify-content: flex-end;
  }

  .flex-1 {
    flex: 1 1 0%;
    min-width: 0;
  }

  .flex-auto {
    flex: 0 0 auto;
  }

  .flex-grow {
    flex: 1 1 auto;
    min-width: 0;
  }

  .gap-xs { gap: var(--space-xs); }
  .gap-sm { gap: var(--space-sm); }
  .gap-md { gap: var(--space-md); }
  .gap-lg { gap: var(--space-lg); }
  .gap-xl { gap: var(--space-xl); }
  .gap-2xl { gap: var(--space-2xl); }
  .gap-3xl { gap: var(--space-3xl); }

  .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;
  }

  .skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    z-index: 1000;
    background-color: var(--color-aubergine);
    color: var(--color-ivoire);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    transition: top 0.2s ease-in-out;
  }

  .skip-link:focus {
    top: var(--space-md);
  }

  .divider {
    border: none;
    border-top: 1px solid var(--color-rose-poudre);
    margin-block: var(--space-lg);
  }

  .text-small {
    font-size: var(--text-small);
    line-height: var(--leading-small);
  }

  .text-muted {
    color: var(--color-aubergine-clair);
  }

  .text-aubergine {
    color: var(--color-aubergine);
  }

  .text-amande {
    color: var(--color-amande-foncee);
  }

  .text-center {
    text-align: center;
  }

  .mt-xs { margin-block-start: var(--space-xs); }
  .mt-sm { margin-block-start: var(--space-sm); }
  .mt-md { margin-block-start: var(--space-md); }
  .mt-lg { margin-block-start: var(--space-lg); }
  .mt-xl { margin-block-start: var(--space-xl); }
  .mt-2xl { margin-block-start: var(--space-2xl); }
  .mt-3xl { margin-block-start: var(--space-3xl); }

  .mb-xs { margin-block-end: var(--space-xs); }
  .mb-sm { margin-block-end: var(--space-sm); }
  .mb-md { margin-block-end: var(--space-md); }
  .mb-lg { margin-block-end: var(--space-lg); }
  .mb-xl { margin-block-end: var(--space-xl); }
  .mb-2xl { margin-block-end: var(--space-2xl); }
  .mb-3xl { margin-block-end: var(--space-3xl); }

  @media (max-width: 768px) {
    :root {
      --container-padding: 1rem;
      --section-padding-y: var(--space-xl);
    }

    .section {
      padding-block: var(--space-xl);
    }
  }

  @media (max-width: 480px) {
    :root {
      --container-padding: 0.75rem;
      --section-padding-y: var(--space-lg);
    }

    .section {
      padding-block: var(--space-lg);
    }

    .card {
      padding: var(--space-md);
    }
  }
}