/* ============================================================
   PALAIS DU BONHEUR — main.css
   Variables, reset, base typography, scrollbar, utilities
   ============================================================ */

/* ── Custom Properties ── */
:root {
  /* Palette */
  --color-void:      #070709;
  --color-ink:       #0f0f14;
  --color-jade:      #2D6A4F;
  --color-gold:      #C9A96E;
  --color-gold-pale: #E8D5A3;
  --color-lacquer:   #8B1A1A;
  --color-smoke:     #F5F0E8;
  --color-mist:      rgba(245, 240, 232, 0.06);

  /* Gold variants */
  --color-gold-20:   rgba(201, 169, 110, 0.20);
  --color-gold-30:   rgba(201, 169, 110, 0.30);
  --color-gold-10:   rgba(201, 169, 110, 0.10);
  --color-gold-glow: rgba(201, 169, 110, 0.15);

  /* Typography */
  --font-serif:    'Cormorant Garamond', Georgia, serif;
  --font-chinese:  'Noto Serif SC', serif;
  --font-sans:     'DM Sans', system-ui, sans-serif;

  /* Sizes */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container-max:  1200px;
  --container-wide: 1440px;
  --nav-height:     80px;

  /* Transitions */
  --ease-out:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in:    cubic-bezier(0.55, 0.055, 0.675, 0.19);
  --ease-inout: cubic-bezier(0.645, 0.045, 0.355, 1.0);
  --dur-fast:   150ms;
  --dur-base:   300ms;
  --dur-slow:   600ms;
  --dur-slower: 900ms;

  /* Borders */
  --border-gold:  1px solid var(--color-gold-30);
  --border-mist:  1px solid var(--color-mist);

  /* Shadows */
  --shadow-gold:  0 0 30px var(--color-gold-20), 0 0 60px var(--color-gold-10);
  --shadow-card:  0 8px 40px rgba(0, 0, 0, 0.6);
}


/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.7;
  color: var(--color-smoke);
  background-color: var(--color-void);
  overflow-x: hidden;
  cursor: none;
}

/* Fallback cursor on touch devices */
@media (hover: none) {
  body { cursor: auto; }
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

input,
select,
textarea {
  font-family: var(--font-sans);
  font-size: var(--text-base);
}

iframe {
  border: none;
}


/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-void);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-pale);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gold) var(--color-void);
}


/* ── Typography base ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--color-smoke);
}

p {
  line-height: 1.7;
}

.text-chinese {
  font-family: var(--font-chinese);
}

.text-gold {
  color: var(--color-gold);
}

.text-gold-pale {
  color: var(--color-gold-pale);
}

.text-smoke {
  color: var(--color-smoke);
}

.text-italic {
  font-style: italic;
}

.letter-wide {
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.letter-widest {
  letter-spacing: 0.3em;
}


/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}


/* ── Custom Cursor ── */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--color-gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  mix-blend-mode: screen;
}

.cursor-dot.cursor--hover {
  transform: translate(-50%, -50%) scale(2.5);
  background: var(--color-gold-pale);
}

.cursor-dot.cursor--click {
  transform: translate(-50%, -50%) scale(0.6);
}

@media (hover: none) {
  .cursor-dot { display: none; }
}


/* ── Layout containers ── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--wide {
  max-width: var(--container-wide);
  padding-inline: var(--space-8);
}

.container--narrow {
  max-width: 720px;
  padding-inline: var(--space-6);
}


/* ── Section base ── */
.section {
  position: relative;
  overflow: hidden;
}

.section + .section {
  border-top: var(--border-gold);
}

.section__overline {
  font-family: var(--font-chinese);
  font-size: var(--text-sm);
  color: var(--color-gold);
  letter-spacing: 0.25em;
  display: block;
  margin-bottom: var(--space-4);
}

.section__title {
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--color-smoke);
  margin-bottom: var(--space-6);
}

.section__subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--color-gold-pale);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.section__description {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 300;
  color: var(--color-smoke);
  opacity: 0.75;
  line-height: 1.8;
  max-width: 560px;
}


/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: all var(--dur-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-gold);
  color: var(--color-void);
  border: 1px solid var(--color-gold);
}

.btn--primary:hover {
  background: var(--color-gold-pale);
  border-color: var(--color-gold-pale);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--color-smoke);
  border: 1px solid var(--color-gold-30);
}

.btn--outline:hover {
  background: var(--color-gold-10);
  border-color: var(--color-gold);
  color: var(--color-gold-pale);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--color-gold);
  border: none;
  padding-inline: 0;
  letter-spacing: 0.08em;
}

.btn--ghost:hover {
  color: var(--color-gold-pale);
  gap: var(--space-3);
}

/* Shimmer effect */
.btn--shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  transition: transform var(--dur-slower) var(--ease-out);
}

.btn--shimmer:hover::after {
  transform: translateX(100%);
}


/* ── Page Hero (shared across inner pages) ── */
.page-hero {
  position: relative;
  min-height: 50vh;
  padding-top: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-color: var(--color-ink);
  background-size: cover;
  background-position: center;
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(7, 7, 9, 0.4) 0%,
    rgba(7, 7, 9, 0.75) 100%
  );
  pointer-events: none;
}

.page-hero__content {
  position: relative;
  z-index: 1;
  padding: var(--space-20) var(--space-6);
}

.page-hero__chinese {
  font-family: var(--font-chinese);
  font-size: var(--text-sm);
  color: var(--color-gold);
  letter-spacing: 0.3em;
  margin-bottom: var(--space-4);
  display: block;
}

.page-hero__title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--color-smoke);
  margin-bottom: var(--space-4);
}

.page-hero__subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--color-gold-pale);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}


/* ── SVG Noise texture filter ── */
.noise-filter {
  position: fixed;
  top: -9999px;
  left: -9999px;
  pointer-events: none;
  aria-hidden: true;
}


/* ── Divider ── */
.divider-gold {
  border: none;
  border-top: var(--border-gold);
  margin: 0;
}


/* ── Reveal animation classes (set by JS Intersection Observer) ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

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

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }
.reveal--delay-4 { transition-delay: 0.4s; }
.reveal--delay-5 { transition-delay: 0.5s; }


/* ── Footer ── */
.footer {
  background: var(--color-ink);
  border-top: var(--border-gold);
  padding: var(--space-16) 0 var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-10); }
}

@media (min-width: 1024px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-12); }
}

.footer__logo-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--text-2xl);
  color: var(--color-smoke);
  display: block;
  letter-spacing: 0.04em;
}

.footer__logo-chinese {
  font-family: var(--font-chinese);
  font-size: var(--text-xs);
  color: var(--color-gold);
  letter-spacing: 0.3em;
  display: block;
  margin-top: var(--space-1);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--color-smoke);
  opacity: 0.5;
  margin-top: var(--space-4);
}

.footer__heading {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-gold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--color-smoke);
  opacity: 0.6;
  transition: opacity var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.footer__link:hover {
  opacity: 1;
  color: var(--color-gold-pale);
}

.footer__hours-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: rgba(245, 240, 232, 0.55);
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(245, 240, 232, 0.06);
}

.footer__hours-row:last-child {
  border-bottom: none;
}

.footer__hours-day {
  min-width: 70px;
  flex-shrink: 0;
}

.footer__hours-closed {
  color: #E05555;
  font-weight: 300;
}

.footer__bottom {
  border-top: var(--border-gold);
  padding-top: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__copyright {
  font-size: var(--text-xs);
  color: var(--color-smoke);
  opacity: 0.35;
}

.footer__social {
  display: flex;
  gap: var(--space-4);
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-gold-30);
  border-radius: 50%;
  color: var(--color-gold);
  opacity: 0.7;
  transition: opacity var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.footer__social-link:hover {
  opacity: 1;
  border-color: var(--color-gold);
  box-shadow: 0 0 12px var(--color-gold-20);
}

.footer__social-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}


/* ── Contact Form (glassmorphism) ── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  background: rgba(245, 240, 232, 0.03);
  border: 1px solid rgba(201, 169, 110, 0.28);
  box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(201, 169, 110, 0.1);
  padding: var(--space-10) var(--space-8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
}

.form-group--row {
  flex-direction: row;
  gap: var(--space-6);
}

.form-group__half {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
}

.form-group label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--color-gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: 0;
  color: var(--color-smoke);
  padding: var(--space-3) 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 300;
  transition: border-bottom-color var(--dur-base) var(--ease-out);
  width: 100%;
  caret-color: var(--color-gold);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(245, 240, 232, 0.18);
  font-size: var(--text-sm);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--color-gold);
}

.form-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23C9A96E' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 16px;
  padding-right: var(--space-6);
}

.form-group select option {
  background: var(--color-ink);
}

.form-group input[type="date"] {
  color-scheme: dark;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  padding-top: var(--space-2);
}


/* ── Selection ── */
::selection {
  background: var(--color-gold-30);
  color: var(--color-smoke);
}


/* ── SVG noise filter (inline, hidden) ── */
svg.noise-svg {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
