/* ==========================================================================
   TRIBA — Public website
   Visual principle: heat, not fire. Warm, editorial, restrained.
   ========================================================================== */

:root {
  --obsidian:      #14100c;
  --espresso:      #1b140d;
  --espresso-lift: #221a10;
  --ivory:         #f4eee2;
  --ivory-soft:    #d9cfbd;
  --muted:         #a99d87;
  --muted-dim:     #8d8168;
  --clay:          #c98657;
  --copper:        #9c5f37;
  --hairline:      rgba(244, 238, 226, 0.10);
  --hairline-soft: rgba(244, 238, 226, 0.06);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 36rem;
  --gutter: clamp(1.5rem, 6vw, 6rem);
  --section-y: clamp(3.5rem, 9vh, 7rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--obsidian);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--ivory);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.02rem, 0.4vw + 0.96rem, 1.15rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* ---- Ambient warmth: restrained, static, not a signature mark -------- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 60% at 50% 110%, rgba(201, 134, 87, 0.10) 0%, rgba(20, 16, 12, 0) 60%),
    radial-gradient(70% 45% at 85% -10%, rgba(201, 134, 87, 0.05) 0%, rgba(20, 16, 12, 0) 60%);
}

header, main, footer { position: relative; z-index: 2; }

/* ---- Layout ------------------------------------------------------------ */
.shell { max-width: 74rem; margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: var(--measure); }
section { padding-block: var(--section-y); }
/* Comfortable clearance under the sticky header after anchor navigation
   (nav links, "Discover why TRIBA", in-page "Start a conversation"). */
section[id] { scroll-margin-top: 8rem; }
.rule { border: 0; height: 1px; background: var(--hairline-soft); max-width: 74rem; margin: 0 auto; }

/* ---- Type ---------------------------------------------------------------- */
h1, h2, h3 { font-weight: 400; margin: 0; letter-spacing: -0.015em; line-height: 1.08; }
p { margin: 0 0 1.3em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }

.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 1.5rem;
}

.display {
  font-size: clamp(2.4rem, 6.6vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

h2.section-title {
  font-size: clamp(1.7rem, 3.8vw, 2.7rem);
  line-height: 1.12;
  max-width: 24ch;
}

.body-copy { color: var(--ivory-soft); font-size: clamp(1.02rem, 0.4vw + 0.98rem, 1.2rem); line-height: 1.6; }
.lede { color: var(--ivory); }

/* ---- Header -------------------------------------------------------------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(20, 16, 12, 0.82), rgba(20, 16, 12, 0.55) 70%, transparent);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-head.scrolled {
  background: rgba(20, 16, 12, 0.94);
  border-bottom-color: var(--hairline-soft);
  box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.6);
}
.head-inner {
  max-width: 74rem;
  margin-inline: auto;
  padding: 0.8rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand-logo img {
  display: block;
  height: 26px;
  width: auto;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--ivory);
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 1.15rem; height: 1.15rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 3vw, 2.4rem);
}
.site-nav .nav-links {
  display: flex;
  gap: clamp(1.2rem, 2.6vw, 2.2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a.nav-link {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ivory-soft);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.site-nav a.nav-link:hover,
.site-nav a.nav-link:focus-visible { color: var(--ivory); }

/* ---- Buttons ------------------------------------------------------------- */
.btn-primary {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--obsidian);
  background: var(--clay);
  padding: 0.82rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--clay);
  display: inline-block;
  cursor: pointer;
  transition: background 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: #d99a6c;
  border-color: #d99a6c;
  transform: translateY(-1px);
}

.text-link {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ivory-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hairline);
}
.text-link:hover, .text-link:focus-visible { color: var(--ivory); text-decoration-color: var(--clay); }

/* ---- Hero ---------------------------------------------------------------- */
.hero { padding-top: clamp(4.5rem, 13vh, 8rem); padding-bottom: var(--section-y); }
.hero .display { max-width: 18ch; }
.hero-sub {
  max-width: 42rem;
  margin-top: 1.8rem;
  font-size: clamp(1.08rem, 0.5vw + 1rem, 1.28rem);
  color: var(--ivory-soft);
  line-height: 1.55;
}
.hero-actions {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.6rem;
}

/* ---- Principles grid ------------------------------------------------------ */
.principles {
  display: grid;
  gap: clamp(2rem, 4.5vw, 3rem);
  margin-top: 3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .principles { grid-template-columns: repeat(3, 1fr); }
}
.principle { padding-top: 1.4rem; border-top: 1px solid var(--hairline); }
.principle h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--ivory);
  margin-bottom: 0.7rem;
}
.principle p { color: var(--ivory-soft); font-size: 1rem; line-height: 1.5; }
.principle:nth-child(2) { transition-delay: 0.08s; }
.principle:nth-child(3) { transition-delay: 0.16s; }

/* ---- Emotional statement --------------------------------------------------- */
.statement {
  text-align: left;
}
.statement .display { max-width: 14ch; }
.statement .statement-sub {
  margin-top: 1.6rem;
  max-width: 34rem;
  color: var(--ivory-soft);
  font-size: clamp(1.1rem, 0.5vw + 1rem, 1.3rem);
}

/* ---- Contact --------------------------------------------------------------- */
.contact .prose { max-width: 40rem; }
form.enquiry { margin-top: 2rem; max-width: 40rem; }
.field { margin-bottom: 1.3rem; }
.field > label, fieldset.field > legend {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
  padding: 0;
  border: 0;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--espresso);
  color: var(--ivory);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.6rem 0.85rem;
  transition: border-color 0.3s var(--ease);
}
.field textarea { resize: vertical; min-height: 5.5rem; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-dim); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--clay); }
.field.invalid input, .field.invalid textarea { border-color: #c96a4f; }
.field-error {
  display: none;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: #e0a48a;
  margin-top: 0.5rem;
}
.field.invalid .field-error { display: block; }

fieldset.field {
  border: 0;
  padding: 0;
  margin: 0 0 1.3rem;
}
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
}
.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.94rem;
  color: var(--ivory-soft);
}
.radio-option input { width: 1rem; height: 1rem; accent-color: var(--clay); }

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem 2rem;
  margin-top: 1.5rem;
}
.privacy-note {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 32rem;
  margin-top: 1.4rem;
}

.form-status {
  display: none;
  margin-top: 2.4rem;
  padding: 1.6rem 0 0;
  border-top: 1px solid var(--hairline);
  max-width: 38rem;
}
.form-status.show { display: block; }
.form-status p { color: var(--ivory); font-size: 1.1rem; }
.form-status .status-sub { color: var(--muted); font-size: 0.95rem; margin-top: 0.6rem; }
.form-status.is-error #form-status-headline { color: #e0a48a; }

/* ---- Footer ---------------------------------------------------------------- */
footer.site-foot { padding-block: clamp(4rem, 9vh, 6.5rem) 3rem; border-top: 1px solid var(--hairline-soft); }
.foot-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  align-items: flex-start;
}
.foot-brand .brand-logo img { height: 28px; }
.foot-brand .tagline {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.6rem;
}
.foot-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.foot-links a {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ivory-soft);
  text-decoration: none;
}
.foot-links a:hover, .foot-links a:focus-visible { color: var(--ivory); }
.copyright {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--muted-dim);
  letter-spacing: 0.03em;
  margin-top: 3rem;
}

/* ---- Reveal on scroll -------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Focus & accessibility --------------------------------------------------- */
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 2px; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--clay);
  color: var(--obsidian);
  font-family: var(--sans);
  font-weight: 500;
  padding: 0.7rem 1.1rem;
  z-index: 100;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Draft legal page ---------------------------------------------------------- */
.legal-notice {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--clay);
  border: 1px solid rgba(201, 134, 87, 0.35);
  background: rgba(201, 134, 87, 0.06);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 40rem;
}

/* ---- Responsive: mobile nav ------------------------------------------------------ */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--espresso);
    border-bottom: 1px solid var(--hairline-soft);
    padding: 0.5rem var(--gutter) 1.5rem;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav .nav-links {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  .site-nav .nav-links a { display: block; padding: 0.85rem 0; border-top: 1px solid var(--hairline-soft); }
  .site-nav .nav-links li:first-child a { border-top: 0; }
  .site-nav .btn-primary { margin-top: 1rem; width: 100%; text-align: center; }
}
