/* ==========================================================================
   components.css - buttons, headings, eyebrow, media slots, link arrows, theme switch, cookie banner + consent manager.
   BEM, low specificity; hover effects only under (hover: hover) and (pointer: fine); press feedback scale(.97); only transform / opacity move.
   ========================================================================== */

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: transparent;
  --btn-ink: var(--color-ink);
  --btn-border: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 16px 22px 16px 28px;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--font-body);
  font-size: var(--fs-ui);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.btn:active { transform: scale(0.97); }
.btn__icon { width: 20px; height: 20px; transition: transform var(--dur-ui) var(--ease-out); }
.btn--dark { --btn-bg: var(--btn-dark-bg); --btn-ink: var(--btn-dark-ink); min-height: 52px; }
.btn--sun { --btn-bg: var(--palette-sun); --btn-ink: var(--palette-navy); }
.btn--outline { --btn-border: var(--btn-outline); --btn-ink: var(--btn-outline); min-height: 55px; }
.btn--outline-light { --btn-border: var(--palette-white); --btn-ink: var(--palette-white); min-height: 55px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn__icon { transform: translateX(4px); }
  .btn--dark:hover { --btn-bg: var(--palette-petrol); --btn-ink: var(--palette-white); }
  .btn--sun:hover { --btn-bg: var(--palette-sun-soft); }
  .btn--outline:hover { --btn-bg: var(--btn-outline); --btn-ink: var(--color-bg); }
  .btn--outline-light:hover { --btn-bg: var(--palette-white); --btn-ink: var(--palette-navy); }
}
.btn:focus-visible { outline-offset: 4px; border-radius: var(--radius-pill); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--btn-outline);
  border-radius: 50%;
  color: var(--btn-outline);
  font-size: 22px;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.icon-btn:active { transform: scale(0.94); }
@media (min-width: 1024px) { .icon-btn { width: 56px; height: 56px; } }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--btn-outline); color: var(--color-bg); } }
.icon-btn:focus-visible { border-radius: 50%; }

/* ---------------------------------------------------------------- headings */
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  color: var(--color-ink);
}
.display--on-band { color: var(--color-on-band); }
.hl-line { display: block; }
.hl {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 300;
  font-size: 1.04em;
  letter-spacing: -0.03em;
  color: var(--color-accent);
}
.display--on-band .hl { color: var(--palette-sun); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
}
.eyebrow__rule { display: block; flex: none; width: 24px; height: 2px; background: currentColor; }
@media (min-width: 768px) { .eyebrow { gap: 12px; } .eyebrow__rule { width: 36px; } }
.eyebrow--light { color: var(--color-on-band-accent); }
.eyebrow--ink { color: var(--palette-navy); }

/* ---------------------------------------------------------------- media slots (BUILD-CONTRACT 5.5) */
.media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--media-radius, var(--radius-xl));
  background: var(--media-bg, linear-gradient(135deg, var(--palette-turquoise), var(--palette-petrol) 50%, var(--palette-navy)));
  /* a gradient edge clipped by overflow + radius can leave a hairline in some engines */
  transform: translateZ(0);
}
.media--tone-1 { --media-bg: linear-gradient(135deg, var(--palette-sun), var(--palette-orange)); }
.media--tone-2 { --media-bg: linear-gradient(135deg, var(--palette-orange), var(--palette-navy)); }
.media--tone-3 { --media-bg: linear-gradient(135deg, var(--palette-turquoise), var(--palette-petrol)); }
.media--tone-4 { --media-bg: linear-gradient(135deg, var(--palette-sun), var(--palette-orange)); }
.media--tone-5 { --media-bg: linear-gradient(135deg, var(--palette-sun), var(--palette-orange) 50%, var(--palette-petrol)); }
.media--tone-6 { --media-bg: linear-gradient(135deg, var(--palette-orange), var(--palette-sun)); }
.media--tone-7 { --media-bg: linear-gradient(135deg, var(--palette-navy), var(--palette-petrol)); }
.media--tone-8 { --media-bg: linear-gradient(135deg, var(--palette-sun), var(--palette-turquoise)); }
.media--tone-9 { --media-bg: linear-gradient(135deg, var(--palette-petrol), var(--palette-orange)); }
.media__img,
.media__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media__video { background: var(--palette-navy); }

.media__tag {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 40px);
  padding: 10px 16px 10px 14px;
  border: 1px solid var(--white-60);
  border-radius: var(--radius-pill);
  background: var(--media-tag-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--palette-white);
  font-size: var(--fs-micro);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.media__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--palette-sun); }
.media__tag-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media__play,
.media__toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1;
  width: 56px;
  height: 56px;
  color: var(--palette-white);
  font-size: 56px;
}
.media__play .icon,
.media__toggle .icon { width: 56px; height: 56px; }
.media__toggle { border-radius: 50%; transition: transform var(--dur-press) var(--ease-out), opacity var(--dur-fast) ease; }
.media__toggle:active { transform: scale(0.94); }
.media__toggle-pause { display: none; }
.media__toggle[aria-pressed="true"] .media__toggle-play { display: none; }
.media__toggle[aria-pressed="true"] .media__toggle-pause { display: block; }
/* a playing video lets the button fade away until the pointer or focus comes back */
@media (hover: hover) and (pointer: fine) {
  .media--has-video .media__toggle[aria-pressed="true"] { opacity: 0; }
  .media--has-video:hover .media__toggle[aria-pressed="true"],
  .media--has-video .media__toggle:focus-visible { opacity: 1; }
}
.media--shape-tl { --media-radius: var(--media-big, 260px) var(--radius-xl) var(--radius-xl) var(--radius-xl); }
.media--shape-tr { --media-radius: var(--radius-xl) var(--media-big, 260px) var(--radius-xl) var(--radius-xl); }
.media--shape-br { --media-radius: var(--radius-xl) var(--radius-xl) var(--media-big, 260px) var(--radius-xl); }
.media--shape-bl { --media-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) var(--media-big, 260px); }
.media--pill { --media-radius: var(--radius-pill); }

/* ---------------------------------------------------------------- text link with arrow + animated underline */
.link-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  min-height: 44px;
  align-self: flex-start;
  font-size: var(--fs-ui);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-ink);
}
.link-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 2px;
  background: currentColor;
  transform-origin: left center;
}
.link-arrow__icon { width: 16px; height: 16px; transition: transform var(--dur-ui) var(--ease-out); }
.link-arrow--sun { color: var(--palette-sun); }
@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover::after { animation: link-draw 420ms var(--ease-out); }
  .link-arrow:hover .link-arrow__icon { transform: translate(2px, -2px); }
}
@keyframes link-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------------------------------------------------------------- theme switch (Figma 51:225) */
.theme-switch {
  --h: 35px;
  --w: 67px;
  --inset: 3px;
  --knob: 29px;
  display: flex;
  align-items: center;
  flex: none;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out);
}
@media (min-width: 1024px) { .theme-switch { --h: 44px; --w: 84px; --inset: 4px; --knob: 36px; } }
.theme-switch__track {
  position: relative;
  display: block;
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  border: 1.2px solid var(--switch-line);
  border-radius: var(--radius-pill);
  background: var(--palette-cream-warm);
}
@media (min-width: 1024px) { .theme-switch__track { border-width: 1.5px; } }
.theme-switch:active { transform: scale(0.96); }
.theme-switch__half { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; align-items: center; justify-content: center; }
.theme-switch__half--day { left: 0; background: var(--palette-cream-warm); }
.theme-switch__half--night { right: 0; background: var(--palette-navy-deep); }
.theme-switch__icon { width: 15px; height: 15px; }
.theme-switch__half--night .theme-switch__icon { width: 24px; height: 24px; }
@media (min-width: 1024px) { .theme-switch__icon { width: 18px; height: 18px; } .theme-switch__half--night .theme-switch__icon { width: 30px; height: 30px; } }
.theme-switch__half--day .theme-switch__icon { color: var(--palette-orange); opacity: 0.8; }
.theme-switch__spark { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: var(--palette-white); opacity: 0.8; }
.theme-switch__spark--1 { left: 22%; top: 18%; }
.theme-switch__spark--2 { right: 12%; top: 24%; width: 1px; height: 1px; opacity: 0.7; }
.theme-switch__spark--3 { right: 20%; bottom: 20%; }
.theme-switch__spark--4 { left: 14%; bottom: 18%; width: 1px; height: 1px; opacity: 0.6; }
.theme-switch__knob {
  position: absolute;
  top: 50%;
  left: var(--inset);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--knob);
  height: var(--knob);
  margin-top: calc(var(--knob) / -2);
  border-radius: 50%;
  color: var(--palette-white);
  transition: transform var(--dur-ui) var(--ease-out);
}
.theme-switch__knob::before,
.theme-switch__knob::after { content: ""; position: absolute; inset: 0; border-radius: 50%; transition: opacity var(--dur-ui) ease; }
.theme-switch__knob::before { background: linear-gradient(135deg, var(--knob-day-from), var(--palette-orange)); box-shadow: 0 2px 10px var(--knob-day-glow); }
.theme-switch__knob::after { background: var(--palette-night-knob); box-shadow: 0 0 10px var(--knob-night-glow); opacity: 0; }
.theme-switch__glyph { position: relative; z-index: 1; width: 55%; height: 55%; transition: opacity var(--dur-ui) ease, transform var(--dur-ui) var(--ease-out); }
.theme-switch__glyph--star { position: absolute; width: 88%; height: 88%; opacity: 0; transform: rotate(-60deg) scale(0.6); }
.theme-switch[aria-checked="true"] .theme-switch__knob { transform: translateX(calc(var(--w) - var(--knob) - 2 * var(--inset) - 2.4px)); }
.theme-switch[aria-checked="true"] .theme-switch__knob::before { opacity: 0; }
.theme-switch[aria-checked="true"] .theme-switch__knob::after { opacity: 1; }
.theme-switch[aria-checked="true"] .theme-switch__glyph--sun { opacity: 0; transform: rotate(60deg) scale(0.6); }
.theme-switch[aria-checked="true"] .theme-switch__glyph--star { opacity: 1; transform: none; }
.theme-switch:focus-visible { border-radius: var(--radius-pill); outline-offset: 2px; }

/* ---------------------------------------------------------------- cookie banner (Figma 10:317 / 61:453) */
.consent { position: fixed; inset: 0; z-index: var(--z-consent); pointer-events: none; }
.consent__scrim { display: none; }
.consent__card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 24px calc(34px + env(safe-area-inset-bottom));
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  animation: consent-in 360ms var(--ease-drawer) 400ms backwards;
}
.consent__grab { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--color-ink); opacity: 0.9; }
.consent__title { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; color: var(--color-ink); }
.consent__text { font-size: var(--fs-small); line-height: 1.55; color: var(--color-ink-soft); }
.consent__text a { color: var(--color-accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.consent__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.consent__actions .btn { width: 100%; }
.consent__manage {
  align-self: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--color-accent);
  text-underline-offset: 4px;
}
@media (hover: hover) and (pointer: fine) { .consent__manage:hover { text-decoration: underline; } }
@media (max-width: 767px) {
  .consent__scrim { display: block; position: absolute; inset: 0; background: var(--scrim); pointer-events: none; animation: consent-fade 300ms ease 400ms backwards; }
}
@media (min-width: 768px) {
  .consent__card {
    left: 24px;
    right: auto;
    bottom: 24px;
    width: min(480px, calc(100vw - 48px));
    gap: 20px;
    padding: 28px;
    border-radius: var(--radius-l);
  }
  .consent__grab { display: none; }
  .consent__actions { flex-direction: row; flex-wrap: wrap; gap: 10px; margin-top: 0; }
  .consent__actions .btn { width: auto; }
  .consent__manage { align-self: flex-start; padding: 0; min-height: 28px; }
}
@keyframes consent-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes consent-fade { from { opacity: 0; } to { opacity: 1; } }
html.consent-set .consent { display: none; }

/* consent manager (native <dialog>: focus trap + Esc come with it) */
.consent-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-l);
  background: var(--card-bg);
  color: var(--color-ink-soft);
  box-shadow: var(--shadow-card);
  overflow: auto;
}
.consent-dialog::backdrop { background: var(--scrim); }
.consent-dialog[open] { animation: consent-pop 260ms var(--ease-out); }
@keyframes consent-pop { from { opacity: 0; transform: scale(0.97) translateY(8px); } to { opacity: 1; transform: none; } }
.consent-dialog__form { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
@media (min-width: 768px) { .consent-dialog__form { padding: 32px; } }
.consent-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.consent-dialog__title { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; color: var(--color-ink); }
.consent-dialog__close { width: 44px; height: 44px; }
.consent-dialog__intro { font-size: var(--fs-small); line-height: 1.55; }
.consent-dialog__list { display: grid; gap: 0; border-top: 1px solid var(--color-line-soft); }
.consent-dialog__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--color-line-soft); }
.consent-dialog__copy h3 { font-size: 17px; font-weight: 600; color: var(--color-ink); }
.consent-dialog__copy p { margin-top: 4px; font-size: 14px; line-height: 1.5; }
.consent-dialog__always { flex: none; font-size: 13px; font-weight: 600; color: var(--color-accent); }
.consent-dialog__actions { display: flex; flex-direction: column; gap: 10px; }
.consent-dialog__actions .btn { width: 100%; }
@media (min-width: 480px) { .consent-dialog__actions { flex-direction: row; } .consent-dialog__actions .btn { width: auto; } }

.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  border: 1.5px solid var(--btn-outline);
  border-radius: var(--radius-pill);
  background: transparent;
  transition: background-color var(--dur-fast) ease;
}
.switch::before { content: ""; position: absolute; inset: -9px -2px; }    /* 48 px tap target */
.switch__knob {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 21px;
  height: 21px;
  margin-top: -10.5px;
  border-radius: 50%;
  background: var(--btn-outline);
  transition: transform var(--dur-ui) var(--ease-out), background-color var(--dur-fast) ease;
}
.switch[aria-checked="true"] { background: var(--palette-petrol); border-color: var(--palette-petrol); }
.switch[aria-checked="true"] .switch__knob { transform: translateX(22px); background: var(--palette-white); }
