/* ============================================
   FINCA NOSARA — Tropical Brutalism
   Heavy, raw, unapologetic. The jungle doesn't
   apologise for being the jungle.
   ============================================ */

/* --- LIGHT THEME (default) --- */
:root {
  --black:     #0d0b08;
  --jungle:    #1a2e1a;
  --moss:      #2d4a2d;
  --leaf:      #4a7c3f;
  --ochre:     #c4943a;
  --gold:      #e8c45a;
  --cream:     #f2ede4;
  --sand:      #e0d6c8;
  --river:     #6b8f8f;
  --clay:      #8b5e3c;
  --ink:       var(--black);
  --bg:        var(--cream);
  --paper:     var(--sand);
  --muted:     #7a6f5e;
  --rule:      #c4b8a6;
  --accent:    var(--ochre);
  --accent-hover: #d4a84a;
  --btn-text:  var(--black);
  --card-bg:   #e8dfd0;
  --focus:     var(--ochre);
}

/* --- DARK THEME --- */
html.dark {
  --ink:       #e8dfd0;
  --bg:        #0d0b08;
  --paper:     #1a1814;
  --muted:     #7a6f5e;
  --rule:      #2d281e;
  --accent:    var(--gold);
  --accent-hover: #f0d06a;
  --btn-text:  var(--black);
  --card-bg:   #1e1b16;
  --focus:     var(--gold);
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--black); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* --- THEME TOGGLE --- */
.theme-toggle-wrap {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
}
.theme-btn {
  background: var(--card-bg);
  border: 2px solid var(--rule);
  color: var(--ink);
  font-size: 1.3rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.theme-btn:hover {
  border-color: var(--accent);
  background: var(--paper);
}

/* --- HEADER / NAV --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 0.75rem 1.5rem;
  background: var(--bg);
  border-bottom: 3px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.nav-link {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.nav-link:hover {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

/* --- MAIN PADDING --- */
#main {
  padding: 5rem 1.5rem 2rem;
  max-width: 80rem;
  margin: 0 auto;
}

/* --- HERO --- */
.hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 0;
  border-bottom: 4px solid var(--rule);
  margin-bottom: 4rem;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 4rem,
      var(--rule) 4rem,
      var(--rule) 4.0625rem
    );
  opacity: 0.15;
  pointer-events: none;
}
.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  line-height: 1;
}
.hero-sup {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.hero-name {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--ink);
}
.hero-sub {
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.5rem;
}
.hero-loc {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
  letter-spacing: 0.05em;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

/* --- BUTTONS --- */
.btn {
  display: inline-block;
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.85rem 2rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 3px solid var(--ink);
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--black);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--bg);
}
.btn-full { width: 100%; }

/* --- SECTION TITLES --- */
.section {
  padding: 4rem 0;
  border-bottom: 3px solid var(--rule);
}
.section:last-of-type { border-bottom: none; }
.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0 0 2.5rem;
  line-height: 1;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  display: block;
  width: 4rem;
  height: 4px;
  background: var(--accent);
  margin-top: 0.5rem;
}

/* --- ESTATE --- */
.estate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.estate-block {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 2px solid var(--rule);
}
.estate-block--full {
  grid-column: 1 / -1;
  display: flex;
  gap: 2rem;
  justify-content: space-around;
  text-align: center;
  padding: 2rem 1.5rem;
}
.stat {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  margin: 0;
  line-height: 1;
  color: var(--ink);
}
.stat-label {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  display: block;
  margin-top: 0.25rem;
}
.estate-block p { margin: 0 0 1rem; }
.estate-block p:last-child { margin-bottom: 0; }
.estate-block--accent {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.estate-block--accent .estate-quote {
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.estate-block--accent .estate-quote-attrib {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
}

/* --- OFFERINGS --- */
.offerings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.5rem;
}
.offering-card {
  background: var(--card-bg);
  border: 2px solid var(--rule);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.offering-card:hover {
  border-color: var(--accent);
}
.offering-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}
.offering-title {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}
.offering-desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* --- STAY --- */
.stay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.stay-card {
  background: var(--card-bg);
  border: 2px solid var(--rule);
  padding: 1.5rem;
}
.stay-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 0.75rem;
}
.stay-name {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.stay-price {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: var(--accent);
}
.stay-price-unit {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
  text-transform: lowercase;
}
.stay-desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.stay-note {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.05em;
}

/* --- SHOP --- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.shop-item {
  background: var(--card-bg);
  border: 2px solid var(--rule);
  padding: 1.25rem;
}
.shop-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.shop-item-name {
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.shop-item-price {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--accent);
}
.shop-item-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.shop-note {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.05em;
}

/* --- CONTACT --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.contact-info p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}
.contact-info p:last-child { margin-bottom: 0; }
.contact-info strong {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.15rem;
}
.contact-instagram {
  margin-top: 1.5rem;
}
.contact-instagram a {
  font-weight: 700;
}

/* --- FORM --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.form-input {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 2px solid var(--rule);
  color: var(--ink);
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--accent);
  outline: none;
}
textarea.form-input { resize: vertical; }
.form-status {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0;
}

/* --- FOOTER --- */
.site-footer {
  border-top: 4px solid var(--rule);
  padding: 2.5rem 1.5rem;
  margin-top: 2rem;
}
.footer-grid {
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-name {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.25rem;
}
.footer-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-nav a {
  font-family: "Courier New", "Courier", ui-monospace, monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--accent); }
.footer-legal {
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-legal p { margin: 0 0 0.25rem; }
.attribution { font-size: 0.75rem; opacity: 0.7; }
.attribution a { color: var(--muted); }

/* --- RESPONSIVE --- */
@media (max-width: 700px) {
  .site-header {
    padding: 0.5rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  .site-nav { gap: 0.75rem; justify-content: center; }
  .nav-link { font-size: 0.7rem; }
  .theme-toggle-wrap { position: static; }
  #main { padding: 6rem 1rem 2rem; }
  .hero { min-height: 70vh; padding: 2rem 0; }
  .estate-grid { grid-template-columns: 1fr; }
  .estate-block--full { flex-direction: column; gap: 1rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-legal { text-align: center; }
  .hero-ctas { flex-direction: column; width: 100%; }
  .hero-ctas .btn { text-align: center; }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
