@layer reset, global, composition, utility, block, exception;

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

  html {
    scroll-behavior: smooth;
  }

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

  ol,
  ul {
    padding: 0;
  }

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

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

/* Global */
@layer global {
  @font-face {
    font-family: "Cormorant Garamond";
    src: url("/assets/fonts/cormorant-garamond-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
  }

  @font-face {
    font-family: "Cormorant Garamond";
    src: url("/assets/fonts/cormorant-garamond-latin-italic.woff2") format("woff2");
    font-style: italic;
    font-weight: 300 700;
    font-display: swap;
  }

  @font-face {
    font-family: "Manrope";
    src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
  }

  :root {
    color-scheme: light;
    --color-burgundy: #701d38;
    --color-wine: #2f0d19;
    --color-ivory: #fbf7f2;
    --color-rose: #eadadd;
    --color-rose-surface: #eadadd;
    --color-champagne: #b49062;
    --color-ink: #211d1e;
    --color-white: #fff;
    --color-line: rgb(33 29 30 / 18%);
    --color-accent: var(--color-burgundy);
    --color-muted: rgb(33 29 30 / 75%);
    --color-primary-wash: rgb(112 29 56 / 18%);

    --font-display: "Cormorant Garamond", Georgia, serif;
    --font-body: "Manrope", Arial, sans-serif;

    --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.88rem);
    --step-0: clamp(1rem, 0.96rem + 0.18vw, 1.13rem);
    --step-1: clamp(1.25rem, 1.13rem + 0.56vw, 1.63rem);
    --step-2: clamp(1.7rem, 1.42rem + 1.25vw, 2.5rem);
    --step-3: clamp(2.4rem, 1.9rem + 2.25vw, 3.85rem);
    --step-4: clamp(3.25rem, 2.15rem + 4.7vw, 6.25rem);
    --step-5: clamp(4rem, 2.2rem + 7.7vw, 9rem);

    --space-2xs: 0.35rem;
    --space-xs: 0.65rem;
    --space-s: 1rem;
    --space-m: clamp(1.35rem, 1rem + 1.5vw, 2.25rem);
    --space-l: clamp(2rem, 1.35rem + 2.8vw, 3.75rem);
    --space-xl: clamp(3.5rem, 2.2rem + 5.5vw, 7rem);
    --space-2xl: clamp(5rem, 3rem + 8vw, 10rem);

    --gutter: clamp(1.25rem, 0.5rem + 3vw, 4rem);
    --wrapper: 82rem;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      color-scheme: dark;
      --color-burgundy: #701d38;
      --color-wine: #10080c;
      --color-ivory: #1c1417;
      --color-rose: #f0ccd8;
      --color-rose-surface: #342129;
      --color-champagne: #d4b47f;
      --color-ink: #f5ecef;
      --color-line: rgb(245 236 239 / 18%);
      --color-accent: #e4a4ba;
      --color-muted: rgb(245 236 239 / 74%);
      --color-primary-wash: rgb(228 164 186 / 18%);
    }
  }

  :root[data-color-mode="light"] {
    color-scheme: light;
    --color-burgundy: #701d38;
    --color-wine: #2f0d19;
    --color-ivory: #fbf7f2;
    --color-rose: #eadadd;
    --color-rose-surface: #eadadd;
    --color-champagne: #b49062;
    --color-ink: #211d1e;
    --color-line: rgb(33 29 30 / 18%);
    --color-accent: var(--color-burgundy);
    --color-muted: rgb(33 29 30 / 75%);
    --color-primary-wash: rgb(112 29 56 / 18%);
  }

  :root[data-color-mode="dark"] {
    color-scheme: dark;
    --color-burgundy: #701d38;
    --color-wine: #10080c;
    --color-ivory: #1c1417;
    --color-rose: #f0ccd8;
    --color-rose-surface: #342129;
    --color-champagne: #d4b47f;
    --color-ink: #f5ecef;
    --color-line: rgb(245 236 239 / 18%);
    --color-accent: #e4a4ba;
    --color-muted: rgb(245 236 239 / 74%);
    --color-primary-wash: rgb(228 164 186 / 18%);
  }

  html {
    background: var(--color-wine);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 100%;
  }

  body {
    min-width: 20rem;
    background: var(--color-ivory);
    font-size: var(--step-0);
    line-height: 1.65;
    text-rendering: optimizeLegibility;
  }

  h1,
  h2,
  h3 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 0.95;
    text-wrap: balance;
  }

  h1 {
    font-size: var(--step-5);
    letter-spacing: -0.045em;
  }

  h2 {
    font-size: var(--step-4);
    letter-spacing: -0.035em;
  }

  h3 {
    font-size: var(--step-2);
  }

  em {
    font-weight: 400;
  }

  a {
    color: currentcolor;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
  }

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

  :focus-visible {
    outline: 3px solid var(--color-champagne);
    outline-offset: 4px;
  }

  ::selection {
    background: var(--color-burgundy);
    color: var(--color-white);
  }
}

/* Every Layout-inspired compositions */
@layer composition {
  .wrapper {
    width: min(100% - (var(--gutter) * 2), var(--wrapper));
    margin-inline: auto;
  }

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

  .stack {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  .stack > * {
    margin-block: 0;
  }

  .stack > * + * {
    margin-block-start: var(--stack-space, var(--space-m));
  }

  .cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cluster-space, var(--space-m));
    align-items: center;
  }

  .cluster[data-layout="between"] {
    justify-content: space-between;
  }

  .switcher {
    display: flex;
    flex-wrap: wrap;
    gap: var(--switcher-space, var(--space-l));
    align-items: center;
  }

  .switcher > * {
    flex-grow: 1;
    flex-basis: calc((var(--switcher-threshold, 48rem) - 100%) * 999);
  }

  .grid {
    display: grid;
    grid-template-columns: repeat(
      auto-fit,
      minmax(min(var(--grid-min, 15rem), 100%), 1fr)
    );
    gap: var(--grid-space, var(--space-m));
  }

  .cover {
    display: flex;
    flex-direction: column;
    min-height: min(52rem, calc(100svh - 5rem));
  }

  .cover > * {
    margin-block: auto;
  }
}

/* Utilities */
@layer utility {
  [data-space="xs"] {
    --stack-space: var(--space-xs);
  }

  [data-space="s"] {
    --stack-space: var(--space-s);
  }

  [data-space="l"] {
    --stack-space: var(--space-l);
  }

  [data-space="xl"] {
    --stack-space: var(--space-xl);
  }

  .lede {
    max-width: 42rem;
    font-size: var(--step-1);
    line-height: 1.55;
  }

  .eyebrow {
    color: var(--color-accent);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.17em;
    line-height: 1.4;
    text-transform: uppercase;
  }
}

/* Blocks */
@layer block {
  .skip-link {
    position: fixed;
    z-index: 20;
    inset: 0 auto auto 0;
    padding: 0.8rem 1rem;
    background: var(--color-white);
    color: var(--color-wine);
    transform: translateY(-120%);
  }

  .skip-link:focus {
    transform: translateY(0);
  }

  .site-header {
    position: relative;
    z-index: 10;
    padding-block: 1.35rem;
    border-bottom: 1px solid rgb(251 247 242 / 28%);
    background: var(--color-burgundy);
    color: var(--color-white);
  }

  .site-header .cluster {
    --cluster-space: clamp(0.9rem, 0.4rem + 2vw, 2.5rem);
  }

  .site-header nav ul {
    list-style: none;
  }

  .site-header nav a {
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none;
  }

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

  .theme-toggle {
    display: inline-grid;
    min-width: 5.75rem;
    min-height: 2.75rem;
    place-items: center;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgb(251 247 242 / 35%);
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background-color 180ms ease, border-color 180ms ease;
  }

  .theme-toggle:hover {
    border-color: var(--color-white);
    background: rgb(251 247 242 / 12%);
  }

  .theme-toggle span:not([hidden]) {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
  }

  .theme-toggle__icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
  }

  .theme-toggle[hidden],
  .theme-toggle span[hidden] {
    display: none;
  }

  .site-header li::marker,
  .service-list li::marker,
  .process-grid li::marker {
    content: "";
  }

  .wordmark {
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 1.4rem + 1vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1;
    text-decoration: none;
  }

  .wordmark span {
    font-style: italic;
    font-weight: 400;
  }

  .hero {
    position: relative;
    overflow: hidden;
    background:
      linear-gradient(90deg, var(--color-ivory) 0 62%, transparent 62%),
      var(--color-rose-surface);
  }

  .hero__inner {
    --switcher-threshold: 50rem;
    --switcher-space: var(--space-xl);
    padding-block: var(--space-xl);
  }

  .hero__content {
    z-index: 1;
    flex-grow: 1.25;
    max-width: 58rem;
  }

  .hero__content .cluster {
    --cluster-space: var(--space-m);
  }

  .button {
    display: inline-flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    border: 1px solid var(--color-burgundy);
    background: var(--color-burgundy);
    color: var(--color-white);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 180ms ease, color 180ms ease;
  }

  .button:hover {
    background: transparent;
    color: var(--color-accent);
  }

  .text-link {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
  }

  .text-link__arrow {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--color-accent);
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
  }

  .hero-art {
    position: relative;
    align-self: stretch;
    min-height: 24rem;
    overflow: hidden;
    background: var(--color-burgundy);
    color: var(--color-white);
    isolation: isolate;
  }

  .hero-art::before,
  .hero-art::after {
    position: absolute;
    content: "";
    border: 1px solid rgb(251 247 242 / 35%);
    border-radius: 50%;
  }

  .hero-art::before {
    width: 13rem;
    aspect-ratio: 1;
    inset: -4rem -4rem auto auto;
  }

  .hero-art::after {
    width: 7rem;
    aspect-ratio: 1;
    inset: auto auto 4rem -2rem;
  }

  .hero-art__arch {
    position: absolute;
    width: 62%;
    height: 75%;
    inset: auto 8% 0 auto;
    border: clamp(1rem, 2.8vw, 2.5rem) solid var(--color-rose);
    border-bottom: 0;
    border-radius: 50% 50% 0 0;
    opacity: 0.92;
  }

  .hero-art__orb {
    position: absolute;
    z-index: -1;
    width: 13rem;
    aspect-ratio: 1;
    inset: 24% auto auto 6%;
    border-radius: 50%;
    background: var(--color-champagne);
    mix-blend-mode: multiply;
  }

  .hero-art p {
    position: absolute;
    z-index: 2;
    inset: auto auto 11% 8%;
    font-family: var(--font-display);
    font-size: var(--step-3);
    line-height: 0.8;
  }

  .hero-art em {
    margin-inline-start: 1.4rem;
  }

  .hero__aside {
    position: absolute;
    inset: auto 0 2rem auto;
    color: var(--color-accent);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transform: rotate(-90deg) translateX(100%);
    transform-origin: right bottom;
  }

  .promise-bar {
    background: var(--color-wine);
    color: var(--color-white);
  }

  .promise-bar__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    list-style: none;
  }

  .promise-bar__list li {
    display: flex;
    min-height: 5.5rem;
    gap: var(--space-s);
    align-items: center;
    justify-content: center;
    padding: var(--space-s) var(--space-m);
    font-family: var(--font-display);
    font-size: var(--step-1);
    letter-spacing: 0.015em;
    line-height: 1.15;
    text-align: center;
  }

  .promise-bar__list li + li {
    border-inline-start: 1px solid rgb(255 255 255 / 18%);
  }

  .promise-bar__list span {
    color: var(--color-champagne);
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
  }

  .section-heading {
    --switcher-threshold: 48rem;
    justify-content: space-between;
  }

  .section-heading > :last-child {
    max-width: 35rem;
  }

  .service-list {
    border-top: 1px solid var(--color-line);
  }

  .service-card {
    --switcher-threshold: 40rem;
    --switcher-space: var(--space-l);
    min-height: 12rem;
    padding-block: var(--space-l);
    border-bottom: 1px solid var(--color-line);
    align-items: start;
  }

  .service-card__number {
    flex-grow: 0;
    color: var(--color-accent);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.1em;
  }

  .service-card > div {
    flex-grow: 3;
    max-width: 44rem;
  }

  .service-card__mark {
    flex-grow: 0;
    color: #a34f6d;
    font-family: var(--font-display);
    font-size: clamp(4rem, 2rem + 8vw, 8rem);
    font-style: italic;
    line-height: 0.65;
  }

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

  .event-grid {
    --grid-min: 19rem;
    --grid-space: 1px;
    overflow: hidden;
    border: 1px solid var(--color-primary-wash);
    background: var(--color-primary-wash);
  }

  .event-card {
    min-height: 22rem;
    padding: var(--space-m);
    background: var(--color-ivory);
  }

  .event-card:nth-child(3) {
    background: var(--color-burgundy);
    color: var(--color-white);
  }

  .event-card:nth-child(5) {
    background: var(--color-wine);
    color: var(--color-white);
  }

  .event-card__number {
    color: var(--color-accent);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.1em;
  }

  .event-card:nth-child(3) .event-card__number {
    color: var(--color-rose);
  }

  .event-card:nth-child(5) .event-card__number {
    color: var(--color-champagne);
  }

  .event-card > div {
    margin-block-start: auto;
  }

  .event-card p:last-child {
    max-width: 30rem;
  }

  .manifesto {
    background: var(--color-burgundy);
    color: var(--color-white);
  }

  .manifesto .eyebrow {
    color: var(--color-rose);
  }

  .inquiry .eyebrow {
    color: var(--color-accent);
  }

  .site-footer .eyebrow {
    color: var(--color-champagne);
  }

  .manifesto__statement {
    max-width: 70rem;
    font-family: var(--font-display);
    font-size: var(--step-4);
    line-height: 1;
    letter-spacing: -0.03em;
  }

  .manifesto__statement em {
    color: var(--color-rose);
  }

  .manifesto__detail {
    --switcher-threshold: 42rem;
    margin-inline-start: auto;
    max-width: 55rem;
    color: rgb(255 255 255 / 78%);
  }

  .process-grid {
    --grid-min: 14rem;
    --grid-space: 0;
    border-block: 1px solid var(--color-line);
  }

  .process-grid li {
    min-height: 18rem;
    padding: var(--space-m);
    border-inline-start: 1px solid var(--color-line);
  }

  .process-grid li:last-child {
    border-inline-end: 1px solid var(--color-line);
  }

  .process-grid span {
    color: var(--color-accent);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.1em;
  }

  .process-grid h3 {
    margin-block-start: auto;
  }

  .process-grid p {
    color: var(--color-muted);
    font-size: var(--step--1);
  }

  .answers {
    background: var(--color-ivory);
  }

  .answer-list {
    margin: 0;
    border-top: 1px solid var(--color-line);
  }

  .answer {
    --switcher-threshold: 46rem;
    padding-block: var(--space-l);
    border-bottom: 1px solid var(--color-line);
    align-items: start;
  }

  .answer dt {
    color: var(--color-accent);
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 500;
    line-height: 1.05;
  }

  .answer dd {
    max-width: 42rem;
  }

  .inquiry {
    position: relative;
    overflow: hidden;
    background: var(--color-rose-surface);
    text-align: center;
  }

  .inquiry::before,
  .inquiry::after {
    position: absolute;
    content: "";
    width: clamp(14rem, 28vw, 28rem);
    aspect-ratio: 1;
    border: 1px solid rgb(112 29 56 / 25%);
    border-radius: 50%;
  }

  .inquiry::before {
    inset: -35% auto auto -8%;
  }

  .inquiry::after {
    inset: auto -8% -50% auto;
  }

  .inquiry__inner {
    position: relative;
    z-index: 1;
    align-items: center;
  }

  .inquiry h2 {
    color: var(--color-accent);
    font-size: var(--step-5);
  }

  .inquiry p:not(.eyebrow) {
    max-width: 38rem;
  }

  .button--light {
    background: var(--color-ivory);
    color: var(--color-accent);
  }

  .button--light:hover {
    background: var(--color-burgundy);
    color: var(--color-white);
  }

  .site-footer {
    background: var(--color-wine);
    color: rgb(255 255 255 / 78%);
  }

  .site-footer .switcher {
    --switcher-threshold: 42rem;
    align-items: end;
  }

  .wordmark--light {
    color: var(--color-white);
  }

  .site-footer .switcher > :last-child {
    text-align: end;
  }

  .footer-email {
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: var(--step-2);
  }

  .footer-meta {
    padding-top: var(--space-m);
    border-top: 1px solid rgb(255 255 255 / 16%);
    font-size: var(--step--1);
  }

  .prose {
    max-width: 48rem;
    margin-inline: auto;
  }

  .prose h1,
  .error-page h1 {
    color: var(--color-accent);
  }

  .error-page {
    min-height: 70svh;
  }
}

/* Exceptions */
@layer exception {
  @media (max-width: 42rem) {
    .site-header > .cluster {
      justify-content: center;
    }

    .site-header nav {
      width: 100%;
      overflow-x: auto;
    }

    .site-header nav .cluster {
      width: max-content;
      margin-inline: auto;
    }

    .hero {
      background: var(--color-ivory);
    }

    .hero__inner {
      padding-bottom: 0;
    }

    .hero-art {
      min-height: 20rem;
    }

    .hero__aside,
    .service-card__mark {
      display: none;
    }

    .promise-bar__list {
      grid-template-columns: 1fr;
      padding-block: var(--space-xs);
    }

    .promise-bar__list li {
      min-height: 3.75rem;
      justify-content: flex-start;
      padding-block: var(--space-xs);
      text-align: start;
    }

    .promise-bar__list li + li {
      border-block-start: 1px solid rgb(255 255 255 / 18%);
      border-inline-start: 0;
    }

    .service-card {
      min-height: auto;
    }

    .process-grid li {
      min-height: 15rem;
    }

    .site-footer .switcher > :last-child {
      text-align: start;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
  }
}
