/* TGC Enterprise: one stylesheet for the whole site.
   Palette tokens live here and nowhere else. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("/assets/fonts/bodoni-moda-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --glass-mist: #E7EADD;
  --glass-sage: #B6C09D;
  --glass-moss: #77855D;
  --glass-lime: #92B152;
  --lead: #2F3729;
  --taupe: #997864;
  --wood-honey: #D19C6D;
  --wood-heart: #8A5A3C;
  --iron: #1F1C17;
  --glass-amber: #D8A84E;
  --glass-lilac: #B7A3C0;

  /* Derived: a darker moss-lead for small secondary text (meets AA on mist) */
  --text-soft: #4B5543;
  --rule: rgba(47, 55, 41, 0.18);

  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-text: "Jost", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 4.5vw, 3.5rem);
  --max: 1360px;
  --header-h: 4.5rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--glass-mist);
  color: var(--lead);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.75rem, 7.4vw, 6.25rem); }
h2 { font-size: clamp(2.1rem, 4.8vw, 3.75rem); }
h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; }
p { margin: 0 0 1.1em; max-width: 38em; }
p:last-child { margin-bottom: 0; }
em { font-family: var(--font-display); }

:focus-visible {
  outline: 2px solid var(--lead);
  outline-offset: 3px;
}
.on-dark :focus-visible,
.site-footer :focus-visible,
.menu-open :focus-visible { outline-color: var(--glass-mist); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--lead);
  color: var(--glass-mist);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus { top: 0.75rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0 var(--gutter);
  background: rgba(231, 234, 221, 0.94);
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  position: relative;
  z-index: 40;
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-decoration: none;
  letter-spacing: 0;
}
.nav { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); font-weight: 500; }
.nav a {
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover,
.nav a[aria-current="page"] { border-bottom-color: var(--taupe); }

.menu-btn {
  display: none;
  position: relative;
  z-index: 40;
  font: inherit;
  font-weight: 500;
  color: inherit;
  background: none;
  border: 0;
  padding: 0.5rem 0;
  cursor: pointer;
}

/* Phone menu: only when JS is available, otherwise the nav simply wraps */
@media (max-width: 859px) {
  .site-header { flex-wrap: wrap; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .nav { width: 100%; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
  .js .site-header { flex-wrap: nowrap; padding-top: 0; padding-bottom: 0; }
  .js .menu-btn { display: block; }
  .js .nav {
    position: fixed;
    inset: 0;
    z-index: 35;
    width: auto;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    padding: calc(var(--header-h) + 1rem) var(--gutter) 3rem;
    background: var(--lead);
    color: var(--glass-mist);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
  }
  .js .nav a {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.5rem, 12vw, 3.5rem);
    line-height: 1.2;
    border: 0;
  }
  .js .nav a[aria-current="page"] { font-style: italic; }
  .menu-open .nav { opacity: 1; visibility: visible; }
  .menu-open .site-header { background: transparent; border-color: transparent; }
  .menu-open .wordmark,
  .menu-open .menu-btn { color: var(--glass-mist); }
  .menu-open body { overflow: hidden; }
}

/* ---------- Layout helpers ---------- */
.section { padding: clamp(4.5rem, 11vw, 9rem) var(--gutter); }
.section__inner { max-width: var(--max); margin: 0 auto; }
.section--sage { background: var(--glass-sage); }
.section--lead { background: var(--lead); color: var(--glass-mist); }
.section--heart { background: var(--wood-heart); color: var(--glass-mist); }
.section--lead .soft,
.section--heart .soft { color: var(--glass-mist); opacity: 0.88; }
.soft { color: var(--text-soft); }
.lede { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.5; max-width: 32em; }
.stack > * + * { margin-top: 1.5rem; }
.head { display: grid; gap: 1.25rem; margin-bottom: clamp(2.25rem, 5vw, 4rem); }

.btn {
  display: inline-block;
  padding: 0.9rem 1.75rem;
  border: 1px solid currentColor;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { background: var(--lead); border-color: var(--lead); color: var(--glass-mist); }
.btn--solid { background: var(--lead); border-color: var(--lead); color: var(--glass-mist); }
.btn--solid:hover { background: transparent; color: var(--lead); }
.section--lead .btn:hover,
.section--heart .btn:hover { background: var(--glass-mist); border-color: var(--glass-mist); color: var(--lead); }
.section--heart .btn--solid,
.section--lead .btn--solid { background: var(--glass-mist); border-color: var(--glass-mist); color: var(--lead); }
.section--heart .btn--solid:hover,
.section--lead .btn--solid:hover { background: transparent; color: var(--glass-mist); }
.btns { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }

.link {
  text-decoration: underline;
  text-decoration-color: var(--taupe);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  font-weight: 500;
}
.link:hover { text-decoration-color: currentColor; }
.section--lead .link, .section--heart .link { text-decoration-color: var(--glass-sage); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: calc(100svh - var(--header-h));
  min-height: max(30rem, calc(100svh - var(--header-h)));
  overflow: hidden;
  background: var(--glass-sage);
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: settle 2.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(231, 234, 221, 0.96) 0%, rgba(231, 234, 221, 0.82) 38%, rgba(231, 234, 221, 0) 72%);
  pointer-events: none;
}
.hero__text {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(2.5rem, 7vw, 5rem);
  animation: rise 1.4s 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero h1 { max-width: 11em; }
.hero p { margin-top: 1.5rem; font-size: clamp(1.15rem, 2vw, 1.4rem); max-width: 28em; }
@media (min-width: 860px) {
  .hero::after {
    background: linear-gradient(to right, rgba(231, 234, 221, 0.93) 0%, rgba(231, 234, 221, 0.78) 34%, rgba(231, 234, 221, 0) 62%);
  }
  .hero__text { padding-bottom: clamp(3.5rem, 9vh, 6rem); }
}
@keyframes settle {
  from { opacity: 0; transform: scale(1.045); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Page intro (inner pages) ---------- */
.intro { padding: clamp(3.5rem, 9vw, 7rem) var(--gutter) clamp(2rem, 5vw, 3.5rem); }
.intro__inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 1.75rem; }
.intro h1 { max-width: 12em; }

/* ---------- Casa tiles ---------- */
.tiles { display: grid; gap: 1rem; max-width: var(--max); margin: 0 auto; }
@media (min-width: 760px) { .tiles--two { grid-template-columns: 1fr 1fr; gap: 1.25rem; } }
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  color: var(--glass-mist);
  text-decoration: none;
  background: var(--lead);
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.035); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(31, 28, 23, 0.82) 0%, rgba(31, 28, 23, 0.5) 34%, rgba(31, 28, 23, 0) 62%);
}
.tile__body {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  display: grid;
  gap: 0.35rem;
}
.tile__status { font-weight: 500; }
.tile__name { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; }
.tile__text { max-width: 26em; }
@media (min-width: 760px) {
  .tiles--stack .tile { aspect-ratio: 16 / 8; }
}

/* ---------- Split (image + text) ---------- */
.split { display: grid; gap: clamp(2rem, 5vw, 5rem); align-items: center; max-width: var(--max); margin: 0 auto; }
@media (min-width: 860px) {
  .split { grid-template-columns: 5fr 6fr; }
  .split--flip { grid-template-columns: 6fr 5fr; }
  .split--flip > :first-child { order: 2; }
}
.frame { overflow: hidden; background: var(--glass-sage); }
.frame img { width: 100%; height: auto; }
.frame--portrait { aspect-ratio: 4 / 5; }
.frame--portrait img { height: 100%; object-fit: cover; }

/* ---------- Lists ---------- */
.rows { max-width: var(--max); margin: 0 auto; border-top: 1px solid var(--rule); }
.row { display: grid; gap: 0.75rem 3rem; padding: clamp(1.75rem, 4vw, 3rem) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 860px) { .row { grid-template-columns: 5fr 6fr; } }
.section--lead .rows, .section--lead .row { border-color: rgba(231, 234, 221, 0.25); }

.gallery { display: grid; gap: 1rem; max-width: var(--max); margin: 0 auto; }
@media (min-width: 760px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery .frame { aspect-ratio: 4 / 5; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Contact ---------- */
.big-mail {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 6.2vw, 4.25rem);
  line-height: 1.1;
  text-decoration: underline;
  text-decoration-color: var(--taupe);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}
.big-mail:hover { text-decoration-color: currentColor; }
.section--heart .big-mail { text-decoration-color: var(--wood-honey); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

/* ---------- Pull quote ---------- */
.pullquote {
  margin: 0;
  max-width: 24em;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.pullquote p { margin: 0; max-width: none; }
.stack > .pullquote--plain { margin-top: 1.75rem; }
.pullquote--plain { font-style: normal; font-size: clamp(1.7rem, 3.8vw, 3rem); max-width: 26em; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--iron);
  color: var(--glass-mist);
  padding: clamp(3.5rem, 8vw, 6rem) var(--gutter) 2rem;
}
.footer__grid { max-width: var(--max); margin: 0 auto; display: grid; gap: 2.5rem; }
@media (min-width: 860px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }
.footer__brand { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; }
.footer__col { display: grid; gap: 0.5rem; align-content: start; }
.footer__col h2 { font-family: var(--font-text); font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--glass-sage); margin-bottom: 0.4rem; }
.footer__col a { text-decoration: none; }
.footer__col a:hover { text-decoration: underline; text-decoration-color: var(--taupe); text-underline-offset: 0.3em; }
.footer__base { max-width: var(--max); margin: clamp(2.5rem, 6vw, 4.5rem) auto 0; padding-top: 1.5rem; border-top: 1px solid rgba(231, 234, 221, 0.18); color: var(--glass-sage); font-size: 0.95rem; }

/* ---------- Scroll reveal (images only, gentle) ---------- */
.js .reveal { opacity: 0; transition: opacity 1.1s ease; }
.js .reveal.in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__text, .hero__img { animation: none; }
  .js .reveal { opacity: 1; transition: none; }
  .tile img { transition: none; }
  .tile:hover img, .tile:focus-visible img { transform: none; }
}
