/* =============================================================
   The Wren — Lisbon townhouse. Azulejo cobalt + lime-wash cream,
   high-contrast serif display, tile-motif dividers.
   Standalone build (skill: crear-web-como-servicio, archetype 01 adapted).
   ============================================================= */

:root {
  --bg:      #f6f0e3;   /* lime-wash cream */
  --bg-2:    #efe6d3;
  --paper:   #fffdf5;

  --ink:      #241f19;  /* warm brown-black */
  --ink-soft: #4b4238;
  --ink-mute: #756a5c;

  --azul:      #2f5aa8;  /* azulejo cobalt */
  --azul-deep: #24478a;
  --ochre:     #dfa838;  /* Lisbon yellow */
  --terra:     #c1684a;  /* terracotta — sparing */

  --accent:      var(--azul);
  --accent-deep: var(--azul-deep);

  --card:     #fffdf5;
  --card-brd: rgba(36, 31, 25, 0.16);
  --line:     rgba(36, 31, 25, 0.14);
  --line-2:   rgba(36, 31, 25, 0.08);

  --shadow-sm: 0 1px 2px rgba(36, 31, 25, 0.05), 0 4px 14px -6px rgba(36, 31, 25, 0.12);
  --shadow-md: 0 1px 3px rgba(36, 31, 25, 0.06), 0 18px 36px -20px rgba(36, 31, 25, 0.24);
  --shadow-lg: 0 2px 8px rgba(36, 31, 25, 0.07), 0 40px 70px -34px rgba(36, 31, 25, 0.30);

  --display: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --r: 4px;
  --r-lg: 8px;

  --gutter: clamp(1.15rem, 5vw, 2.6rem);
  --maxw: 1120px;
  --space-section: clamp(4.5rem, 11vw, 7.5rem);

  --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%23f6f0e3'/%3E%3Cpath d='M20 3 L37 20 L20 37 L3 20 Z' fill='none' stroke='%232f5aa8' stroke-width='1.4'/%3E%3Ccircle cx='20' cy='20' r='5.5' fill='none' stroke='%232f5aa8' stroke-width='1.4'/%3E%3Ccircle cx='20' cy='20' r='1.8' fill='%232f5aa8'/%3E%3Cpath d='M20 3 L20 -3 M20 37 L20 43 M3 20 L-3 20 M37 20 L43 20' stroke='%232f5aa8' stroke-width='1.4'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.66;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { 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; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0;
  color: var(--ink);
  text-wrap: balance;
}
em { font-style: italic; color: var(--azul-deep); }
::selection { background: var(--azul); color: #fff; }
:focus-visible { outline: 2px solid var(--azul-deep); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--paper); color: var(--ink);
  border-radius: 6px; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* Section label — small caps + azulejo lozenge */
.label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--azul-deep);
  margin-bottom: 1rem;
}
.label::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--azul);
  transform: rotate(45deg);
  flex: none;
}

.u-link { position: relative; color: var(--azul-deep); font-weight: 700; }
.u-link::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 1.5px; background: currentColor; transition: right .3s var(--ease-out);
}
.u-link:hover::after { right: 0; }

/* Tile-motif divider */
.tile-rule {
  height: 40px;
  background-image: var(--tile);
  background-size: 40px 40px;
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.5;
}

/* Buttons — rectangular "stamp" */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  padding: 0.92rem 1.5rem;
  border-radius: var(--r);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  transition: transform .3s var(--ease-out), background-color .25s var(--ease-out),
              color .25s var(--ease-out), border-color .25s var(--ease-out);
}
.btn-arrow { display: inline-block; transition: transform .3s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-deep); transform: translateY(-2px); }
.btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-block { width: 100%; }

/* Demo honesty bar */
.demo-bar {
  position: relative; z-index: 200;
  background: var(--ink);
  color: #efe7d6;
  font-size: 0.8rem; line-height: 1.45;
}
.demo-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; padding-block: 0.65rem; }
.demo-bar strong { color: #fff; font-weight: 700; }
.demo-bar a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.demo-bar a:hover { color: var(--ochre); }

.demo-note {
  border: 1px dashed rgba(36, 31, 25, 0.3);
  border-radius: var(--r-lg);
  background: rgba(47, 90, 168, 0.05);
  padding: 1.1rem 1.25rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 46rem;
}
.demo-note strong { color: var(--ink); }

/* Nav — centred serif wordmark */
.nav {
  position: sticky; top: 0; z-index: 150;
  background: rgba(246, 240, 227, 0.9);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--gutter);
  transition: box-shadow .3s var(--ease-out);
}
@supports (backdrop-filter: blur(10px)) {
  .nav { background: rgba(246, 240, 227, 0.75); backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%); }
}
.nav.is-scrolled { box-shadow: var(--shadow-sm); }
.nav-inner {
  max-width: var(--maxw); margin-inline: auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 1rem; padding: 0.9rem 0;
}
.brand {
  grid-column: 2;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--ink);
  text-align: center;
  display: inline-flex; align-items: baseline; gap: 0.45rem;
}
.brand small {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.nav-links { display: none; gap: 1.5rem; }
.nav-links a {
  position: relative;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 0.3rem 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--azul); transition: right .3s var(--ease-out);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.is-active::after { right: 0; }
.nav-cta { grid-column: 3; justify-self: end; padding: 0.66rem 1.05rem; font-size: 0.72rem; }
@media (max-width: 620px) { .brand small { display: none; } .nav-cta { padding: 0.6rem 0.85rem; } }

/* Hero */
.hero {
  position: relative;
  min-height: 84vh; min-height: 84svh;
  display: flex; align-items: flex-end;
  padding: 6rem var(--gutter) clamp(2.5rem, 6vw, 4rem);
  color: #fff;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; background: #2a2620; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(24,20,16,0.34) 0%, rgba(24,20,16,0.12) 30%, rgba(24,20,16,0.1) 42%, rgba(24,20,16,0.82) 100%),
    linear-gradient(90deg, rgba(24,20,16,0.34) 0%, transparent 55%);
}
.hero-inner { width: 100%; max-width: var(--maxw); margin-inline: auto; }
.hero .label { color: rgba(255,255,255,0.92); }
.hero .label::before { background: #fff; }
.hero h1 {
  font-size: clamp(2.6rem, 6.6vw, 4.8rem);
  line-height: 1.04;
  max-width: 17ch;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.45);
}
.hero h1 em { color: var(--ochre); }
.hero-sub {
  margin-top: 1.1rem;
  font-size: clamp(1.04rem, 2vw, 1.22rem);
  max-width: 42ch;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 16px rgba(0,0,0,0.45);
}
.hero-actions { margin-top: 1.9rem; display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-meta {
  margin-top: 1.7rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem;
  font-size: 0.84rem; font-weight: 600;
  color: rgba(255,255,255,0.9);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-meta span::before { content: ""; width: 7px; height: 7px; background: var(--ochre); transform: rotate(45deg); }

/* Sections */
.section { padding: var(--space-section) 0; scroll-margin-top: 6.5rem; }
.section.paper { background: var(--paper); }
.section-head { max-width: 46rem; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.section-head h2 { font-size: clamp(1.95rem, 4.4vw, 3rem); }
.section-lead { margin-top: 1rem; color: var(--ink-soft); font-size: 1.05rem; max-width: 42rem; }

/* Marquee */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding-block: 1rem;
  background: var(--bg-2);
}
.marquee-track {
  display: flex; gap: 3rem;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--azul-deep);
  animation: marquee 26s linear infinite;
}
.marquee-track span { display: inline-flex; align-items: center; gap: 3rem; }
.marquee-track span::after { content: "\2666"; color: var(--ochre); font-size: 0.8rem; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* The house */
.house-figure {
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--card-brd);
}
.house-figure img { width: 100%; height: 100%; object-fit: cover; }
.house-copy { margin-top: 2.4rem; max-width: 46rem; }
.house-copy p { color: var(--ink-soft); font-size: 1.05rem; }
.house-copy p + p { margin-top: 1rem; }
.facts {
  margin-top: 2.8rem;
  display: grid; gap: 1.1rem;
}
.fact { border-top: 2px solid var(--azul); padding-top: 0.9rem; }
.fact dt {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--azul-deep); margin-bottom: 0.3rem;
}
.fact dd { font-family: var(--display); font-size: 1.3rem; color: var(--ink); }

/* Rooms */
.rooms { display: grid; gap: 1.6rem; }
.room {
  background: var(--card);
  border: 1px solid var(--card-brd);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.room:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.room-media { aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.room-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.room:hover .room-media img { transform: scale(1.05); }
.room-body { padding: 1.4rem 1.5rem 1.6rem; }
.room-body h3 { font-size: 1.5rem; }
.room-rate {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--azul-deep); margin: 0.35rem 0 0.7rem;
}
.room-body p { color: var(--ink-soft); font-size: 0.96rem; }
.room-tags { margin-top: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.room-tags li {
  list-style: none; font-size: 0.74rem; font-weight: 600;
  color: var(--azul-deep);
  padding: 0.28rem 0.6rem;
  border: 1px solid rgba(47, 90, 168, 0.3);
  border-radius: 999px;
}
.rooms-note { margin-top: 1.6rem; font-family: var(--display); font-size: 1.15rem; color: var(--ink); }

/* Café strip */
.cafe-grid { display: grid; gap: clamp(1.8rem, 5vw, 3rem); align-items: center; }
.cafe-figure { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3 / 2; box-shadow: var(--shadow-md); border: 1px solid var(--card-brd); background: var(--bg-2); }
.cafe-figure img { width: 100%; height: 100%; object-fit: cover; }
.cafe-copy h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.cafe-copy p { margin-top: 1rem; color: var(--ink-soft); }

/* Gallery */
.gallery { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.gallery figure {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  aspect-ratio: 3 / 2; background: var(--bg-2);
  border: 1px solid var(--card-brd);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption {
  position: absolute; left: 0.75rem; bottom: 0.75rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: #fff;
  background: rgba(24, 20, 16, 0.55);
  padding: 0.3rem 0.6rem; border-radius: var(--r);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* Getting here */
.here-grid { display: grid; gap: clamp(1.8rem, 5vw, 3rem); align-items: start; }
.here-copy p { color: var(--ink-soft); }
.here-copy p + p { margin-top: 0.9rem; }
.here-list { margin-top: 1.3rem; display: grid; gap: 0.65rem; }
.here-list li {
  list-style: none; padding-left: 1.4rem; position: relative;
  color: var(--ink-soft); font-size: 0.96rem;
}
.here-list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em;
  width: 7px; height: 7px; background: var(--azul); transform: rotate(45deg);
}
.map-card {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 4 / 3; border: 1px solid var(--card-brd);
  background:
    radial-gradient(120% 90% at 78% 20%, rgba(47, 90, 168, 0.16), transparent 60%),
    linear-gradient(160deg, #efe7d3 0%, #e6dcc4 60%, #ddd2b8 100%);
}
.map-card::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(36,31,25,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36,31,25,0.06) 1px, transparent 1px);
  background-size: 38px 38px;
}
.map-pin {
  position: absolute; left: 50%; top: 47%;
  width: 18px; height: 18px;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 50% 50% 50% 0;
  background: var(--terra);
  box-shadow: 0 6px 16px -6px rgba(0,0,0,0.5);
}
.map-note {
  position: absolute; left: 0.8rem; bottom: 0.8rem;
  font-size: 0.7rem; color: #fff;
  background: rgba(24,20,16,0.55);
  padding: 0.3rem 0.6rem; border-radius: var(--r);
}

/* Enquire */
.enq-grid { display: grid; gap: clamp(2.2rem, 6vw, 3.6rem); align-items: start; }
.enq-copy { max-width: 34rem; }
.enq-copy h2 { font-size: clamp(1.95rem, 4vw, 2.6rem); }
.enq-copy > p { margin-top: 1rem; color: var(--ink-soft); }
.enq-direct {
  margin-top: 1.7rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: grid; gap: 0.3rem;
}
.enq-direct dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--azul-deep); }
.enq-direct dd { font-family: var(--display); font-size: 1.25rem; color: var(--ink); }
.enq-direct .fine { font-family: var(--sans); font-size: 0.82rem; color: var(--ink-mute); }

.enq-form { padding: 1.9rem 1.8rem; background: var(--paper); border: 1px solid var(--card-brd); border-radius: var(--r-lg); }
.enq-form .row { display: grid; gap: 1rem; }
@media (min-width: 480px) { .enq-form .row-2 { grid-template-columns: 1fr 1fr; } }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.42rem; }
.field .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-mute); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.82rem 0.9rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: #fff;
  font: inherit; color: var(--ink);
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(47, 90, 168, 0.16);
}
.field textarea { resize: vertical; min-height: 90px; }
.form-status { margin-top: 0.9rem; font-size: 0.88rem; font-weight: 600; min-height: 1.2em; }
.form-status.is-ok { color: var(--azul-deep); }
.form-status.is-err { color: var(--terra); }

/* Footer */
.footer { background: var(--paper); }
.footer .tile-rule { opacity: 0.42; }
.footer-inner { max-width: var(--maxw); margin-inline: auto; padding: clamp(2.6rem, 6vw, 3.6rem) var(--gutter) 0; display: grid; gap: 1.5rem; }
.footer .brand { grid-column: auto; text-align: left; font-size: 1.3rem; }
.footer-tag { color: var(--ink-soft); font-size: 0.95rem; max-width: 34rem; }
.footer-disclosure {
  font-size: 0.88rem; color: var(--ink-soft); max-width: 46rem;
  padding: 0.95rem 1.15rem; border-radius: var(--r-lg);
  background: rgba(47, 90, 168, 0.05); border: 1px solid var(--line-2);
}
.footer-disclosure strong { color: var(--ink); }
.footer-bottom {
  max-width: var(--maxw); margin: 2rem auto 0; padding: 1.4rem var(--gutter) 2.2rem;
  border-top: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  font-size: 0.82rem; color: var(--ink-mute);
}
.footer-bottom a { color: var(--azul-deep); font-weight: 700; }

/* Reveal */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
.rooms .reveal:nth-child(2), .gallery .reveal:nth-child(2) { transition-delay: .06s; }
.rooms .reveal:nth-child(3), .gallery .reveal:nth-child(3) { transition-delay: .12s; }
.rooms .reveal:nth-child(4), .gallery .reveal:nth-child(4) { transition-delay: .18s; }

/* Responsive */
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 760px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .rooms { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 920px) {
  .nav-links { display: flex; }
  .nav-links.left { grid-column: 1; justify-self: start; }
  .nav-cta { grid-column: 3; }
  .rooms { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .cafe-grid { grid-template-columns: 1.1fr 0.9fr; }
  .here-grid { grid-template-columns: 1.1fr 0.9fr; }
  .enq-grid { grid-template-columns: 1fr 1fr; }
  .enq-form { position: sticky; top: 6.5rem; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery figure.wide { grid-column: span 2; aspect-ratio: 3 / 1.4; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .reveal { transition-duration: .001s; }
  .room:hover .room-media img, .gallery figure:hover img { transform: none; }
}
