@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("/fonts/fraunces.woff2") format("woff2");
}

@font-face {
  font-family: Karla;
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/karla.woff2") format("woff2");
}

@font-face {
  font-family: Karla;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/karla-italic.woff2") format("woff2");
}

@layer reset, tokens, base, layout, components, cms, motion;

@layer tokens {
  :root {
    --bg: oklch(0.17 0.018 145);
    --bg-raised: oklch(0.21 0.02 145);
    --fg: oklch(0.93 0.018 95);
    --fg-muted: oklch(0.72 0.022 120);
    --fg-subtle: oklch(0.58 0.02 130);
    --accent: oklch(0.78 0.045 120);
    --border: color-mix(in oklab, var(--fg) 14%, transparent);
    --scrim: oklch(0.14 0.02 145 / 0.72);

    --font-display: Fraunces, "Palatino Linotype", Palatino, serif;
    --font-body: Karla, "Segoe UI", system-ui, sans-serif;

    --text-xs: 0.75rem;
    --text-sm: clamp(0.9rem, 0.86rem + 0.2vw, 0.975rem);
    --text-base: clamp(1.05rem, 1rem + 0.3vw, 1.125rem);
    --text-lg: clamp(1.2rem, 1.05rem + 0.6vw, 1.4rem);
    --text-xl: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem);
    --text-2xl: clamp(2.4rem, 1.4rem + 3.4vw, 4.4rem);

    --leading-tight: 1.12;
    --leading-snug: 1.28;
    --leading-body: 1.62;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 5rem;

    --gutter: clamp(1.25rem, 4vw, 3rem);
    --wrap: 72rem;
    --measure: 38rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --motion-quick: 150ms;
    --motion-fast: 250ms;
  }
}

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

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    color-scheme: dark;
  }

  body {
    margin: 0;
    min-height: 100svh;
  }

  img, svg { display: block; max-width: 100%; height: auto; }
  img { object-fit: cover; }
  iframe { border: 0; max-width: 100%; }

  button, input, textarea { font: inherit; color: inherit; }
  button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }

  a { color: inherit; }

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

  address { font-style: normal; }
  cite { font-style: normal; }
}

@layer base {
  html {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body, .page {
    background: var(--bg);
    color: var(--fg);
  }

  h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 300;
    line-height: var(--leading-tight);
    letter-spacing: -0.03em;
    text-wrap: balance;
  }

  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  h3 { font-size: var(--text-lg); font-weight: 500; letter-spacing: -0.02em; }

  p { text-wrap: pretty; }

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

  ::selection {
    background: color-mix(in oklab, var(--accent) 35%, var(--bg));
    color: var(--fg);
  }
}

@layer layout {
  .wrap {
    width: min(var(--wrap), calc(100% - 2 * var(--gutter)));
    margin-inline: auto;
  }

  .section {
    padding-block: clamp(4rem, 10vw, 7.5rem);
    scroll-margin-top: 4.75rem;
  }

  .section-head {
    max-width: 28rem;
    margin-bottom: var(--space-7);

    p {
      margin-top: var(--space-4);
      color: var(--fg-muted);
    }
  }

  .skip {
    position: absolute;
    left: var(--gutter);
    top: 0;
    transform: translateY(-120%);
    z-index: 40;
    padding: 0.6rem 0.9rem;
    background: var(--fg);
    color: var(--bg);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 600;

    &:focus { transform: none; }
  }
}

@layer components {
  .site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: 0.9rem var(--gutter);
    color: var(--fg);
    text-shadow: 0 1px 14px oklch(0.08 0.02 145 / 0.85);
    background: linear-gradient(
      to bottom,
      oklch(0.08 0.02 145 / 0.78) 0%,
      oklch(0.08 0.02 145 / 0.42) 55%,
      oklch(0.08 0.02 145 / 0) 100%
    );
    transition: background-color var(--motion-fast) var(--ease),
      box-shadow var(--motion-fast) var(--ease);

    &.is-scrolled {
      text-shadow: none;
      background: oklch(0.16 0.02 145 / 0.94);
      box-shadow: 0 1px 0 var(--border);
    }
  }

  .wordmark {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    text-decoration: none;
    line-height: 1;
  }

  .site-nav {
    display: none;
    margin-left: auto;
    gap: var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;

    a {
      text-decoration: none;
      color: var(--fg);
      transition: color var(--motion-quick) var(--ease);

      &:hover { color: var(--accent); }
    }

    @media (min-width: 800px) {
      display: flex;
    }
  }

  .nav-toggle {
    margin-left: auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--fg);

    span, span::before, span::after {
      display: block;
      width: 18px;
      height: 1.5px;
      background: currentColor;
      position: relative;
      transition: transform var(--motion-fast) var(--ease), opacity var(--motion-quick) linear;
    }

    span::before, span::after {
      content: "";
      position: absolute;
      left: 0;
    }
    span::before { top: -6px; }
    span::after { top: 6px; }

    @media (min-width: 800px) { display: none; }
  }

  body.is-nav-open {
    @media (max-width: 799px) {
      .nav-toggle span { background: transparent; }
      .nav-toggle span::before { top: 0; transform: rotate(45deg); }
      .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

      .site-nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        inset: 100% var(--gutter) auto;
        padding: var(--space-5);
        background: var(--bg-raised);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);

        a { font-size: 1.05rem; color: var(--fg); padding: 0.55rem 0; }
      }

      .btn-small { display: none; }
    }
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1.15rem;
    background: var(--fg);
    color: var(--bg);
    text-decoration: none;
    text-shadow: none;
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 999px;
    width: fit-content;
    transition: scale var(--motion-quick) var(--ease),
      background-color var(--motion-quick) var(--ease);

    &:hover { background: var(--accent); }
    &:active { scale: 0.96; }
  }

  .btn-small {
    min-height: 40px;
    padding: 0.45rem 0.95rem;
    margin-left: 0;

    @media (min-width: 800px) { margin-left: 0; }
    @media (max-width: 799px) { display: none; }
  }

  .hero {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    display: grid;
    align-items: end;
    background-size: cover;
    background-position: center;
    color: var(--fg);

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background:
        linear-gradient(
          to top,
          oklch(0.12 0.02 145 / 0.9) 0%,
          oklch(0.12 0.02 145 / 0.35) 42%,
          oklch(0.08 0.02 145 / 0.62) 100%
        );
    }
  }

  .hero-inner {
    position: relative;
    z-index: 1;
    padding-block: 8rem 4.5rem;
    display: grid;
    gap: var(--space-5);
    max-width: 42rem;
    margin-inline: auto  auto;
    width: min(var(--wrap), calc(100% - 2 * var(--gutter)));
    justify-self: start;
  }

  .kicker {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg);
  }

  .hero h1 { max-width: 14ch; }
  .hero-inner > p:not(.kicker) {
    max-width: 34ch;
    color: color-mix(in oklab, var(--fg) 86%, transparent);
    font-size: var(--text-lg);
    line-height: var(--leading-snug);
  }

  .about-section {
    display: grid;
    gap: var(--space-6);

    @media (min-width: 880px) {
      grid-template-columns: 1fr 1fr;
      gap: var(--space-8);
      align-items: start;
    }
  }

  .about-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-md);

    @media (min-width: 880px) { aspect-ratio: 3 / 4; }
  }

  .about-copy, .prose {
    display: grid;
    gap: 1.05em;
    max-width: var(--measure);

    :where(h2, h3) { margin-top: 0.4em; }
    :where(p) { color: var(--fg-muted); }
    :where(small) {
      color: var(--fg-subtle);
      font-size: 0.88em;
    }
  }

  .rooms {
    display: grid;
    gap: var(--space-6);

    @media (min-width: 800px) {
      grid-template-columns: repeat(3, 1fr);
      gap: var(--space-5);
    }
  }

  .room {
    display: grid;
    align-content: start;
    gap: var(--space-4);

    img {
      width: 100%;
      aspect-ratio: 5 / 4;
      border-radius: var(--radius-md);
    }

    h3 { font-size: 1.35rem; }
    p { color: var(--fg-muted); font-size: var(--text-sm); }
  }

  .gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    list-style: none;
    padding: 0;

    @media (min-width: 800px) {
      grid-template-columns: repeat(3, 1fr);
      gap: 0.55rem;
    }

    a {
      display: block;
      overflow: clip;
      border-radius: var(--radius-sm);
    }

    img {
      width: 100%;
      aspect-ratio: 1;
      transition: scale var(--motion-fast) var(--ease);
    }

    a:hover img { scale: 1.03; }
  }

  .gallery-section .section-head { margin-bottom: var(--space-6); }

  .prose {
    figure.image {
      margin-block: var(--space-5);
      max-width: none;

      img {
        width: 100%;
        aspect-ratio: 16 / 10;
        border-radius: var(--radius-md);
      }
    }

    figcaption {
      margin-top: var(--space-3);
      color: var(--fg-subtle);
      font-size: var(--text-sm);
    }

    blockquote {
      padding: var(--space-5) 0 var(--space-5) var(--space-5);
      border-left: 2px solid var(--accent);
      font-family: var(--font-display);
      font-size: var(--text-lg);
      font-weight: 300;
      line-height: var(--leading-snug);
      color: var(--fg);
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: var(--text-sm);
      margin-block: var(--space-3);
    }

    th, td {
      text-align: left;
      vertical-align: top;
      padding: 0.85rem 0.6rem 0.85rem 0;
      border-bottom: 1px solid var(--border);
    }

    th {
      color: var(--fg-subtle);
      font-weight: 600;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      font-size: var(--text-xs);
    }

    td { color: var(--fg-muted); }
    td:first-child {
      color: var(--fg);
      font-weight: 600;
      white-space: nowrap;
      padding-right: var(--space-5);
    }

    hr {
      border: 0;
      height: 1px;
      background: var(--border);
      margin-block: var(--space-4);
    }
  }

  .notes {
    display: grid;
    gap: var(--space-5);

    @media (min-width: 800px) {
      grid-template-columns: repeat(3, 1fr);
      gap: var(--space-5);
    }
  }

  .note {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: grid;
    gap: var(--space-5);

    p {
      font-family: var(--font-display);
      font-size: 1.15rem;
      font-weight: 300;
      line-height: var(--leading-snug);
      color: var(--fg);
    }

    footer {
      color: var(--fg-subtle);
      font-size: var(--text-sm);
      font-weight: 500;
    }
  }

  .visit-section {
    display: grid;
    gap: var(--space-7);

    @media (min-width: 880px) {
      grid-template-columns: 1fr 0.8fr;
      gap: var(--space-8);
      align-items: start;
    }
  }

  .visit-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: grid;
    gap: var(--space-5);

    h3 { font-size: 1.15rem; }

    address, p {
      color: var(--fg-muted);
      font-size: var(--text-sm);
      line-height: 1.7;
    }
  }

  .site-footer {
    padding: var(--space-7) 0 var(--space-6);
    border-top: 1px solid var(--border);
    color: var(--fg-subtle);
    font-size: var(--text-sm);
  }

  .footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: baseline;

    .wordmark { color: var(--fg); font-size: 1.15rem; }
  }

  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    gap: var(--space-4);
    padding: var(--gutter);
    background: oklch(0.12 0.02 145 / 0.92);
    align-content: center;

    &[hidden] { display: none; }

    img {
      max-height: min(78svh, 900px);
      max-width: min(100%, 1100px);
      width: auto;
      height: auto;
      border-radius: var(--radius-sm);
    }
  }

  .lightbox-caption {
    color: var(--fg-muted);
    font-size: var(--text-sm);
    text-align: center;
  }

  .lightbox-close {
    position: absolute;
    top: var(--gutter);
    right: var(--gutter);
    min-height: 44px;
    color: var(--fg);
    font-size: var(--text-sm);
    font-weight: 600;
  }
}

@layer cms {
  /* Markup the visual editor may emit */
  .align-left {
    float: left;
    margin: 0.3em 1.25em 0.8em 0;
    max-width: 46%;
  }
  .align-right {
    float: right;
    margin: 0.3em 0 0.8em 1.25em;
    max-width: 46%;
  }
  .align-center {
    display: block;
    margin-inline: auto;
  }

  figure.image img { width: 100%; }

  .cms-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.5rem;
  }

  .cms-code, pre {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--bg-raised);
    padding: var(--space-4);
    overflow: auto;
    border-radius: var(--radius-sm);
  }

  mark {
    background: color-mix(in oklab, var(--accent) 28%, transparent);
    color: inherit;
  }

  .is-cms .nav-toggle { display: none; }
}

@layer motion {
  @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;
    }
  }

  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .about-section,
      .rooms,
      .gallery,
      .prose,
      .notes,
      .visit-section {
        animation: rise linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 28%;
      }
    }
  }

  @keyframes rise {
    from {
      opacity: 0.35;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (max-width: 799px) {
  .site-header .btn-small { display: none; }
  .hero-inner { padding-block: 7rem 3.25rem; }
}
