/* =====================================================================
   21st Castle — shared design layer (all pages)
   Loaded AFTER each page's own <style>, so rules here refine the base
   styles: modern-minimal typography, spacing and surfaces, plus the
   classes used by assets/site.js for motion.
   ===================================================================== */

/* ============ TOKENS ============ */
:root {
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* Charcoal & Terracotta, refined */
  --charcoal: #1f1d1b;
  --charcoal-2: #2a2724;
  --accent: #b85c35;
  --accent-light: #dc9471;
  --accent-deep: #9a4826;
  --cream: #f6f2ec;
  --sand: #ebe3d7;            /* supporting tone for alternating light sections */
  --paper: #fcfaf6;
  --text-soft: rgba(255, 255, 255, 0.72);

  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --section-pad: clamp(96px, 12vw, 184px);
}

html { background: var(--charcoal); }
html:not(.lenis) { scroll-behavior: smooth; }

/* Hidden until site.js has put the loader up (a head script reveals it after 4s if JS fails) */
html.js:not(.ready) body { opacity: 0; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: -0.005em;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

/* ============ TYPOGRAPHY ============ */
.section-title,
.banner-copy h1,
.hero-tagline {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.section-title { font-size: clamp(40px, 5.4vw, 84px); }
.section-title, .hero-tagline span, .banner-copy h1, .about-cta p { text-wrap: balance; }
.block-head .section-title,
.philosophy .section-title { font-size: clamp(36px, 4.4vw, 68px); }

.section-title em,
.banner-copy h1 em {
  font-style: normal;
  font-weight: 300;
  color: var(--accent-deep);
}

[data-theme="dark"] .section-title em,
.banner-copy h1 em { color: var(--accent-light); }

.hero-tagline { font-size: clamp(44px, 6.6vw, 112px); letter-spacing: -0.045em; text-shadow: 0 6px 40px rgba(0, 0, 0, 0.35); }
.hero-tagline strong { font-weight: 500; }

.banner-copy h1 { font-size: clamp(56px, 9vw, 152px); letter-spacing: -0.05em; line-height: 0.95; }

/* Eyebrow: small label with a dot instead of a rule */
.section-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  gap: 12px;
}

.section-eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.block-intro,
.journey-intro,
.content-frame p,
.intro-copy p,
.contact-info > p,
.visit-copy p { font-size: 17px; line-height: 1.75; }

.block-head { gap: 22px; margin-bottom: clamp(56px, 7vw, 104px); max-width: 820px; }

/* Display-face headings across components */
.half-title, .tile-name, .stat strong, .pillar h4, .pillar-card h3, .director-name,
.journey-count, .journey-entry h3, .t-quote, .t-year, .t-copy h3, .enquiry-card h2,
.form-success h3, .about-cta p, .menu-list a, .journey-ph {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.half-title, .tile-name, .pillar h4, .pillar-card h3, .director-name,
.journey-entry h3, .t-copy h3, .enquiry-card h2, .form-success h3, .about-cta p { font-weight: 400; }

.journey-ph { font-style: normal; font-size: 18px; }

/* ============ BUTTONS: pills ============ */
.btn {
  border-radius: 999px;
  padding: 16px 30px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  gap: 12px;
  will-change: transform;
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out), border-color 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}

.btn svg { width: 15px; height: 15px; }
/* Enquire button only belongs to the scrolled bar (desktop); .btn's display would otherwise show it everywhere */
.nav-cta { padding: 12px 22px; display: none; }
@media (min-width: 1200px) {
  .navbar.scrolled .nav-cta { display: inline-flex; }
}

.video-btn, .search-btn, .menu-btn, .close-btn { will-change: transform; transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.5s var(--ease-out); }

/* ============ SECTIONS: more air, sand for alternate light sections ============ */
.corporate, .projects, .testimonials, .section { padding-top: var(--section-pad); padding-bottom: var(--section-pad); }
.journey { padding-top: var(--section-pad); }

.testimonials,
#journey.section[data-theme="light"] { background: var(--sand); }
#journey.section[data-theme="light"] .t-item::before { background: var(--sand); }

.projects-head,
.testimonials-head,
.journey-head { gap: 22px; margin-bottom: clamp(56px, 7vw, 104px); }

/* ============ NAVBAR + MENU ============ */
.navbar.scrolled {
  background: rgba(31, 29, 27, 0.96);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-btn, .close-btn { font-size: 13px; letter-spacing: 0.14em; font-weight: 500; }

/* Menu: curtain drop + staggered links */
.menu-overlay {
  background: var(--charcoal);
  opacity: 1;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s var(--ease), visibility 0.9s;
}

.menu-open .menu-overlay { clip-path: inset(0 0 0 0); }

.menu-list a {
  font-size: clamp(40px, 6.4vw, 96px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.menu-list li { overflow: hidden; }
.menu-list li a { transform: translateY(105%); transition: transform 0.9s var(--ease-out), translate 0.4s var(--ease-out), color 0.3s ease; }
.menu-open .menu-list li a { transform: translateY(0); }
.menu-open .menu-list li:nth-child(1) a { transition-delay: 0.25s; }
.menu-open .menu-list li:nth-child(2) a { transition-delay: 0.31s; }
.menu-open .menu-list li:nth-child(3) a { transition-delay: 0.37s; }
.menu-open .menu-list li:nth-child(4) a { transition-delay: 0.43s; }
.menu-open .menu-list li:nth-child(5) a { transition-delay: 0.49s; }
.menu-open .menu-list li:nth-child(6) a { transition-delay: 0.55s; }
.menu-list li a:hover { translate: 14px 0; }

/* ============ HERO + BANNER ============ */
.hero-bg,
.page-banner > img { scale: 1.18; transition: scale 2.6s var(--ease-out); will-change: transform; }
.is-loaded .hero-bg,
.is-loaded .page-banner > img { scale: 1.06; }

.js .hero-bottom, .js .banner-copy .breadcrumb, .js .about-tabs {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 1.2s var(--ease-out) 0.9s, translate 1.2s var(--ease-out) 0.9s;
}

.is-loaded .hero-bottom,
.is-loaded .banner-copy .breadcrumb,
.is-loaded .about-tabs { opacity: 1; translate: 0 0; }

.project-name { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; }

/* Scroll cue at the bottom of the hero / banner */
.scroll-cue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 22px;
  width: 1px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  translate: -50% 0;
}

.scroll-cue::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-light);
  animation: cue 2.2s var(--ease) infinite;
}

@keyframes cue {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

/* ============ SURFACES: no frames, no heavy shadows ============ */
.video-wrap::before,
.intro-media::before,
.enquiry-wrap::before { display: none; }

.video-frame, .intro-media img { box-shadow: none; }

.stats { border-color: var(--line); }
.stat { padding: 26px 12px; }
.stat strong { font-weight: 300; font-size: clamp(36px, 3.6vw, 52px); letter-spacing: -0.04em; }
.stat strong small { font-weight: 400; }

.pillar-icon,
.info-icon {
  border-radius: 50%;
  background: transparent;
}

.pillar h4 { font-size: 30px; }
.pillar-num { font-family: var(--font-body); font-size: 12px; letter-spacing: 0.14em; }

/* Projects */
.project-tile { border: 0; background: radial-gradient(120% 80% at 50% 0%, rgba(184, 92, 53, 0.16), transparent 60%), var(--charcoal-2); }
.project-tile img { transition: transform 1.4s var(--ease-out); }
.project-tile:hover img { transform: scale(1.07); }
.half-title { font-size: clamp(26px, 2.4vw, 36px); border-bottom-color: rgba(255, 255, 255, 0.1); }
.tile-name { font-size: clamp(26px, 2.4vw, 38px); }

.tile-status {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  color: #fff;
  letter-spacing: 0.14em;
}

/* Journey tower */
.journey { background: var(--charcoal); }
.journey-count { font-weight: 200; letter-spacing: -0.06em; }
.journey-entry h3 { font-size: clamp(30px, 3.2vw, 48px); }
.journey-copy.multi .journey-entry h3 { font-size: clamp(21px, 1.9vw, 28px); }
.floor { border-color: rgba(184, 92, 53, 0.25); }

/* Testimonials */
.t-tile { border: 0; box-shadow: none; background: var(--paper); }
.t-tile.dark { background: var(--charcoal); }
.t-quote { font-weight: 400; font-size: 19px; line-height: 1.4; }
.t-tile:nth-child(3) .t-quote { font-size: 23px; }
.t-tile:nth-child(1) .t-quote,
.t-tile:nth-child(8) .t-quote { font-size: 21px; }

/* About page */
.director-card { border: 0; background: transparent; }
.director-card:hover { transform: none; }
.director-photo { overflow: hidden; }
.director-photo > * { transition: transform 1.2s var(--ease-out); }
.director-card:hover .director-photo > * { transform: scale(1.06); }
.director-body { padding: 26px 0 0; }
.director-name { font-size: 30px; }
.director-initials { font-family: var(--font-display); font-weight: 300; letter-spacing: -0.02em; }
.director-focus { border-top-color: rgba(255, 255, 255, 0.1); }
.director-focus li { border-radius: 999px; padding: 6px 12px; }

/* Bio lead is clamped to 3 lines until "Read more" opens the card */
.director-body > p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.director-body.expanded > p { display: block; -webkit-line-clamp: unset; line-clamp: unset; }

/* Desktop: the whole Leadership section fits one screen below the navbar.
   Photo slot is a short landscape frame (portraits crop from the top). */
@media (min-width: 1025px) {
  #directors.section {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: calc(var(--nav-h) + clamp(12px, 3vh, 48px));
    padding-bottom: clamp(20px, 4vh, 64px);
  }
  #directors .section-inner { width: 100%; }

  #directors .block-head {
    max-width: none;
    margin-bottom: clamp(24px, 4vh, 48px);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 48px;
    text-align: left;
  }
  #directors .block-head .section-eyebrow { flex-basis: 100%; }
  #directors .block-head .section-title { font-size: clamp(28px, min(3.2vw, 5.4vh), 54px); }
  #directors .block-intro { max-width: 440px; font-size: 15px; line-height: 1.65; }

  #directors .director-photo { aspect-ratio: auto; height: clamp(96px, 18vh, 240px); }
  #directors .director-photo img { object-position: center 20%; }
  #directors .director-initials { width: clamp(64px, 9vh, 96px); height: clamp(64px, 9vh, 96px); font-size: clamp(24px, 3.4vh, 36px); }

  #directors .director-body { padding-top: clamp(12px, 2.2vh, 24px); gap: clamp(5px, 0.9vh, 8px); }
  #directors .director-name { font-size: clamp(22px, 1.8vw, 28px); }
  #directors .director-badge { margin: 2px 0; }
  #directors .director-body p { font-size: 14px; line-height: 1.65; }
  #directors .director-focus { padding-top: clamp(8px, 1.4vh, 12px); }
}

/* Short laptop screens: show 2 lines of each bio before "Read more" */
@media (min-width: 1025px) and (max-height: 720px) {
  #directors .director-body > p { -webkit-line-clamp: 2; line-clamp: 2; }
}

.t-year { font-weight: 200; letter-spacing: -0.05em; }
/* Upcoming: a dashed border breaks up on the tiny diamond, so use a lighter solid one */
.t-item.future::before { border-style: solid; border-color: rgba(184, 92, 53, 0.45); }
.t-media { box-shadow: none; }

.pillar-card { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); background: transparent; padding: 32px 0 0; }
.pillar-card:hover { border-top-color: var(--accent); }
.pillar-card h3 { font-size: 34px; }
.pillar-num { color: var(--accent-light); }

/* Contact page */
.enquiry-card form > p { font-size: 15px; line-height: 1.7; color: var(--ink-soft); margin: 4px 0 32px; }
.enquiry-card { border: 0; box-shadow: 0 40px 80px -60px rgba(31, 29, 27, 0.5); background: var(--paper); }
.map-frame { border: 0; }

/* ============ MOTION (classes set by assets/site.js) ============ */

/* Word-by-word headline rise */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split .wi { display: inline-block; transform: translateY(110%); transition: transform 1.2s var(--ease-out); transition-delay: calc(var(--i, 0) * 0.06s); }
.split.in .wi { transform: translateY(0); }

/* Generic fade-up */
.rv { opacity: 0; translate: 0 40px; transition: opacity 1.1s var(--ease-out), translate 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; translate: 0 0; }

/* Image wipe: container unclips upward while the image settles */
.rv-img { clip-path: inset(100% 0 0 0); transition: clip-path 1.5s var(--ease); transition-delay: var(--d, 0s); }
.rv-img.in { clip-path: inset(0 0 0 0); }
.rv-img > img,
.rv-img > video { scale: 1.25; transition: scale 2s var(--ease-out); transition-delay: var(--d, 0s); }
.rv-img.in > img,
.rv-img.in > video { scale: 1.08; }
/* Project tiles keep their hover zoom alongside the reveal scale */
.rv-img.project-tile > img,
.rv-img.row-media > img { transition: scale 2s var(--ease-out), transform 1.4s var(--ease-out); }

/* Scroll progress */
.scroll-progress {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  pointer-events: none;
}

/* Intro loader + page-transition curtain */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--charcoal);
  display: grid;
  place-items: center;
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--ease);
}

.curtain.up   { clip-path: inset(0 0 100% 0); }          /* lifted off the page */
.curtain.down { clip-path: inset(100% 0 0 0); transition: none; } /* parked below, ready to rise */

.curtain-inner { display: grid; justify-items: center; gap: 26px; transition: opacity 0.5s ease, translate 0.8s var(--ease); }
.curtain.up .curtain-inner { opacity: 0; translate: 0 -40px; }

.curtain-logo { height: 76px; width: auto; opacity: 0; animation: logoIn 1s var(--ease-out) 0.15s forwards; }
.curtain-bar { width: 160px; height: 1px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.curtain-bar span { display: block; height: 100%; background: var(--accent-light); transform: scaleX(0); transform-origin: left; }
.curtain-count { font: 300 13px/1 var(--font-body); letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }
.curtain.quick .curtain-bar,
.curtain.quick .curtain-count { display: none; }

@keyframes logoIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* Custom cursor (fine pointers only; JS adds .has-cursor) */
.has-cursor, .has-cursor * { cursor: none; }
.has-cursor input, .has-cursor textarea { cursor: text; }
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  pointer-events: none;
  border-radius: 50%;
}

.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }

.cursor-ring {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid rgba(184, 92, 53, 0.6);
  display: grid;
  place-items: center;
  font: 500 11px/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), margin 0.4s var(--ease-out), background 0.4s ease, border-color 0.4s ease, opacity 0.3s ease;
}

.cursor-ring span { opacity: 0; transition: opacity 0.3s ease; }

.cursor-ring.hover { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(184, 92, 53, 0.12); border-color: var(--accent); }
.cursor-ring.view { width: 92px; height: 92px; margin: -46px 0 0 -46px; background: var(--accent); border-color: var(--accent); }
.cursor-ring.view span { opacity: 1; }
.cursor-ring.hidden, .cursor-dot.hidden { opacity: 0; }

/* ============ FOOTER (all pages) ============ */
.site-footer {
  background: #161513;
  color: var(--text-soft);
  padding: clamp(64px, 8vw, 112px) clamp(16px, 5vw, 72px) 32px;
}

.footer-inner,
.footer-bottom { max-width: 1320px; margin: 0 auto; }

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: clamp(32px, 4vw, 64px);
  padding-bottom: clamp(48px, 6vw, 80px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.footer-brand .brand-logo { height: 72px; }
.footer-brand p { font-size: 15px; }

.footer-social { display: flex; gap: 12px; }

.footer-social a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transition: background 0.3s ease, color 0.3s ease;
}

.footer-social a:hover { background: var(--accent); }
.footer-social svg { width: 20px; height: 20px; }

.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }

.footer-col h3 {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
}

.footer-col a,
.footer-legal a { font-size: 15px; transition: color 0.3s ease; }
.footer-col a:hover,
.footer-legal a:hover { color: var(--accent-light); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 28px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-legal { display: flex; gap: 28px; }
.footer-legal a { font-size: 13px; }

@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ============ PHONES ============ */
@media (max-width: 640px) {
  .scroll-cue { display: none; }
  .hero-tagline { letter-spacing: -0.03em; }
  .banner-copy h1 { letter-spacing: -0.04em; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .hero-bg, .page-banner > img, .hero-bottom, .banner-copy .breadcrumb, .about-tabs, .menu-list li a {
    transition: none !important;
    transform: none !important;
    translate: none !important;
    opacity: 1 !important;
  }
  .menu-overlay { transition: visibility 0s !important; }
  .scroll-cue::after { animation: none; }
}
