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

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

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

  ul, ol {
    list-style: none;
  }

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

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

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

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

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

  blockquote, q {
    quotes: none;
  }

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

  strong, b {
    font-weight: 600;
  }

  em, i {
    font-style: italic;
  }

  abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
  }

  address {
    font-style: normal;
  }

  fieldset {
    border: none;
    min-width: 0;
  }

  legend {
    padding: 0;
  }

  textarea {
    resize: vertical;
  }

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

@layer base {
  :root {
    --color-paper: #F7F3EC;
    --color-paper-deep: #EFE8DC;
    --color-ink: #1C1A17;
    --color-ink-muted: #5E574E;
    --color-wine: #6E1F2E;
    --color-wine-deep: #4E1420;
    --color-wine-wash: #F1E4E6;
    --color-rule: #D8CFC0;
    --color-success: #3F6B4A;

    --font-heading: "Playfair Display", "Georgia", serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;

    --text-display-size: clamp(2.6rem, 6vw, 4.8rem);
    --text-display-line-height: 1.02;
    --text-display-weight: 700;
    --text-display-tracking: -0.02em;

    --text-h1-size: clamp(2rem, 4.4vw, 3.4rem);
    --text-h1-line-height: 1.08;
    --text-h1-weight: 700;
    --text-h1-tracking: -0.015em;

    --text-h2-size: clamp(1.5rem, 3vw, 2.2rem);
    --text-h2-line-height: 1.15;
    --text-h2-weight: 600;
    --text-h2-tracking: -0.01em;

    --text-h3-size: 1.25rem;
    --text-h3-line-height: 1.25;
    --text-h3-weight: 600;
    --text-h3-tracking: 0;

    --text-eyebrow-size: 0.75rem;
    --text-eyebrow-line-height: 1.4;
    --text-eyebrow-weight: 600;
    --text-eyebrow-tracking: 0.18em;

    --text-body-lg-size: 1.125rem;
    --text-body-lg-line-height: 1.7;
    --text-body-lg-weight: 400;

    --text-body-size: 1rem;
    --text-body-line-height: 1.7;
    --text-body-weight: 400;

    --text-small-size: 0.875rem;
    --text-small-line-height: 1.6;
    --text-small-weight: 400;

    --text-caption-size: 0.75rem;
    --text-caption-line-height: 1.5;
    --text-caption-weight: 400;
    --text-caption-tracking: 0.04em;

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

    --container-max: 1240px;
    --container-padding: max(24px, 5vw);

    --radius-none: 0;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-full: 999px;

    --shadow-soft: 0 8px 24px rgba(28, 26, 23, 0.08);

    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;

    --focus-ring-width: 2px;
    --focus-ring-offset: 2px;
  }

  html {
    background-color: var(--color-paper);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 100%;
    line-height: var(--text-body-line-height);
    -webkit-tap-highlight-color: transparent;
  }

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

  main {
    display: block;
  }

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

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

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

  h3 {
    font-size: var(--text-h3-size);
    font-weight: var(--text-h3-weight);
    line-height: var(--text-h3-line-height);
    letter-spacing: var(--text-h3-tracking);
    margin-block-end: var(--space-sm);
  }

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

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

  p:last-child {
    margin-block-end: 0;
  }

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

  ul {
    list-style: disc;
  }

  ol {
    list-style: decimal;
  }

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

  blockquote {
    font-family: var(--font-heading);
    font-size: var(--text-h2-size);
    font-weight: 600;
    font-style: italic;
    line-height: var(--text-h2-line-height);
    letter-spacing: var(--text-h2-tracking);
    margin-block-end: var(--space-lg);
    padding-inline-start: var(--space-lg);
    border-inline-start: 2px solid var(--color-wine);
    color: var(--color-ink);
  }

  blockquote:last-child {
    margin-block-end: 0;
  }

  blockquote p {
    font: inherit;
    letter-spacing: inherit;
    margin-block-end: 0;
  }

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

  figure:last-child {
    margin-block-end: 0;
  }

  figcaption {
    font-size: var(--text-caption-size);
    font-weight: var(--text-caption-weight);
    line-height: var(--text-caption-line-height);
    letter-spacing: var(--text-caption-tracking);
    color: var(--color-ink-muted);
    margin-block-start: var(--space-xs);
    padding-block-start: var(--space-xs);
    border-block-start: 1px solid var(--color-rule);
  }

  address {
    font-style: normal;
    margin-block-end: var(--space-md);
  }

  address:last-child {
    margin-block-end: 0;
  }

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

  dl:last-child {
    margin-block-end: 0;
  }

  dt {
    font-weight: 600;
    margin-block-end: var(--space-2xs);
  }

  dd {
    margin-inline-start: 0;
    margin-block-end: var(--space-sm);
  }

  dd:last-child {
    margin-block-end: 0;
  }

  pre, code {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
    font-size: 0.875em;
  }

  pre {
    margin-block-end: var(--space-md);
    padding: var(--space-md);
    background-color: var(--color-paper-deep);
    border: 1px solid var(--color-rule);
    overflow-x: auto;
  }

  pre:last-child {
    margin-block-end: 0;
  }

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

  a {
    color: var(--color-wine);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
  }

  a:hover {
    color: var(--color-wine-deep);
    text-decoration-color: var(--color-wine-deep);
  }

  a:focus-visible {
    outline: var(--focus-ring-width) solid var(--color-wine);
    outline-offset: var(--focus-ring-offset);
    border-radius: var(--radius-sm);
  }

  img {
    height: auto;
    max-width: 100%;
  }

  table {
    width: 100%;
    margin-block-end: var(--space-md);
    font-size: var(--text-body-size);
    line-height: var(--text-body-line-height);
  }

  table:last-child {
    margin-block-end: 0;
  }

  th, td {
    padding: var(--space-sm) var(--space-md);
    border-block-end: 1px solid var(--color-rule);
    text-align: start;
    vertical-align: top;
  }

  th {
    font-weight: 600;
    color: var(--color-ink);
  }

  tbody tr:hover {
    background-color: var(--color-wine-wash);
  }

  input, textarea, select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-body-size);
    font-weight: var(--text-body-weight);
    line-height: var(--text-body-line-height);
    color: var(--color-ink);
    background-color: var(--color-paper);
    border: 1px solid var(--color-rule);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  }

  input::placeholder, textarea::placeholder {
    color: var(--color-ink-muted);
  }

  input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: none;
    border-color: var(--color-wine);
    box-shadow: 0 0 0 var(--focus-ring-width) var(--color-wine-wash);
  }

  input[type="checkbox"], input[type="radio"] {
    width: auto;
    padding: 0;
    border: 1px solid var(--color-rule);
    accent-color: var(--color-wine);
  }

  input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
    outline: var(--focus-ring-width) solid var(--color-wine);
    outline-offset: var(--focus-ring-offset);
  }

  button {
    font-family: var(--font-body);
    font-size: var(--text-body-size);
    font-weight: 600;
    line-height: var(--text-body-line-height);
    color: var(--color-ink);
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
  }

  button:focus-visible {
    outline: var(--focus-ring-width) solid var(--color-wine);
    outline-offset: var(--focus-ring-offset);
    border-radius: var(--radius-sm);
  }

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

  :focus-visible {
    outline: var(--focus-ring-width) solid var(--color-wine);
    outline-offset: var(--focus-ring-offset);
  }
}

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

  .display {
    font-family: var(--font-heading);
    font-size: var(--text-display-size);
    font-weight: var(--text-display-weight);
    line-height: var(--text-display-line-height);
    letter-spacing: var(--text-display-tracking);
    color: var(--color-ink);
    margin-block-end: var(--space-lg);
  }

  .eyebrow {
    font-family: var(--font-body);
    font-size: var(--text-eyebrow-size);
    font-weight: var(--text-eyebrow-weight);
    line-height: var(--text-eyebrow-line-height);
    letter-spacing: var(--text-eyebrow-tracking);
    text-transform: uppercase;
    color: var(--color-wine);
    margin-block-end: var(--space-sm);
  }

  .eyebrow--muted {
    color: var(--color-ink-muted);
  }

  .eyebrow--deep {
    color: var(--color-wine-deep);
  }

  .body-lg {
    font-size: var(--text-body-lg-size);
    font-weight: var(--text-body-lg-weight);
    line-height: var(--text-body-lg-line-height);
  }

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

  .text-caption {
    font-size: var(--text-caption-size);
    font-weight: var(--text-caption-weight);
    line-height: var(--text-caption-line-height);
    letter-spacing: var(--text-caption-tracking);
  }

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

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

  .text-wine-deep {
    color: var(--color-wine-deep);
  }

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

  .rule {
    border: none;
    border-block-start: 1px solid var(--color-rule);
    margin-block: var(--space-lg);
  }

  .rule--wine {
    border-block-start-color: var(--color-wine);
  }

  .surface-paper-deep {
    background-color: var(--color-paper-deep);
  }

  .surface-wine-wash {
    background-color: var(--color-wine-wash);
  }

  .surface-paper {
    background-color: var(--color-paper);
  }

  .radius-sm {
    border-radius: var(--radius-sm);
  }

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

  .radius-none {
    border-radius: var(--radius-none);
  }

  .shadow-soft {
    box-shadow: var(--shadow-soft);
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-body);
    font-size: var(--text-body-size);
    font-weight: 600;
    line-height: var(--text-body-line-height);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  }

  .btn--primary {
    background-color: var(--color-wine);
    color: var(--color-paper);
    border: 1px solid var(--color-wine);
  }

  .btn--primary:hover {
    background-color: var(--color-wine-deep);
    border-color: var(--color-wine-deep);
    color: var(--color-paper);
  }

  .btn--text {
    background: none;
    color: var(--color-wine);
    border: none;
    padding-inline: 0;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }

  .btn--text:hover {
    color: var(--color-wine-deep);
    text-decoration-color: var(--color-wine-deep);
  }

  .btn--outline {
    background: none;
    color: var(--color-ink);
    border: 1px solid var(--color-ink);
  }

  .btn--outline:hover {
    border-color: var(--color-wine);
    color: var(--color-wine);
  }

  .btn--pill {
    border-radius: var(--radius-full);
  }

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

  .flex {
    display: flex;
  }

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

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

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

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

  .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--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--gap-xl {
    gap: var(--space-xl);
  }

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

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

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

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

  .flex--nowrap > img,
  .flex--nowrap > picture,
  .flex--nowrap > video,
  .flex--nowrap > svg {
    flex-shrink: 0;
  }

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

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

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

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

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

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

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

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

  .grid--gap-none {
    gap: 0;
  }

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

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

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

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

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

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

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

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

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

  .content-list > li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: 0.65em;
    width: 6px;
    height: 1px;
    background-color: var(--color-wine);
  }

  .content-list--disc > li::before {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    inset-block-start: 0.7em;
    background-color: var(--color-ink);
  }

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

  .content-list--none > li::before {
    display: none;
  }
}