/* ==========================================================================
   CLOCKHOUSE — landing page styles
   Layered on top of Tailwind. Only what utilities cannot express cleanly:
   typography ramps, hairline rules, reveal choreography, tactile surfaces.
   ========================================================================== */

:root {
  --slate: #425252;
  --slate-deep: #364444;
  --teal: #667677;
  --leather: #514433;
  --sand: #a1957d;
  --sage: #a8d4ad;
  --ink: #22292a;
  --bone: #f2efe9;
  --ease-silk: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Base element styling belongs in Tailwind's `base` layer.
   Declared outside it, a bare `body { color }` has the same specificity as a
   `.text-*` utility — and because this sheet loads after the CDN injects its
   utilities, it would win and silently defeat every opacity-modified colour
   utility (text-bone/78, text-ink/72, bg-sand/20 …). */
@layer base {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 7.5rem;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    /* background and text colour come from the bg-paper / text-ink utilities
       on <body>, so they are deliberately not set here. */
    font-family: Jost, system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: var(--sage);
  color: var(--slate-deep);
}

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

.font-display {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

.display-xl {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.015em;
  font-size: clamp(2.75rem, 7.4vw, 6.5rem);
}

.display-lg {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.01em;
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
}

.display-md {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  line-height: 1.12;
  font-size: clamp(1.6rem, 2.6vw, 2.35rem);
}

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.lede {
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.85;
  font-weight: 300;
}

.body-copy {
  line-height: 1.95;
  font-weight: 300;
  font-size: 0.9375rem;
}

.ital {
  font-style: italic;
  font-weight: 300;
}

/* Hairline rules built from palette tokens */
.rule {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, var(--sand) 0%, rgba(161, 149, 125, 0) 100%);
}

.rule-center {
  height: 1px;
  width: 4.5rem;
  background: var(--sand);
}

/* --------------------------------------------------------------------------
   Tactile leather surface — grain woven from palette tones.
   Used behind dark editorial blocks so imagery is never required to carry
   the "material" feeling.
   -------------------------------------------------------------------------- */

.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.nav-link {
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s var(--ease-silk);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current='true']::after {
  transform: scaleX(1);
}

/* Header transitions between hero (transparent) and scrolled (solid) states */
.site-header {
  transition:
    background-color 0.6s var(--ease-silk),
    border-color 0.6s var(--ease-silk),
    backdrop-filter 0.6s var(--ease-silk),
    padding 0.6s var(--ease-silk);
}

.site-header[data-state='top'] {
  background-color: transparent;
  border-bottom-color: transparent;
}

.site-header[data-state='scrolled'] {
  background-color: rgba(54, 68, 68, 0.9);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: rgba(161, 149, 125, 0.22);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  overflow: hidden;
  isolation: isolate;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1.05rem 2.1rem;
  transition:
    color 0.5s var(--ease-silk),
    border-color 0.5s var(--ease-silk),
    transform 0.5s var(--ease-silk);
}

/* the wipe that reveals the hover fill */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translateY(101%);
  transition: transform 0.62s var(--ease-silk);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: translateY(0);
}

.btn:active {
  transform: translateY(1px);
}

.btn-sage {
  background: var(--sage);
  color: var(--slate-deep);
}

.btn-sage::before {
  background: var(--bone);
}

.btn-sage:hover,
.btn-sage:focus-visible {
  color: var(--slate-deep);
}

.btn-ghost {
  border: 1px solid rgba(161, 149, 125, 0.55);
  color: var(--bone);
}

.btn-ghost::before {
  background: var(--sage);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  color: var(--slate-deep);
  border-color: var(--sage);
}

.btn-outline-dark {
  border: 1px solid rgba(81, 68, 51, 0.35);
  color: var(--leather);
}

.btn-outline-dark::before {
  background: var(--leather);
}

.btn-outline-dark:hover,
.btn-outline-dark:focus-visible {
  color: var(--bone);
  border-color: var(--leather);
}

/* Arrow nudge shared by all button variants */
.btn .btn-arrow {
  transition: transform 0.55s var(--ease-silk);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Editorial media frames — slow zoom on hover, veil + caption on top
   -------------------------------------------------------------------------- */

.frame {
  position: relative;
  overflow: hidden;
  background-color: var(--slate);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.4s var(--ease-silk), filter 1.4s var(--ease-silk);
  will-change: transform;
}

.frame-zoom:hover img,
.frame-zoom:focus-within img {
  transform: scale(1.055);
}

.frame-veil::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(54, 68, 68, 0) 38%, rgba(34, 41, 42, 0.88) 100%);
  opacity: 0;
  transition: opacity 0.7s var(--ease-silk);
  pointer-events: none;
}

.frame-veil:hover::after,
.frame-veil:focus-within::after {
  opacity: 1;
}

.frame-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem 1.6rem;
  transform: translateY(0.85rem);
  opacity: 0;
  transition:
    opacity 0.7s var(--ease-silk),
    transform 0.7s var(--ease-silk);
}

.frame-veil:hover .frame-caption,
.frame-veil:focus-within .frame-caption {
  opacity: 1;
  transform: translateY(0);
}

/* touch devices have no hover — keep captions permanently legible */
@media (hover: none) {
  .frame-veil::after {
    opacity: 1;
  }
  .frame-caption {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Product cards
   -------------------------------------------------------------------------- */

.product-card .product-media img {
  transition: transform 1.5s var(--ease-silk);
}

.product-card:hover .product-media img {
  transform: scale(1.06);
}

.product-card .product-cta {
  transform: translateY(0.5rem);
  opacity: 0;
  transition:
    opacity 0.55s var(--ease-silk),
    transform 0.55s var(--ease-silk);
}

.product-card:hover .product-cta,
.product-card:focus-within .product-cta {
  transform: translateY(0);
  opacity: 1;
}

@media (hover: none) {
  .product-card .product-cta {
    opacity: 1;
    transform: none;
  }
}

.swatch {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 9999px;
  border: 1px solid rgba(161, 149, 125, 0.5);
  box-shadow: inset 0 0 0 2px rgba(250, 248, 244, 0.9);
  transition:
    transform 0.45s var(--ease-silk),
    border-color 0.45s var(--ease-silk),
    box-shadow 0.45s var(--ease-silk);
}

.swatch:hover {
  transform: scale(1.14);
}

.swatch[aria-pressed='true'] {
  border-color: var(--slate);
  box-shadow:
    inset 0 0 0 2px rgba(250, 248, 244, 0.95),
    0 0 0 1px var(--slate);
}

/* --------------------------------------------------------------------------
   Collection rail
   -------------------------------------------------------------------------- */

.rail {
  display: flex;
  gap: 1.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.5rem;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

.rail-btn {
  width: 2.9rem;
  height: 2.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(66, 82, 82, 0.28);
  color: var(--slate);
  border-radius: 9999px;
  transition:
    background-color 0.5s var(--ease-silk),
    color 0.5s var(--ease-silk),
    border-color 0.5s var(--ease-silk);
}

.rail-btn:hover:not(:disabled) {
  background: var(--slate);
  border-color: var(--slate);
  color: var(--bone);
}

.rail-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Booking form
   -------------------------------------------------------------------------- */

.field {
  position: relative;
}

.field label {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  /* sand.soft — base sand is 2.8:1 on the slate ground; this tone clears 4.5:1 */
  color: #bab09e;
  margin-bottom: 0.6rem;
}

.field input,
.field select {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(161, 149, 125, 0.38);
  padding: 0.55rem 0 0.7rem;
  color: var(--bone);
  font-size: 0.9375rem;
  font-weight: 300;
  border-radius: 0;
  transition: border-color 0.5s var(--ease-silk);
  appearance: none;
}

.field input::placeholder {
  color: rgba(161, 149, 125, 0.5);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-bottom-color: var(--sage);
}

.field select option {
  background: var(--slate-deep);
  color: var(--bone);
}

/* Native date pickers render a dark glyph on dark glass */
.field input[type='date']::-webkit-calendar-picker-indicator {
  filter: invert(1) sepia(1) saturate(0) brightness(1.6);
  opacity: 0.65;
  cursor: pointer;
}

.field input[type='date'] {
  color-scheme: dark;
}

.field.is-invalid input,
.field.is-invalid select {
  border-bottom-color: #c98b7a;
}

.field-error {
  display: block;
  min-height: 1rem;
  margin-top: 0.4rem;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: #d8a999;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.35s var(--ease-silk), transform 0.35s var(--ease-silk);
}

.field.is-invalid .field-error {
  opacity: 1;
  transform: translateY(0);
}

/* Fitting-type segmented control */
.segment {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(161, 149, 125, 0.32);
}

.segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment label {
  margin: 0;
  padding: 0.95rem 1rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sand);
  transition:
    background-color 0.5s var(--ease-silk),
    color 0.5s var(--ease-silk);
}

.segment input:checked + label {
  background: var(--sage);
  color: var(--slate-deep);
}

.segment input:focus-visible + label {
  box-shadow: inset 0 0 0 2px var(--bone);
}

/* --------------------------------------------------------------------------
   Language switcher
   -------------------------------------------------------------------------- */

.lang-option {
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0 2px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(242, 239, 233, 0.6);
  border-bottom: 1px solid transparent;
  transition:
    color 0.45s var(--ease-silk),
    border-color 0.45s var(--ease-silk);
}

.lang-option:hover {
  color: var(--bone);
}

.lang-option[aria-pressed='true'] {
  color: var(--sage);
  border-bottom-color: var(--sage);
}

/* --------------------------------------------------------------------------
   Cyrillic typography
   Cormorant Garamond's Cyrillic runs small and tightly set next to the Latin,
   and Russian sets longer, so both scale up slightly to keep the same
   editorial rhythm.
   -------------------------------------------------------------------------- */

html[lang='ru'] .display-xl,
html[lang='ru'] .display-lg,
html[lang='ru'] .display-md {
  letter-spacing: 0;
  line-height: 1.08;
}

html[lang='ru'] .display-xl {
  font-size: clamp(2.4rem, 6.4vw, 5.4rem);
}

html[lang='ru'] .display-lg {
  font-size: clamp(1.85rem, 4vw, 3.3rem);
}

html[lang='ru'] .eyebrow,
html[lang='ru'] .font-display {
  letter-spacing: 0.08em;
}

html[lang='ru'] .body-copy,
html[lang='ru'] .lede {
  line-height: 1.85;
}

/* Hungarian sets longer than English too — give headlines a touch more room */
html[lang='hu'] .display-xl {
  font-size: clamp(2.5rem, 6.8vw, 5.9rem);
}

/* --------------------------------------------------------------------------
   Scroll reveal choreography
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1s var(--ease-silk),
    transform 1s var(--ease-silk);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

[data-reveal='fade'] {
  transform: none;
}

[data-reveal='scale'] {
  transform: scale(1.015);
}

/* Hero intro — runs on load, not on scroll */
.hero-in > * {
  animation: rise 1.15s var(--ease-silk) both;
}

.hero-in > *:nth-child(1) { animation-delay: 0.15s; }
.hero-in > *:nth-child(2) { animation-delay: 0.3s; }
.hero-in > *:nth-child(3) { animation-delay: 0.45s; }
.hero-in > *:nth-child(4) { animation-delay: 0.6s; }
.hero-in > *:nth-child(5) { animation-delay: 0.75s; }

.hero-media {
  animation: veil 1.8s var(--ease-silk) both;
}

@keyframes rise {
  0% { opacity: 0; transform: translateY(26px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes veil {
  0% { opacity: 0; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

/* scroll cue */
.scroll-cue {
  width: 1px;
  height: 4.5rem;
  background: linear-gradient(180deg, rgba(242, 239, 233, 0) 0%, var(--sand) 100%);
  position: relative;
  overflow: hidden;
}

.scroll-cue::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: -40%;
  height: 40%;
  background: var(--sage);
  animation: cue 2.6s var(--ease-silk) infinite;
}

@keyframes cue {
  0% { top: -40%; }
  60%, 100% { top: 100%; }
}

/* --------------------------------------------------------------------------
   Marquee (palette ticker between sections)
   -------------------------------------------------------------------------- */

.marquee {
  display: flex;
  width: max-content;
  animation: marquee 42s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-wrap:hover .marquee {
  animation-play-state: paused;
}

/* --------------------------------------------------------------------------
   Details dialog
   -------------------------------------------------------------------------- */

dialog.detail-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(56rem, 94vw);
  width: 100%;
}

dialog.detail-dialog::backdrop {
  background: rgba(34, 41, 42, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

dialog.detail-dialog[open] {
  animation: veil 0.5s var(--ease-silk) both;
}

/* --------------------------------------------------------------------------
   Focus visibility — never remove the ring, restyle it
   -------------------------------------------------------------------------- */

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

.on-dark :focus-visible {
  outline-color: var(--sage);
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .marquee {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .rail-btn,
  .scroll-cue {
    display: none !important;
  }
}
/* --------------------------------------------------------------------------
   Explicit colour utilities
   Explicit colour utilities for the palette + opacity combinations in use.

   Tailwind's utilities are injected as an unlayered <style> *after* this sheet,
   so they normally win. The Play CDN also fails to generate some
   `colour/opacity` utilities for flat custom colours (text-bone/78 and
   text-ink/72 compiled to nothing at all), which made those elements silently
   fall back to inherited ink. These rules are generated from the palette in
   assets/js/tailwind.config.js — regenerate with tools/gen-colour-shim.py after
   changing which opacity utilities the markup uses.
   -------------------------------------------------------------------------- */

.bg-paper\/92 { background-color: rgba(250, 248, 244, 0.92) !important; }
.bg-sage\/10 { background-color: rgba(168, 212, 173, 0.1) !important; }
.bg-slate-deep\/88 { background-color: rgba(54, 68, 68, 0.88) !important; }
.bg-slate-deep\/97 { background-color: rgba(54, 68, 68, 0.97) !important; }
.border-sage\/50 { border-color: rgba(168, 212, 173, 0.5) !important; }
.border-sand\/12 { border-color: rgba(161, 149, 125, 0.12) !important; }
.border-sand\/15 { border-color: rgba(161, 149, 125, 0.15) !important; }
.border-sand\/20 { border-color: rgba(161, 149, 125, 0.2) !important; }
.border-sand\/22 { border-color: rgba(161, 149, 125, 0.22) !important; }
.border-sand\/25 { border-color: rgba(161, 149, 125, 0.25) !important; }
.border-sand\/30 { border-color: rgba(161, 149, 125, 0.3) !important; }
.border-sand\/35 { border-color: rgba(161, 149, 125, 0.35) !important; }
.border-sand\/40 { border-color: rgba(161, 149, 125, 0.4) !important; }
.border-sand\/60 { border-color: rgba(161, 149, 125, 0.6) !important; }
.from-slate-deep\/85 { --tw-gradient-from: rgba(54, 68, 68, 0.85) !important; }
.text-bone\/45 { color: rgba(242, 239, 233, 0.45) !important; }
.text-bone\/55 { color: rgba(242, 239, 233, 0.55) !important; }
.text-bone\/65 { color: rgba(242, 239, 233, 0.65) !important; }
.text-bone\/70 { color: rgba(242, 239, 233, 0.7) !important; }
.text-bone\/72 { color: rgba(242, 239, 233, 0.72) !important; }
.text-bone\/78 { color: rgba(242, 239, 233, 0.78) !important; }
.text-bone\/80 { color: rgba(242, 239, 233, 0.8) !important; }
.text-bone\/85 { color: rgba(242, 239, 233, 0.85) !important; }
.text-bone\/90 { color: rgba(242, 239, 233, 0.9) !important; }
.text-ink\/55 { color: rgba(34, 41, 42, 0.55) !important; }
.text-ink\/70 { color: rgba(34, 41, 42, 0.7) !important; }
.text-ink\/72 { color: rgba(34, 41, 42, 0.72) !important; }
.text-sand\/30 { color: rgba(161, 149, 125, 0.3) !important; }
.text-sand\/70 { color: rgba(161, 149, 125, 0.7) !important; }
.text-sand\/85 { color: rgba(161, 149, 125, 0.85) !important; }
.to-leather\/45 { --tw-gradient-to: rgba(81, 68, 51, 0.45) !important; }
.to-slate-deep\/35 { --tw-gradient-to: rgba(54, 68, 68, 0.35) !important; }
.via-slate-deep\/72 { --tw-gradient-via: rgba(54, 68, 68, 0.72) !important; }
