/* ============================================================
   UF Capital — styles.css
   Quiet, precise, expensive. Hand-written CSS, tokens only.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --ink:        #101820;
  --midnight:   #1B2A3A;
  --ivory:      #F4EFE6;
  --stone:      #8C8578;
  --gold:       #B99358;
  --gold-soft:  #D7C39A;
  --gold-ink:   #9A7A45; /* darkened gold for small text on ivory (AA) */

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body:    "Jost", "Helvetica Neue", Arial, sans-serif;

  --maxw: 1240px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --sec-y: clamp(4.5rem, 9vw, 9rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Anchor targets clear the fixed header when jumped to via #hash nav links. */
:where(#about, #services, #why, #approach, #portfolio, #faq, #contact) {
  scroll-margin-top: 6rem;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; padding: 0; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 200;
  background: var(--gold); color: var(--ink);
  padding: 0.6rem 1rem; font-size: 13px; letter-spacing: 0.08em;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.wrap--narrow { max-width: 820px; }
.section { padding-block: var(--sec-y); }
.section--ivory { background: var(--ivory); color: var(--ink); }
.section--midnight { background: var(--midnight); color: var(--ivory); }
.section--ink { background: var(--ink); color: var(--ivory); }

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
}
.section--ivory .eyebrow { color: var(--gold-ink); }

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 2.8rem;
  max-width: 22ch;
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 400;
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn--lg { padding: 1.1rem 2.2rem; }
.btn--outline {
  border: 1px solid var(--gold);
  color: var(--gold);
}
.btn--outline:hover, .btn--outline:focus-visible { background: var(--gold); color: var(--ink); }
.btn--solid {
  border: 1px solid var(--gold);
  background: var(--gold); color: var(--ink);
}
.btn--solid:hover, .btn--solid:focus-visible { background: var(--gold-soft); border-color: var(--gold-soft); }

.link-arrow {
  position: relative;
  font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ivory);
  padding-bottom: 4px;
}
.link-arrow span { transition: transform 0.4s var(--ease); display: inline-block; }
.link-arrow::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.link-arrow:hover::after, .link-arrow:focus-visible::after { transform: scaleX(1); }
.link-arrow:hover span { transform: translateY(3px); }

/* focus visibility */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav__inner {
  max-width: var(--maxw); margin-inline: auto; padding: 2.75rem var(--pad) 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  transition: padding 0.4s var(--ease);
}
.nav[data-scrolled] {
  background: var(--ink);
  border-bottom-color: var(--gold);
}
.nav[data-scrolled] .nav__inner { padding-block: 1rem; }

.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--ivory); }
.brand__mark { color: var(--gold); flex: none; }
.brand__word {
  font-family: var(--font-body); font-weight: 400;
  font-size: 15px; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--ivory);
}

.nav__links { display: flex; align-items: center; gap: clamp(1.2rem, 2.5vw, 2.4rem); }
.nav__links > a:not(.btn) {
  position: relative; color: var(--ivory);
  font-size: 14px; letter-spacing: 0.1em;
  padding-bottom: 4px;
}
.nav__links > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav__links > a:not(.btn):hover::after,
.nav__links > a:not(.btn):focus-visible::after { transform: scaleX(1); }

.nav__toggle { display: none; width: 40px; height: 40px; flex-direction: column; justify-content: center; gap: 6px; }
.nav__toggle span { display: block; height: 1px; width: 26px; margin-inline: auto; background: var(--ivory); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }

/* ---------- Mobile overlay menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 150;
  background: var(--ink); color: var(--ivory);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.4s var(--ease);
  /* Closed menu stays in the layout (display:flex overrides [hidden]) at
     opacity:0 — which still intercepts clicks across the whole viewport.
     Make it click-through until it is actually open. */
  pointer-events: none;
}
.menu[data-open] { opacity: 1; pointer-events: auto; }
.menu__close { position: absolute; top: 1.5rem; right: var(--pad); color: var(--gold); }
.menu__links { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.menu__links a {
  font-family: var(--font-display); font-weight: 500; font-size: 32px;
  color: var(--ivory); transition: color 0.3s var(--ease);
}
.menu__links a:hover, .menu__links a:focus-visible { color: var(--gold); }

/* ============================================================
   SIGNATURE FRAME
   ============================================================ */
.frame { pointer-events: none; }
.frame--hero {
  position: absolute; inset: 24px; z-index: 3;
}
.frame__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame__rect { stroke: var(--gold); stroke-width: 1; }
.frame__rect--outer {
  stroke-dasharray: 400; stroke-dashoffset: 400;
}
.frame__inner {
  position: absolute; inset: 6px;
  border: 0.75px solid var(--gold); opacity: 0.55;
}
@media (max-width: 640px) { .frame--hero { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  color: var(--ivory); overflow: hidden;
  padding-block: 8rem 4rem;
}
.hero__media { position: absolute; inset: 0; z-index: 1; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(16,24,32,0.55) 0%, rgba(16,24,32,0.35) 40%, rgba(16,24,32,0.85) 100%),
    radial-gradient(120% 80% at 50% 40%, rgba(16,24,32,0) 40%, rgba(16,24,32,0.6) 100%);
}
.hero__content {
  position: relative; z-index: 4;
  max-width: var(--maxw); width: 100%; margin-inline: auto;
  padding-inline: clamp(2rem, 6vw, 5rem);
}
.hero__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin-bottom: 1.8rem; max-width: 16ch;
}
.hero__subline {
  font-weight: 300; font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.7; max-width: 52ch; color: var(--ivory);
  margin-bottom: 2.6rem;
}
.hero__actions { display: flex; align-items: center; gap: clamp(1.5rem, 3vw, 2.5rem); flex-wrap: wrap; }

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 5rem);
  align-items: start; margin-bottom: clamp(3.5rem, 7vw, 6rem);
}
.about__pull {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.22;
  letter-spacing: -0.01em; color: var(--ink);
}
.about__body { font-weight: 300; color: #3a4048; max-width: 46ch; }

/* Stats */
.stats { position: relative; padding: clamp(2.2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem); }
.stats__frame {
  position: absolute; inset: 0; border: 1px solid var(--gold);
}
.stats__frame::before {
  content: ""; position: absolute; inset: 6px; border: 0.75px solid var(--gold); opacity: 0.5;
}
.stats__list {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 2rem; text-align: center;
}
.stat { display: flex; flex-direction: column; gap: 0.5rem; }
.stat__num {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem); line-height: 1; color: var(--ink);
  letter-spacing: -0.01em;
}
.stat__label {
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone);
}

/* ============================================================
   SERVICES — ledger
   ============================================================ */
.ledger { border-top: 1px solid rgba(185,147,88,0.4); }
.ledger__row {
  display: grid;
  grid-template-columns: 90px 1fr 64px;
  align-items: center; gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(1.8rem, 4vw, 2.6rem);
  border-bottom: 1px solid rgba(185,147,88,0.4);
  transition: padding-left 0.5s var(--ease);
}
.ledger__row:hover { padding-left: 0.75rem; }
.ledger__num {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2rem, 3.5vw, 2.8rem); color: var(--gold); line-height: 1;
}
.ledger__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.15;
  color: var(--ivory); margin-bottom: 0.5rem;
}
.ledger__desc { font-weight: 300; color: rgba(244,239,230,0.75); max-width: 62ch; }
.ledger__glyph { color: var(--gold); justify-self: end; transition: transform 0.5s var(--ease); }
.ledger__glyph svg { width: 48px; height: 48px; }
.ledger__row:hover .ledger__glyph { transform: translateX(6px); }

/* ============================================================
   WHY THE UK
   ============================================================ */
.why__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.why__col { padding-top: 1.75rem; border-top: 1px solid var(--gold); }
.why__heading {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 0.9rem; color: var(--ink);
}
.why__body { font-weight: 300; color: #3a4048; }

/* ============================================================
   APPROACH — timeline
   ============================================================ */
.timeline {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem); position: relative;
}
.timeline::before {
  content: ""; position: absolute; top: 22px; left: 0; right: 0; height: 1px;
  background: var(--gold); opacity: 0.5;
}
.timeline__step { position: relative; padding-top: 3.5rem; }
.timeline__num {
  position: absolute; top: 0; left: 0;
  font-family: var(--font-display); font-weight: 600; font-size: 1.9rem;
  color: var(--gold); background: var(--ink); padding-right: 1rem; line-height: 1;
}
.timeline__title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem); margin-bottom: 0.6rem; color: var(--ivory);
}
.timeline__desc { font-weight: 300; color: rgba(244,239,230,0.72); }

/* ============================================================
   PORTFOLIO
   ============================================================ */
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.case { overflow: hidden; }
.case__media { overflow: hidden; aspect-ratio: 4 / 5; margin-bottom: 1.4rem; }
.case__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.case:hover .case__media img { transform: scale(1.03); }
.case__place {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 1.5rem; color: var(--ink); margin-bottom: 0.4rem;
}
.case__result { display: block; font-weight: 300; font-size: 15px; color: #4a5057; }

/* ============================================================
   FAQ — accordion
   ============================================================ */
.accordion { border-top: 1px solid rgba(185,147,88,0.4); }
.acc { border-bottom: 1px solid rgba(185,147,88,0.4); }
.acc__h { margin: 0; }
.acc__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  width: 100%; text-align: left; padding-block: 1.5rem;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.15rem, 2vw, 1.5rem); color: var(--ivory);
}
.acc__icon { position: relative; flex: none; width: 20px; height: 20px; }
.acc__icon::before, .acc__icon::after {
  content: ""; position: absolute; background: var(--gold);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.acc__icon::before { top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%); }
.acc__icon::after { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }
.acc__btn[aria-expanded="true"] .acc__icon::after { transform: translateX(-50%) scaleY(0); opacity: 0; }
.acc__panel {
  overflow: hidden;
}
.acc__panel > p {
  padding-bottom: 1.6rem; padding-right: 3rem;
  font-weight: 300; color: rgba(244,239,230,0.78); max-width: 60ch;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact__frame { position: relative; padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4.5rem); }
.contact__frame::before {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--gold); pointer-events: none;
}
.contact__frame::after {
  content: ""; position: absolute; inset: 6px; border: 0.75px solid var(--gold); opacity: 0.5; pointer-events: none;
}
.contact__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.contact__reassure {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.3rem, 2.3vw, 1.7rem); line-height: 1.3; color: var(--ink);
  margin-bottom: 2rem; max-width: 26ch;
}
.contact__details { display: flex; flex-direction: column; gap: 0.6rem; }
.contact__details a {
  position: relative; font-size: 15px; letter-spacing: 0.04em; color: var(--gold-ink);
  padding-bottom: 2px; align-self: flex-start;
}
.contact__details a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.contact__details a:hover::after, .contact__details a:focus-visible::after { transform: scaleX(1); }
.contact__details address {
  font-style: normal; font-size: 15px; letter-spacing: 0.04em;
  line-height: 1.5; color: var(--stone); max-width: 22ch;
}

/* Form */
.contact__form { display: flex; flex-direction: column; gap: 1.9rem; }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field label {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--stone);
}
.field__opt { text-transform: none; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-weight: 300; font-size: 17px;
  color: var(--ink); background: transparent;
  border: none; border-bottom: 1px solid var(--stone);
  padding: 0.5rem 0; border-radius: 0;
  transition: border-color 0.35s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238C8578' stroke-width='1.25'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.25rem center;
  padding-right: 1.75rem;
}
.field textarea { resize: vertical; min-height: 3rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-bottom-color: var(--gold);
}
.contact__form .btn { align-self: flex-start; margin-top: 0.5rem; }

.form__status { font-weight: 300; font-size: 15px; line-height: 1.6; }
.form__status[data-state="success"] { color: var(--gold-ink); }
.form__status[data-state="error"] { color: #8a3a2e; }
.form__status a { color: var(--gold-ink); text-decoration: underline; }

/* Honeypot — visually hidden but still in the layout/DOM (never display:none,
   which bots detect and skip). */
.hp-field {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Per-field validation messages */
.field__error {
  font-family: var(--font-body); font-weight: 400; font-size: 13px;
  letter-spacing: 0.02em; line-height: 1.4; color: #8a3a2e; margin-top: -0.1rem;
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-bottom-color: #8a3a2e; }

/* Success panel that replaces the form */
.form__success-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.3rem, 2.3vw, 1.7rem); line-height: 1.3; color: var(--ink);
  max-width: 30ch;
}
.form__success-sub { margin-top: 1rem; font-size: 15px; line-height: 1.6; color: var(--stone); }
.form__success-sub a { color: var(--gold-ink); text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--ink); color: var(--ivory); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  padding-bottom: 2.5rem; border-bottom: 1px solid rgba(185,147,88,0.3);
}
.footer__brand { display: inline-flex; align-items: center; gap: 0.85rem; }
.footer__brand .brand__mark { color: var(--gold); }
.footer__word { font-size: 14px; letter-spacing: 0.24em; text-transform: uppercase; }
.footer__nav { display: flex; gap: clamp(1rem, 2.5vw, 2rem); flex-wrap: wrap; }
.footer__nav a {
  position: relative; font-size: 13px; letter-spacing: 0.08em; color: rgba(244,239,230,0.8);
  padding-bottom: 3px;
}
.footer__nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.footer__nav a:hover::after, .footer__nav a:focus-visible::after { transform: scaleX(1); }
.footer__base { padding-top: 2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.footer__copy { font-size: 13px; letter-spacing: 0.06em; color: var(--stone); }
.footer__disc { font-size: 11px; line-height: 1.6; color: var(--stone); max-width: 90ch; }

/* ============================================================
   MOTION — reveals
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Hero orchestrated load: reveals wait for JS class, staggered */
.hero .reveal { transition-delay: 0s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .about__grid { grid-template-columns: 1fr; gap: 2rem; }
  .contact__grid { grid-template-columns: 1fr; }
  .stats__list { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; }
}

@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
}

@media (max-width: 768px) {
  .why__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .cases { grid-template-columns: 1fr; gap: 2.5rem; max-width: 480px; margin-inline: auto; }
  .timeline { grid-template-columns: 1fr; gap: 2.25rem; }
  .timeline::before { top: 4px; bottom: 4px; left: 15px; right: auto; width: 1px; height: auto; }
  .timeline__step { padding-top: 0; padding-left: 3.25rem; }
  .timeline__num { position: absolute; left: 0; top: 0; padding: 0.3rem 0; background: var(--ink); }
}

@media (max-width: 640px) {
  .ledger__row { grid-template-columns: 52px 1fr; }
  .ledger__glyph { display: none; }
  .hero__title { font-size: clamp(40px, 12vw, 64px); }
}

@media (max-width: 480px) {
  .stats__list { grid-template-columns: 1fr; gap: 2rem; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .frame__rect--outer { stroke-dashoffset: 0 !important; }
}
