/* =============================================================
   CASA BRUMA — styles.css
   Concept: "la bruma se abre" — see project-docs/CREATIVE_DIRECTION.md
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* Neutrals — warm, not pure white/black */
  --stone: #f4efe6;
  --stone-2: #ece3d4;
  --stone-3: #e2d6c1;
  --charcoal: #211f1c;
  --charcoal-70: rgba(33, 31, 28, 0.72);
  --charcoal-50: rgba(33, 31, 28, 0.5);
  --charcoal-14: rgba(33, 31, 28, 0.14);
  --paper: #faf7f1;

  /* Brand accents — derived from the two states of the concept */
  --fog: #8fa0a6;          /* bruma: cool grey-blue, mist moments only */
  --fog-deep: #526066;
  --valle: #a5652c;        /* valle: dry-hill / dawn-light ochre, CTA + accents */
  --valle-deep: #7d4a1f;
  --valle-tint: #f1e2cd;

  /* Typography */
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --sans: "Manrope", "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-hero: clamp(2.6rem, 3.6rem + 3.6vw, 6.4rem);
  --fs-h1: clamp(2.1rem, 1.6rem + 2.4vw, 3.6rem);
  --fs-h2: clamp(1.5rem, 1.2rem + 1.4vw, 2.3rem);
  --fs-h3: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --fs-lead: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.76rem;

  /* Spacing */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1.25rem;
  --space-md: 2rem;
  --space-lg: clamp(2.5rem, 2rem + 2.2vw, 4rem);
  --space-xl: clamp(3.5rem, 2.6rem + 4vw, 6.5rem);
  --space-2xl: clamp(5rem, 3.6rem + 6.5vw, 10rem);

  --container: 1280px;
  --gutter: clamp(1.25rem, 1rem + 2.4vw, 3rem);

  /* Easings */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --radius-sm: 2px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--stone);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  text-wrap: balance;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--valle); color: var(--paper); }
:focus-visible {
  outline: 2px solid var(--valle-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.sr-only {
  position: absolute; 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; top: -100px; left: 1rem; z-index: 999;
  padding: 0.7rem 1.1rem; background: var(--charcoal); color: var(--paper);
  border-radius: 4px; font-weight: 600; transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--valle-deep);
}
.eyebrow--fog { color: var(--fog-deep); }
.eyebrow--on-dark { color: var(--valle-tint); }

.lead {
  font-size: var(--fs-lead);
  color: var(--charcoal-70);
  max-width: 42ch;
  line-height: 1.5;
}

.measure { max-width: 62ch; }

/* =============================================================
   4. Buttons & links
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.6rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out), transform .3s var(--ease-out);
}
.btn-primary {
  background: var(--valle);
  color: var(--paper);
}
.btn-primary:hover, .btn-primary:focus-visible { background: var(--valle-deep); }
.btn-ghost {
  border: 1px solid var(--charcoal-14);
  color: var(--charcoal);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  border-color: var(--charcoal);
}
.btn-on-dark {
  border: 1px solid rgba(250, 247, 241, 0.4);
  color: var(--paper);
}
.btn-on-dark:hover, .btn-on-dark:focus-visible {
  border-color: var(--paper);
  background: rgba(250, 247, 241, 0.1);
}
.btn-arrow { transition: transform .3s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(3px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  border-bottom: 1px solid var(--charcoal-14);
  padding-bottom: 2px;
  transition: border-color .25s var(--ease-out), color .25s var(--ease-out);
}
.text-link:hover, .text-link:focus-visible { border-color: currentColor; }

/* =============================================================
   5. Placeholders (Build V1 — see IMAGE_BRIEF.md for final assets)
   ============================================================= */
.ph {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ph-ratio, 4 / 5);
  overflow: hidden;
  background:
    linear-gradient(155deg, var(--fog) 0%, var(--stone-3) 42%, var(--valle) 145%);
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px);
}
.ph::after {
  content: attr(data-ph);
  position: absolute; inset: auto 0 0 0;
  padding: 0.7rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.35;
  color: rgba(250, 247, 241, 0.95);
  background: rgba(20, 18, 16, 0.5);
}

/* Real integrated photography — same layout contract as .ph, no placeholder decoration */
.photo {
  display: block;
  width: 100%;
  aspect-ratio: var(--ph-ratio, 4 / 5);
  object-fit: cover;
  object-position: center;
}
.hero-media .photo { height: 100%; width: 100%; aspect-ratio: auto; }

/* =============================================================
   6. Header / navigation
   ============================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--stone);
  border-bottom: 1px solid var(--charcoal-14);
}
.page-home .site-header {
  background: transparent;
  border-bottom-color: transparent;
  position: absolute;
  inset-inline: 0;
  top: 0;
}
.page-home .site-header.is-scrolled {
  position: fixed;
  background: var(--stone);
  border-bottom-color: var(--charcoal-14);
}
.page-home .site-header .nav-mark,
.page-home .site-header .nav-link,
.page-home .site-header .nav-mobile summary {
  color: var(--paper);
}
.page-home .site-header.is-scrolled .nav-mark,
.page-home .site-header.is-scrolled .nav-link,
.page-home .site-header.is-scrolled .nav-mobile summary {
  color: var(--charcoal);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: 1.1rem;
}
.nav-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  transition: color .3s var(--ease-out);
}
.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-md);
}
.nav-link {
  font-size: 0.92rem;
  font-weight: 600;
  padding-block: 0.3rem;
  border-bottom: 1px solid transparent;
  transition: color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.nav-link:hover, .nav-link:focus-visible, .nav-link[aria-current="page"] {
  border-color: currentColor;
}
.nav-cta { margin-left: var(--space-2xs); }

.nav-mobile { position: relative; }
.nav-mobile summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 0.2rem;
  transition: color .3s var(--ease-out);
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile summary::before {
  content: "";
  width: 20px; height: 1px; background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
}
.nav-mobile[open] summary::before {
  box-shadow: none;
  height: 20px;
  background: transparent;
}
.nav-mobile[open] summary::after {
  content: "";
  position: fixed; inset: 0;
  background: rgba(20, 18, 16, 0.02);
}
.nav-mobile:not([open]) .nav-mobile-panel {
  display: none;
}
.nav-mobile-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  min-width: 240px;
  background: var(--paper);
  border: 1px solid var(--charcoal-14);
  border-radius: 4px;
  padding: 0.75rem;
  box-shadow: 0 18px 40px rgba(33, 31, 28, 0.14);
}
.nav-mobile-panel a {
  display: block;
  padding: 0.7rem 0.6rem;
  font-weight: 600;
  color: var(--charcoal);
  border-radius: 3px;
}
.nav-mobile-panel a:hover, .nav-mobile-panel a:focus-visible {
  background: var(--stone);
}
.nav-mobile-panel .nav-cta { margin: 0.4rem 0 0.2rem; }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-mobile { display: none; }
}

/* =============================================================
   7. Sections & layout
   ============================================================= */
.section {
  padding-block: var(--space-2xl);
}
.section--tight { padding-block: var(--space-xl); }
.section--alt { background: var(--stone-2); }
.section--dark { background: var(--charcoal); color: var(--paper); }
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  margin-bottom: var(--space-lg);
}
.section-head h2 { font-size: var(--fs-h2); }
.section-foot {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: flex-start;
}

/* =============================================================
   8. Hero (homepage)
   ============================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--paper);
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-media .ph, .hero-media .photo { height: 100%; aspect-ratio: auto; }
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,18,16,.18) 0%, rgba(20,18,16,.5) 100%);
}
.hero-fog {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, var(--fog) 0%, var(--stone-2) 92%);
  animation: fogClear 2.8s 0.5s var(--ease-soft) forwards;
}
@keyframes fogClear {
  from { opacity: 0.94; transform: scale(1); }
  to { opacity: 0; transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-fog { animation-duration: 0.6s; animation-delay: 0s; }
}
.hero-content {
  position: relative;
  padding-block: var(--space-2xl) var(--space-xl);
}
.hero-content .eyebrow { color: var(--valle-tint); }
.hero-title {
  font-size: var(--fs-hero);
  letter-spacing: -0.02em;
  margin-block: 0.5rem 1.1rem;
}
.hero-line {
  font-size: var(--fs-lead);
  max-width: 34ch;
  color: rgba(250, 247, 241, 0.86);
}
.hero-scroll {
  position: absolute;
  right: var(--gutter);
  bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 247, 241, 0.85);
}
.hero-scroll::after {
  content: "";
  width: 1px; height: 34px;
  background: rgba(250, 247, 241, 0.6);
  animation: scrollCue 2.2s var(--ease-soft) infinite;
}
@keyframes scrollCue {
  0%, 100% { transform: scaleY(1); opacity: .5; }
  50% { transform: scaleY(0.5); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll::after { animation: none; }
}

/* =============================================================
   9. Page header (interior pages)
   ============================================================= */
.page-header {
  padding-block: calc(var(--space-2xl) + 2rem) var(--space-lg);
  background: var(--stone-2);
}
.page-header h1 { font-size: var(--fs-h1); margin-top: 0.5rem; max-width: 20ch; }
.page-header .lead { margin-top: var(--space-sm); }

/* =============================================================
   10. Intro / statement blocks
   ============================================================= */
.statement {
  display: grid;
  gap: var(--space-lg);
  align-items: start;
}
.statement h2 { font-size: var(--fs-h1); max-width: 14ch; }

/* =============================================================
   11. Stay — asymmetric room hierarchy
   ============================================================= */
.stay-grid {
  display: grid;
  gap: var(--space-md);
}
.room-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.room-card-media {
  position: relative;
  overflow: hidden;
}
.room-card-media .ph, .room-card-media .photo { transition: opacity .6s var(--ease-soft); }
.room-card-media .ph--alt, .room-card-media .photo--alt {
  position: absolute; inset: 0; opacity: 0;
}
.room-card:hover .ph--alt, .room-card:hover .photo--alt,
.room-card:focus-within .ph--alt, .room-card:focus-within .photo--alt { opacity: 1; }
.room-card-body { display: flex; flex-direction: column; gap: 0.4rem; }
.room-card-body h3 { font-size: var(--fs-h3); }
.room-card-body p { color: var(--charcoal-70); max-width: 40ch; }
.room-card--patio .room-card-media { --ph-ratio: 4 / 5; }
.room-card--valley .room-card-media { --ph-ratio: 4 / 5; }
.room-card--bruma .room-card-media { --ph-ratio: 4 / 5; }

@media (min-width: 720px) {
  .stay-grid { grid-template-columns: repeat(6, 1fr); }
  .room-card--patio { grid-column: span 3; }
  .room-card--valley { grid-column: span 3; }
  .room-card--bruma { grid-column: span 6; }
  .room-card--bruma .room-card-media { --ph-ratio: 16 / 9; }
  .room-card--bruma .room-card-body { max-width: 52ch; }
}
@media (min-width: 1280px) {
  .room-card--patio { grid-column: span 2; }
  .room-card--valley { grid-column: span 4; }
  .room-card--valley .room-card-media { --ph-ratio: 3 / 4; }
  .room-card--bruma { grid-column: span 6; }
}

/* =============================================================
   12. Day arc (Experience)
   ============================================================= */
.day-arc {
  display: grid;
  gap: var(--space-sm);
}
.day-arc-item { display: flex; flex-direction: column; gap: 0.75rem; }
.day-arc-item .eyebrow { color: var(--fog-deep); }
.day-arc-item p { color: var(--charcoal-70); }
@media (min-width: 720px) {
  .day-arc { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================================
   13. Feature rows (Experience / Valle detail rows)
   ============================================================= */
.feature-row {
  display: grid;
  gap: var(--space-md);
  align-items: center;
  padding-block: var(--space-lg);
  border-top: 1px solid var(--charcoal-14);
}
.feature-row:last-child { border-bottom: 1px solid var(--charcoal-14); }
.feature-row h3 { font-size: var(--fs-h3); margin-bottom: 0.6rem; }
.feature-row p { color: var(--charcoal-70); max-width: 48ch; }
@media (min-width: 960px) {
  .feature-row { grid-template-columns: 1fr 1.2fr; }
  .feature-row--media-left { grid-template-columns: 1.2fr 1fr; }
  .feature-row--media-left .feature-row-media { order: -1; }
}

/* =============================================================
   14. Trust note
   ============================================================= */
.trust-note {
  max-width: 60ch;
}
.trust-note p + p { margin-top: 1rem; }

/* =============================================================
   15. CTA band (closing)
   ============================================================= */
.cta-band {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
}
.cta-band h2 { font-size: var(--fs-h1); max-width: 16ch; }
.cta-band-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.5rem; }

/* =============================================================
   16. Room detail page
   ============================================================= */
.room-hero {
  position: relative;
  padding-block: calc(var(--space-2xl) + 2rem) var(--space-xl);
}
.room-hero-grid {
  display: grid;
  gap: var(--space-lg);
}
.room-hero-media .ph, .room-hero-media .photo { --ph-ratio: 4 / 3; }
.room-hero-meta { display: flex; flex-direction: column; gap: var(--space-sm); align-self: center; }
.room-hero-meta h1 { font-size: var(--fs-h1); }
.room-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  padding-top: 0.4rem;
}
.room-fact {
  font-size: var(--fs-small);
  color: var(--charcoal-70);
  padding-left: 1rem;
  position: relative;
}
.room-fact::before {
  content: "";
  position: absolute; left: 0; top: 0.5em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--valle);
}
@media (min-width: 960px) {
  .room-hero-grid { grid-template-columns: 1.3fr 1fr; }
}

.room-gallery {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: repeat(2, 1fr);
}
.room-gallery .ph:nth-child(3n+1), .room-gallery .photo:nth-child(3n+1) { --ph-ratio: 3 / 2; grid-column: 1 / -1; }
@media (min-width: 720px) {
  .room-gallery { grid-template-columns: repeat(3, 1fr); }
}

.room-other {
  display: grid;
  gap: var(--space-md);
}
@media (min-width: 720px) { .room-other { grid-template-columns: repeat(2, 1fr); } }

/* =============================================================
   17. Reveal-on-scroll (functional micro-interaction, not gated)
   ============================================================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* =============================================================
   18. Form
   ============================================================= */
.inquiry-grid {
  display: grid;
  gap: var(--space-xl);
}
.form {
  display: grid;
  gap: var(--space-sm);
}
.field-row { display: grid; gap: var(--space-sm); }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.field input,
.field select,
.field textarea {
  padding: 0.85rem 1rem;
  background: var(--paper);
  border: 1px solid var(--charcoal-14);
  border-radius: 3px;
  font-size: 0.98rem;
  transition: border-color .25s var(--ease-out);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--valle-deep);
  outline: none;
}
.field textarea { resize: vertical; min-height: 120px; }
.field-hint { font-size: 0.8rem; color: var(--charcoal-50); }
.form-note {
  font-size: 0.85rem;
  color: var(--charcoal-70);
  max-width: 46ch;
}
.form-status {
  padding: 1rem 1.1rem;
  border-radius: 3px;
  background: var(--valle-tint);
  color: var(--valle-deep);
  font-weight: 600;
  font-size: 0.92rem;
  display: none;
}
.form-status.is-visible { display: block; }
.form-fields { display: contents; }
.form[data-sent] .form-fields { display: none; }

@media (min-width: 720px) {
  .field-row--two { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .inquiry-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================================
   19. Footer
   ============================================================= */
.site-footer {
  background: var(--charcoal);
  color: rgba(250, 247, 241, 0.78);
  padding-block: var(--space-xl) var(--space-md);
}
.footer-top {
  display: grid;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(250, 247, 241, 0.14);
}
.footer-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--paper);
}
.footer-note { max-width: 40ch; margin-top: 0.75rem; font-size: 0.92rem; }
.footer-cols { display: grid; gap: var(--space-md); grid-template-columns: repeat(2, 1fr); }
.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 247, 241, 0.55);
  margin-bottom: 0.9rem;
}
.footer-col a, .footer-col p {
  display: block;
  font-size: 0.92rem;
  padding-block: 0.3rem;
  color: rgba(250, 247, 241, 0.82);
}
.footer-col a:hover, .footer-col a:focus-visible { color: var(--paper); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: var(--space-md);
  font-size: 0.78rem;
  color: rgba(250, 247, 241, 0.45);
}
@media (min-width: 720px) {
  .footer-top { grid-template-columns: 1.2fr 1fr; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================================
   20. Breakpoints reference
   Default: mobile (<540px)
   540 / 720 / 960 / 1280 / 1600
   ============================================================= */
@media (min-width: 540px) {
  .hero-scroll { display: flex; }
}
@media (min-width: 960px) {
  .statement { grid-template-columns: 1fr 1fr; }
  .room-hero-meta { align-self: end; }
}
