/* ==========================================================================
   Kolind Booking · base: fonts, tokens, reset, typography, layout, shell
   ========================================================================== */

@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('../assets/fonts/newsreader-italic.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../assets/fonts/hanken-grotesk.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f3ec;
  --paper-2: #efe8dc;
  --paper-3: #e7ddcd;
  --surface: #fffdf9;
  --ink: #1d1a16;
  --ink-2: #463f37;
  --muted: #7a7064;
  --faint: #a89d8f;
  --line: #e6ddcf;
  --line-2: #d6c9b6;

  --mallorca: #b2583a;
  --mallorca-2: #8f4127;
  --mallorca-soft: #f4e2d6;
  --mallorca-tint: #fbf2ec;
  --odde: #3e5a4a;
  --odde-2: #2b4235;
  --odde-soft: #dce6de;
  --odde-tint: #eff4f0;

  --ok: #3f6b50;
  --ok-soft: #e1ede4;
  --pending: #a8781c;
  --pending-soft: #f6ead0;
  --danger: #a23a2c;
  --danger-soft: #f6e1dc;

  --accent: var(--ink);
  --accent-2: #000;
  --accent-soft: var(--paper-2);
  --accent-tint: var(--paper);
  --on-accent: #fffdf9;

  --radius-xs: 8px;
  --radius-s: 12px;
  --radius: 18px;
  --radius-l: 26px;
  --radius-xl: 34px;

  --shadow-1: 0 1px 2px rgb(29 26 22 / 0.05), 0 2px 10px rgb(29 26 22 / 0.04);
  --shadow-2: 0 2px 6px rgb(29 26 22 / 0.05), 0 14px 36px rgb(29 26 22 / 0.09);
  --shadow-3: 0 30px 80px rgb(29 26 22 / 0.22), 0 4px 14px rgb(29 26 22 / 0.08);

  --font-display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: clamp(18px, 4vw, 40px);
  --max: 1200px;
  --header-h: 68px;
  --tabbar-h: calc(64px + env(safe-area-inset-bottom));
  color-scheme: light;
}

[data-theme='mallorca'] {
  --accent: var(--mallorca);
  --accent-2: var(--mallorca-2);
  --accent-soft: var(--mallorca-soft);
  --accent-tint: var(--mallorca-tint);
}
[data-theme='odde'] {
  --accent: var(--odde);
  --accent-2: var(--odde-2);
  --accent-soft: var(--odde-soft);
  --accent-tint: var(--odde-tint);
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--mallorca-soft);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  font-optical-sizing: auto;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 12px;
}

/* ---------- Typography helpers ---------- */

.display {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 6.4vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.028em;
  font-weight: 380;
}
.display em,
.h1 em,
.h2 em {
  font-style: italic;
  font-weight: 360;
}
.h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  letter-spacing: -0.022em;
}
.h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}
.h3 {
  font-size: 1.55rem;
}
.h4 {
  font-size: 1.2rem;
  letter-spacing: -0.005em;
}
.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 34em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.tiny {
  font-size: 0.78rem;
}
.num {
  font-variant-numeric: tabular-nums;
}
.prose p + p {
  margin-top: 0.9em;
}
.prose {
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 40em;
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  max-width: calc(760px + var(--gutter) * 2);
}
.section {
  padding-block: clamp(48px, 7vw, 96px);
}
.section-tight {
  padding-block: clamp(28px, 4vw, 48px);
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(20px, 3vw, 32px);
  flex-wrap: wrap;
}
.section-head .eyebrow {
  margin-bottom: 10px;
}
.stack > * + * {
  margin-top: var(--stack, 16px);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--gap, 12px);
}
.row-wrap {
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}

.view {
  min-height: calc(100dvh - var(--header-h));
  outline: none;
  /* backwards (not both): a retained transform would make main the containing
     block for position: fixed children like the selection bar. */
  animation: view-in 0.45s var(--ease-out) backwards;
}
.view.no-anim {
  animation: none;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page {
  padding-top: calc(var(--header-h) + clamp(20px, 4vw, 44px));
  padding-bottom: clamp(56px, 8vw, 110px);
}
.page-head {
  margin-bottom: clamp(24px, 4vw, 40px);
}
.page-head .eyebrow {
  margin-bottom: 12px;
}
.page-head .lede {
  margin-top: 14px;
}

/* The loading screen's styles live inline in index.html, so it never renders
   unstyled while a new CSS file is still on its way. */

.noscript {
  padding: 40px;
  text-align: center;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease), color 0.3s var(--ease);
  color: var(--ink);
}
.site-header.is-solid,
.site-header.is-scrolled {
  background: rgb(247 243 236 / 0.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.site-header.is-over-hero:not(.is-scrolled) {
  color: #fff;
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.wordmark .amp {
  font-style: italic;
  color: var(--mallorca);
  transition: color 0.3s var(--ease);
}
.is-over-hero:not(.is-scrolled) .wordmark .amp {
  color: #f6d7c5;
}
.main-nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.main-nav a {
  position: relative;
  text-decoration: none;
  font-weight: 550;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background-color 0.2s var(--ease), opacity 0.2s var(--ease);
  opacity: 0.82;
}
.main-nav a:hover {
  opacity: 1;
  background: rgb(29 26 22 / 0.05);
}
.is-over-hero:not(.is-scrolled) .main-nav a:hover {
  background: rgb(255 255 255 / 0.14);
}
.main-nav a[aria-current='page'] {
  opacity: 1;
}
.main-nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
}
.nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--mallorca);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: 1px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.main-nav + .header-actions {
  margin-left: auto;
}
.avatar-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.avatar-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.is-over-hero:not(.is-scrolled) .avatar-btn {
  background: rgb(255 255 255 / 0.16);
  border-color: rgb(255 255 255 / 0.4);
  color: #fff;
  backdrop-filter: blur(8px);
}

@media (min-width: 900px) {
  .main-nav {
    display: flex;
  }
  .main-nav + .header-actions {
    margin-left: 12px;
  }
}

/* ---------- Mobile tab bar ---------- */

.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgb(255 253 249 / 0.92);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar[hidden] {
  display: none;
}
.tabbar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.tabbar a svg {
  width: 23px;
  height: 23px;
  transition: transform 0.25s var(--ease-out);
}
.tabbar a[aria-current='page'] {
  color: var(--ink);
}
.tabbar a[aria-current='page'] svg {
  transform: translateY(-1px);
}
.tabbar a:active svg {
  transform: scale(0.9);
}
.tabbar .nav-badge {
  position: absolute;
  top: 8px;
  left: calc(50% + 6px);
  margin: 0;
  min-width: 18px;
  height: 18px;
  font-size: 0.66rem;
}
body.has-tabbar {
  padding-bottom: var(--tabbar-h);
}
@media (min-width: 900px) {
  .tabbar {
    display: none !important;
  }
  body.has-tabbar {
    padding-bottom: 0;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 40px 48px;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .row {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 28px;
}
.site-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer a {
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
