@layer reset, base, primitives;

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

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

  body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol, li, pre, code, fieldset, legend, button, input, select, textarea {
    margin: 0;
    padding: 0;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

  ul, ol {
    list-style: none;
  }

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

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

  input, button, textarea, select {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    border-radius: 0;
  }

  button {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
  }

  textarea {
    resize: vertical;
  }

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

  blockquote, q {
    quotes: none;
  }

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

  address {
    font-style: normal;
  }

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

@layer base {
  :root {
    --color-background: #F4F1EA;
    --color-ink: #252525;
    --color-forest: #29484A;
    --color-copper: #A96E4F;
    --color-mauve: #8A7C87;
    --color-champagne: #B39A6B;
    --color-surface-light: #FFFFFF;
    --color-surface-dark: #1E1E1E;
    --color-text-on-dark: #F4F1EA;
    --color-text-on-accent: #FFFFFF;
    --color-border-subtle: #E0DDD5;

    --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --text-display: clamp(3rem, 5vw + 1rem, 4.5rem);
    --text-h1: clamp(2rem, 3.5vw + 0.5rem, 3rem);
    --text-h2: clamp(1.75rem, 2.5vw + 0.5rem, 2.25rem);
    --text-h3: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
    --text-body: 1rem;
    --text-small: 0.875rem;
    --text-caption: 0.75rem;

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

    --tracking-label: 0.08em;
    --tracking-caption: 0.04em;

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

    --container-max: 75rem;
    --container-padding-inline: clamp(1rem, 4vw, 2rem);
    --section-padding-block: clamp(3rem, 8vw, 6rem);

    --surface-card: var(--color-surface-light);
    --surface-panel: var(--color-surface-light);
    --surface-footer: var(--color-surface-dark);

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 6px 28px rgba(0, 0, 0, 0.08);

    --radius-small: 4px;
    --radius-medium: 8px;
    --radius-large: 16px;
    --radius-pill: 24px;

    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;

    --outline-focus: 2px solid var(--color-copper);
    --outline-offset-focus: 2px;
  }

  body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-weight: 400;
    color: var(--color-ink);
    background-color: var(--color-background);
    min-height: 100vh;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--color-ink);
    text-wrap: balance;
  }

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

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

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

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

  p {
    font-size: var(--text-body);
    line-height: var(--leading-body);
    margin-block-end: var(--space-2xs);
  }

  .display {
    font-family: var(--font-heading);
    font-size: var(--text-display);
    line-height: var(--leading-display);
    font-weight: 400;
    color: var(--color-ink);
    margin-block-end: var(--space-sm);
  }

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

  .text-caption, figcaption {
    font-size: var(--text-caption);
    line-height: var(--leading-caption);
    letter-spacing: var(--tracking-caption);
    color: var(--color-mauve);
  }

  .label, .eyebrow {
    font-size: var(--text-small);
    line-height: var(--leading-small);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-copper);
    margin-block-end: var(--space-3xs);
  }

  a {
    color: var(--color-forest);
    transition: color var(--transition-fast);
  }

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

  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: var(--outline-focus);
    outline-offset: var(--outline-offset-focus);
  }

  strong, b {
    font-weight: 600;
  }

  em, i {
    font-style: italic;
  }

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

  ul {
    list-style: disc;
  }

  ol {
    list-style: decimal;
  }

  ul ul, ol ol, ul ol, ol ul {
    margin-block-end: 0;
  }

  blockquote {
    margin-block-end: var(--space-2xs);
    padding-inline-start: var(--space-xs);
    border-inline-start: 2px solid var(--color-copper);
    color: var(--color-mauve);
    font-style: italic;
  }

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

  figcaption {
    margin-block-start: var(--space-3xs);
  }

  hr {
    border: none;
    border-block-start: 1px solid var(--color-border-subtle);
    margin-block: var(--space-md);
  }

  img {
    height: auto;
  }

  fieldset {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-medium);
    padding: var(--space-xs);
    margin-block-end: var(--space-xs);
  }

  legend {
    padding-inline: var(--space-3xs);
    font-size: var(--text-small);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-mauve);
  }

  label {
    display: block;
    font-size: var(--text-small);
    line-height: var(--leading-small);
    color: var(--color-ink);
    margin-block-end: var(--space-4xs);
  }

  input, select, textarea {
    width: 100%;
    font-size: var(--text-body);
    line-height: var(--leading-body);
    color: var(--color-ink);
    background-color: var(--color-surface-light);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-small);
    padding: var(--space-3xs) var(--space-2xs);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  }

  input::placeholder, textarea::placeholder {
    color: var(--color-mauve);
    opacity: 1;
  }

  input:focus, select:focus, textarea:focus {
    border-color: var(--color-copper);
    box-shadow: 0 0 0 1px var(--color-copper);
    outline: none;
  }

  select {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--color-mauve) 50%), linear-gradient(135deg, var(--color-mauve) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% - 2px), calc(100% - 15px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-inline-end: var(--space-sm);
  }

  textarea {
    min-height: 6rem;
  }

  ::selection {
    background-color: var(--color-copper);
    color: var(--color-text-on-accent);
  }

  :focus-visible {
    outline: var(--outline-focus);
    outline-offset: var(--outline-offset-focus);
  }

  @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;
      scroll-behavior: auto !important;
    }
  }
}

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

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

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

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

  .surface-card {
    background-color: var(--surface-card);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-soft);
  }

  .surface-panel {
    background-color: var(--surface-panel);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
  }

  .surface-dark {
    background-color: var(--surface-dark);
    color: var(--color-text-on-dark);
  }

  .surface-dark h1,
  .surface-dark h2,
  .surface-dark h3,
  .surface-dark h4,
  .surface-dark h5,
  .surface-dark h6 {
    color: var(--color-text-on-dark);
  }

  .surface-dark a {
    color: var(--color-text-on-dark);
  }

  .surface-dark a:hover {
    color: var(--color-copper);
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3xs);
    font-family: var(--font-body);
    font-size: var(--text-small);
    font-weight: 500;
    line-height: 1;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-text-on-accent);
    background-color: var(--color-forest);
    border-radius: var(--radius-small);
    padding: var(--space-2xs) var(--space-xs);
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
  }

  .btn:hover {
    background-color: var(--color-copper);
    color: var(--color-text-on-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
  }

  .btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-soft);
  }

  .btn--copper {
    background-color: var(--color-copper);
  }

  .btn--copper:hover {
    background-color: var(--color-forest);
  }

  .btn--ghost {
    background-color: transparent;
    color: var(--color-forest);
    border: 1px solid var(--color-forest);
  }

  .btn--ghost:hover {
    background-color: var(--color-forest);
    color: var(--color-text-on-accent);
  }

  .btn--on-dark {
    background-color: var(--color-copper);
    color: var(--color-text-on-accent);
  }

  .btn--on-dark:hover {
    background-color: var(--color-text-on-dark);
    color: var(--color-ink);
  }

  .btn--large {
    font-size: var(--text-body);
    padding: var(--space-xs) var(--space-sm);
  }

  .btn--small {
    font-size: var(--text-caption);
    padding: var(--space-3xs) var(--space-2xs);
  }

  .flex {
    display: flex;
  }

  .flex--inline {
    display: inline-flex;
  }

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

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

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

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

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

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

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

  .flex--align-stretch {
    align-items: stretch;
  }

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

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

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

  .flex--justify-between {
    justify-content: space-between;
  }

  .flex--justify-around {
    justify-content: space-around;
  }

  .flex--justify-evenly {
    justify-content: space-evenly;
  }

  .flex--gap-4xs {
    gap: var(--space-4xs);
  }

  .flex--gap-3xs {
    gap: var(--space-3xs);
  }

  .flex--gap-2xs {
    gap: var(--space-2xs);
  }

  .flex--gap-xs {
    gap: var(--space-xs);
  }

  .flex--gap-sm {
    gap: var(--space-sm);
  }

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

  .flex--gap-lg {
    gap: var(--space-lg);
  }

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

  .flex--nowrap > * {
    flex-shrink: 0;
  }

  .flex--nowrap > .flex__grow {
    flex-shrink: 1;
  }

  .flex__grow {
    flex-grow: 1;
  }

  .flex__shrink {
    flex-shrink: 1;
  }

  .flex__no-shrink {
    flex-shrink: 0;
  }

  .flex__no-grow {
    flex-grow: 0;
  }

  .flex__basis-auto {
    flex-basis: auto;
  }

  .flex__basis-0 {
    flex-basis: 0;
  }

  .grid {
    display: grid;
    gap: var(--space-sm);
  }

  .grid > * {
    min-width: 0;
  }

  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid--gap-4xs {
    gap: var(--space-4xs);
  }

  .grid--gap-3xs {
    gap: var(--space-3xs);
  }

  .grid--gap-2xs {
    gap: var(--space-2xs);
  }

  .grid--gap-xs {
    gap: var(--space-xs);
  }

  .grid--gap-sm {
    gap: var(--space-sm);
  }

  .grid--gap-md {
    gap: var(--space-md);
  }

  .grid--gap-lg {
    gap: var(--space-lg);
  }

  .grid--gap-xl {
    gap: var(--space-xl);
  }

  @media (max-width: 64rem) {
    .grid--4 {
      grid-template-columns: repeat(2, 1fr);
    }

    .grid--3 {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (max-width: 40rem) {
    .grid--2,
    .grid--3,
    .grid--4 {
      grid-template-columns: 1fr;
    }
  }

  .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-2xs);
    z-index: 1000;
    background-color: var(--color-forest);
    color: var(--color-text-on-accent);
    padding: var(--space-3xs) var(--space-2xs);
    border-radius: var(--radius-small);
    transition: top var(--transition-fast);
  }

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

  .ratio {
    position: relative;
    width: 100%;
    overflow: hidden;
  }

  .ratio > img,
  .ratio > video,
  .ratio > iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .ratio--4-5 {
    aspect-ratio: 4 / 5;
  }

  .ratio--16-9 {
    aspect-ratio: 16 / 9;
  }

  .ratio--1-1 {
    aspect-ratio: 1 / 1;
  }

  .ratio--3-2 {
    aspect-ratio: 3 / 2;
  }

  .ratio--2-3 {
    aspect-ratio: 2 / 3;
  }

  .img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .img-contain {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .img-zoom {
    overflow: hidden;
  }

  .img-zoom img {
    transition: transform var(--transition-base);
  }

  .img-zoom:hover img,
  .img-zoom:focus-within img {
    transform: scale(1.02);
  }

  .overlay {
    position: relative;
  }

  .overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(30, 30, 30, 0.6) 0%, rgba(30, 30, 30, 0) 50%);
    pointer-events: none;
  }

  .overlay--dark::after {
    background: rgba(30, 30, 30, 0.45);
  }

  .overlay--light::after {
    background: linear-gradient(to top, rgba(244, 241, 234, 0.7) 0%, rgba(244, 241, 234, 0) 50%);
  }

  .overlay > * {
    position: relative;
    z-index: 1;
  }

  .tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4xs);
    font-size: var(--text-caption);
    line-height: var(--leading-caption);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-forest);
    background-color: var(--color-background);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    padding: var(--space-4xs) var(--space-2xs);
  }

  .tag--copper {
    color: var(--color-copper);
    border-color: var(--color-copper);
  }

  .tag--forest {
    color: var(--color-text-on-accent);
    background-color: var(--color-forest);
    border-color: var(--color-forest);
  }

  .tag--champagne {
    color: var(--color-ink);
    background-color: var(--color-champagne);
    border-color: var(--color-champagne);
  }

  .divider {
    border: none;
    border-block-start: 1px solid var(--color-border-subtle);
    margin-block: var(--space-md);
  }

  .divider--copper {
    border-block-start-color: var(--color-copper);
  }

  .divider--mauve {
    border-block-start-color: var(--color-mauve);
  }

  .content-list {
    list-style: disc;
    padding-inline-start: var(--space-xs);
    margin-block-end: var(--space-2xs);
  }

  .content-list li {
    margin-block-end: var(--space-3xs);
  }

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

  .content-list--ordered {
    list-style: decimal;
  }

  .content-list--none {
    list-style: none;
    padding-inline-start: 0;
  }

  .content-list--inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs) var(--space-2xs);
    list-style: none;
    padding-inline-start: 0;
  }

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

  :where(h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, figure, hr, .display, .label, .eyebrow, .content-list):last-child {
    margin-block-end: 0;
  }

  :where(.surface-card, .surface-panel, .surface-dark, .overlay, .section--tight) > :last-child {
    margin-block-end: 0;
  }

  :where(.surface-card, .surface-panel, .surface-dark, .overlay, .section--tight) > .content-list:last-child {
    margin-block-end: 0;
  }
}