/* ============================================================
   BASE.CSS — Truka Real Estate
   Universal foundation. Loaded on every page of the site.

   Contents:
     1. Design tokens (colors, typography variables)
     2. Base reset
     3. Body defaults
     4. Shared components (.optin-*, .btn, .next-marker, etc.)

   NOTE: Page-specific styles do NOT live here. The homepage,
   thank-you pages, portal pages, etc. each have their own
   stylesheet loaded via $pageStylesheet in head.php.

   Class naming conventions: see truka-code-conventions.md §1.

   Last updated: 2026-05-26
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS — locked in Master Strategy v1.5
   ============================================================ */
:root {
  /* Color — anchors */
  --forest-deep:     #14201A;
  --forest:          #2A402C;
  --forest-mid:      #44604A;
  --cream:           #F4ECD8;
  --paper:           #FAF5E8;
  --paper-pure:      #FFFBF0;

  /* Color — accents */
  --gold:            #D4A017;
  --gold-soft:       #E8C158;
  --terracotta:      #C4622D;
  --terracotta-soft: #D87A48;
  --terracotta-deep: #9E4B1F;

  /* Color — neutrals */
  --ink:             #14201A;
  --ink-soft:        #3A4540;
  --muted:           #6B7568;
  --hairline:        #D8D2C2;
  --hairline-soft:   #E4DECB;

  /* Color — cream opacity (for use on dark grounds) */
  --cream-dim:       rgba(244, 236, 216, 0.7);
  --cream-muted:     rgba(244, 236, 216, 0.45);
  --cream-faint:     rgba(244, 236, 216, 0.12);

  /* Typography */
  --serif: "Fraunces", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   2. BASE RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   3. SHARED COMPONENTS
   ------------------------------------------------------------
   Classes used by two or more pages or chapters with identical
   visual treatment. No prefix. Per truka-code-conventions.md §1.5.

   Components added when their containing partials are converted:
     .optin-input, .optin-button   (hero zone + chapter 5)
     .next-marker                  (end of every chapter section)
     .btn                          (if added as a shared base)
   ============================================================ */

/* Top nav — universal chrome. Two rows: edge-to-edge wordmark + login
   link on top, thin divider with circular Truka logo centered on it
   below. Reusable on future pages. */
.nav-bar {
  width: 100%;
  padding: 32px 56px 0;
  position: relative;
  z-index: 20;
  background: var(--paper-pure);
  box-shadow:
    0 1px 0 rgba(216, 210, 194, 1),
    0 8px 16px rgba(20, 32, 26, 0.05),
    0 24px 48px rgba(20, 32, 26, 0.04);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-wordmark {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 36;
  line-height: 1;
}

.nav-wordmark em {
  font-style: italic;
  color: var(--terracotta);
  font-weight: 500;
}

/* --- Nav utility group (right side of nav-row) ---
   Hierarchy: Contact Us (lightest, underlined) → Investor Login
   (with silhouette icon) → Get the Script (filled terracotta CTA). */
.nav-utility {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link-contact {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.nav-link-contact:hover { color: var(--ink); }

.nav-link-account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}
.nav-link-account:hover { color: var(--terracotta); }
.nav-link-account svg {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}
.nav-link-account:hover svg { opacity: 1; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  background: var(--terracotta);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid var(--terracotta);
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.2s ease;
}
.nav-cta:hover {
  background: #A8442F;
  border-color: #A8442F;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(20, 32, 26, 0.15);
}

/* Tree mark row — centered brand mark sitting on the nav-bar's bottom
   edge. No flanking hairlines: the nav-bar's own bottom box-shadow
   serves as the horizon, and the tree straddles it (half-above,
   half-below) so it reads as growing from that line. */
/* Fixed 48px height holds the row's layout contribution constant even when
   the tree itself grows larger (tree is absolute-positioned over the row).
   That way the hero-zone below doesn't shift when the tree size is tuned. */
.nav-divider {
  position: relative;
  height: 48px;
  margin-top: 8px;
}

/* Tree mark — absolute over .nav-divider, centered, bottom-anchored.
   No vertical offset: the trunk's bottom edge sits exactly on the
   existing nav-to-hero horizon so the tree appears to grow out of
   that boundary line. Opacity 0.55 puts it in watermark register
   (faded olive-green against cream) rather than logo register. */
.nav-tree-img {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: block;
  height: 70px;
  width: auto;
  z-index: 20;
  opacity: 0.35;
  transform: translateX(-50%);
}

@media (max-width: 900px) {
  .nav-utility { gap: 14px; }
  .nav-link-contact { display: none; }
  .nav-link-account span { display: none; }
  .nav-cta { padding: 8px 14px; font-size: 12px; }
}

@media (max-width: 700px) {
  .nav-bar {
    padding: 20px 24px 0;
  }
  .nav-wordmark {
    font-size: 20px;
  }
  .nav-divider {
    margin-top: 4px;
    height: 36px;
  }
  .nav-tree-img {
    height: 50px;
  }
}

/* ============================================================
   FOOTER — universal chrome, Zone 3 per Master Strategy.
   Two-tone: cream upper (4 columns) + forest-deep legal strip.
   Classes prefixed .footer-* per code conventions §1.
   ============================================================ */

.footer {
  width: 100%;
  margin-top: 0;
}

/* Upper section — cream ground, 4-column grid */
.footer-top {
  background: var(--cream);
  border-top: 1px solid var(--hairline);
}

.footer-top-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 80px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 56px;
}

/* Brand column — logo + tagline + socials */
.footer-brand {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: 0 1px 2px rgba(20, 32, 26, 0.06), 0 12px 28px rgba(20, 32, 26, 0.08);
}

/* Gold-to-terracotta corner accent — matches brand design language
   from Ch1 portrait, photo frames, and Ch5 form rail. Swap entire
   .footer-logo block to <img src="/images/truka-logo.png"> when real
   logo asset is available. */
.footer-logo::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--gold), var(--terracotta));
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.footer-logo-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 36px;
  color: var(--cream);
  font-weight: 500;
  font-variation-settings: "opsz" 72;
  line-height: 1;
}

.footer-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin-bottom: 24px;
  max-width: 240px;
  font-variation-settings: "opsz" 24;
}

.footer-socials {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer-social {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(20, 32, 26, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social:hover {
  background: var(--terracotta);
  color: var(--cream);
  transform: translateY(-2px);
}

.footer-social svg {
  width: 16px;
  height: 16px;
}

/* Link columns — title + list */
.footer-col-title {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 700;
  margin-bottom: 24px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-link {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 400;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--terracotta);
}

/* Bottom strip — forest-deep, copyright + legal links.
   Bookends the page; Ch1 opened on forest-deep, footer closes on it. */
.footer-bottom {
  background: var(--forest-deep);
  color: var(--cream-dim);
}

.footer-bottom-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-copyright {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--cream-muted);
  letter-spacing: 0.02em;
  font-weight: 400;
}

.footer-legal {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-legal-link {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--cream-dim);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}

.footer-legal-link:hover {
  color: var(--gold-soft);
}

/* Tablet — collapse to 2 columns, brand spans full width */
@media (max-width: 1100px) {
  .footer-top-inner {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: 64px 48px;
  }
  .footer-brand {
    grid-column: 1 / -1;
    margin-bottom: 16px;
  }
}

/* Mobile — single column stack */
@media (max-width: 700px) {
  .footer-top-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 24px;
  }
  .footer-brand {
    margin-bottom: 8px;
  }
  .footer-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
  }
  .footer-logo-text {
    font-size: 30px;
  }
  .footer-tagline {
    font-size: 14px;
    margin-bottom: 20px;
  }
  .footer-col-title {
    font-size: 9px;
    letter-spacing: 0.24em;
    margin-bottom: 18px;
  }
  .footer-links {
    gap: 12px;
  }
  .footer-link {
    font-size: 13px;
  }

  .footer-bottom-inner {
    padding: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .footer-copyright {
    font-size: 11px;
  }
  .footer-legal {
    gap: 14px 18px;
  }
  .footer-legal-link {
    font-size: 10px;
  }
}

/* End of base.css */