/* =========================================================
   UST — brand site
   Palette: Deep green #02392B · Sage #E7EBE6 · Soft sage #C8D5BB · Beige #EBCCA4
   Type: Inter — Bold titles, Regular body (brand guidelines)
   ========================================================= */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #02392B;
  --sage: #E7EBE6;
  --sage-2: #C8D5BB;
  --beige: #EBCCA4;

  --bg: #ffffff;
  --ink: #02392B;           /* deep green — headings / body */
  --muted: #51645d;         /* green-grey — secondary text (AA on white + sage) */
  --line: #dde3db;          /* hairline */

  --maxw: 1240px;
  --gutter: clamp(1.5rem, 5vw, 5.5rem);

  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --text: 1rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --logo-ratio: 538 / 276;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 0; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 200;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Logo is drawn from the supplied SVG as a mask, so it recolours per context. */
.brand-logo,
.footer-logo {
  display: block;
  flex: 0 0 auto;
  width: auto;
  aspect-ratio: var(--logo-ratio);
  -webkit-mask: url("/assets/logo.svg") no-repeat center / contain;
          mask: url("/assets/logo.svg") no-repeat center / contain;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 2.4vw, 1.6rem) var(--gutter);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(2, 57, 43, 0.05);
}
.brand { display: inline-flex; }
.brand-logo { height: 56px; background-color: var(--green); }

.site-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}
.site-nav a {
  opacity: 1;
  transition: opacity 0.25s var(--ease);
}
.site-nav a:hover,
.site-nav a:focus-visible { opacity: 0.65; }


/* =========================================================
   Hero — logo left, statement right (stacks on mobile)
   ========================================================= */
.hero {
  background: var(--sage);
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(6rem, 12vh, 8rem) var(--gutter) clamp(3rem, 8vh, 5rem);
}
.hero-grid {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
}
.hero-mark { display: flex; justify-content: center; }
.hero-logo {
  display: block;
  width: 100%;
  max-width: 230px;
  aspect-ratio: var(--logo-ratio);
  background-color: var(--green);
  -webkit-mask: url("/assets/logo.svg") no-repeat center / contain;
          mask: url("/assets/logo.svg") no-repeat center / contain;
}
.hero-text {
  border-left: 1px solid var(--line);
  padding-left: clamp(2rem, 4vw, 4rem);
}
.hero-headline {
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 3.3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 20ch;
}
/* soft-sage highlight (sage text would vanish on the sage hero) */
.hl {
  background: var(--sage-2);
  padding: 0 0.18em;
  border-radius: 0.18em;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}
.cta-row {
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
/* the hero carries the big logo, so the header logo appears only once scrolled */
.site-header .brand { opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease); }
.site-header.is-scrolled .brand { opacity: 1; pointer-events: auto; }

/* =========================================================
   Buttons
   ========================================================= */
.button {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover,
.button.primary:focus-visible { transform: translateY(-2px); background: #04503d; }
.button.ghost { border-color: rgba(2, 57, 43, 0.28); }
.button.ghost:hover,
.button.ghost:focus-visible { border-color: var(--green); transform: translateY(-2px); }

/* =========================================================
   Sections
   ========================================================= */
section { padding-inline: var(--gutter); }

/* What we do: sticky split. The heading and the AI-native note stay pinned
   on the left while the four services scroll past on the right; the
   service in view is full strength, the others soften. */
.work {
  padding-block: clamp(7rem, 13vh, 8.5rem) clamp(5rem, 12vh, 8rem);
  border-top: 1px solid var(--line);
}
.work-split {
  max-width: var(--maxw);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: start;
}
.work-aside {
  position: sticky;
  top: 8rem;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vh, 3rem);
}
.work-heading,
.careers-title {
  font-weight: 700;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0;
}
.work-lead {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: var(--text);
}

/* AI-native note */
.ai-note {
  background: var(--sage);
  border-radius: 10px;
  padding: clamp(1.4rem, 2.4vw, 2rem);
}
.ai-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--beige);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.ai-note h3 {
  margin: 0 0 0.6rem;
  font-weight: 700;
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.ai-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* services */
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc {
  border-top: 1px solid var(--line);
  padding-block: clamp(1.4rem, 3.2vh, 2rem);
  transition: opacity 0.5s var(--ease);
}
.svc:last-child { border-bottom: 1px solid var(--line); }
.svc-num {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.svc-title {
  margin: 0.35rem 0 0.5rem;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.75rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.svc-sum {
  margin: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 40ch;
}

/* focus effect (desktop, JS): the service in view is full strength */
@media (min-width: 861px) {
  html.js .svc-list.is-tracking .svc { opacity: 0.38; }
  html.js .svc-list.is-tracking .svc.is-active { opacity: 1; }
}

@media (max-width: 860px) {
  .work-split { grid-template-columns: 1fr; gap: 2.5rem; }
  .work-aside { position: static; gap: 1.75rem; }
  /* section rules already frame the list on mobile; drop the outer ones */
  .svc:first-child { border-top: 0; padding-top: 0; }
  .svc:last-child { border-bottom: 0; padding-bottom: 0; }
}
@media (max-width: 560px) {
}

/* Why UST: full-height section, three tall cards */
.why {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: clamp(7rem, 13vh, 8.5rem) clamp(4rem, 10vh, 6rem);
  border-top: 1px solid var(--line);
}
.why-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}
.why-top { margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.why-heading {
  font-weight: 700;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0;
}
.why-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 1.8vw, 1.5rem);
}
.why-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  min-height: clamp(320px, 46vh, 440px);
  padding: clamp(1.75rem, 2.6vw, 2.5rem);
  background: var(--sage);
  border-radius: 14px;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.why-card:hover {
  transform: translateY(-6px);
  background: #dfe5dc;
}
.why-icon { display: block; color: var(--green); }
.why-icon svg {
  width: clamp(44px, 4vw, 56px);
  height: auto;
  transition: transform 0.5s var(--ease);
}
.why-card:hover .why-icon svg { transform: rotate(-6deg) scale(1.06); }
/* same text height in every card so the titles line up */
@media (min-width: 861px) { .why-text { min-height: 8.75rem; } }
.why-text h3 {
  margin: 0 0 0.6rem;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.why-text p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text);
  line-height: 1.55;
  max-width: 32ch;
}

/* Careers — deep green band */
.careers {
  min-height: calc(100svh - 7rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--sage);
  color: var(--ink);
  padding-block: clamp(7rem, 13vh, 8.5rem) clamp(4.5rem, 12vh, 8rem);
}
.careers-head,
.careers-open {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}
.careers-head {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
}
.careers-title { color: var(--ink); }
.careers-cta { margin-top: 2rem; }
.careers-body {
  margin: 0;
  color: var(--muted);
  font-size: var(--text);
  max-width: 46ch;
}
.careers-open {
  margin-top: clamp(3rem, 8vh, 5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--sage-2);
  color: var(--muted);
  font-size: var(--text);
}
.careers-open a {
  color: var(--ink);
  border-bottom: 1px solid var(--beige);
  padding-bottom: 1px;
  transition: color 0.2s var(--ease);
}
.careers-open a:hover { color: var(--muted); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--sage);
  border-top: 1px solid var(--sage-2);
  padding: clamp(1.75rem, 3.5vw, 2.5rem) max(var(--gutter), calc((100% - var(--maxw)) / 2));
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { display: inline-flex; }
.footer-logo { height: 46px; background-color: var(--green); }
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-meta a { border-bottom: 1px solid var(--sage-2); padding-bottom: 1px; }
.footer-meta a:hover { color: var(--ink); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .careers-head { grid-template-columns: 1fr; }
  .why { min-height: 0; }
  .why-cards { grid-template-columns: 1fr; }
  .why-card { min-height: 0; gap: 2rem; }

  /* hero stacks: logo above, statement below */
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-mark { justify-content: flex-start; }
  .hero-logo { max-width: 120px; }
  .hero-text { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 2rem; }
  .hero-headline { line-height: 1.2; }
}
@media (max-width: 560px) {
  /* careers: equal space above and below so it sits centred vertically */
  .careers { padding-block: 5rem; }
  .why-cards { gap: 0.75rem; }
  .why-card { gap: 1rem; padding: 1.25rem 1.3rem; border-radius: 12px; }
  .why-icon svg { width: 34px; }
  .why-text h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
  .why-text p { font-size: 0.92rem; }

}
@media (max-width: 560px) {
  .brand-logo { height: 40px; }
  .footer-logo { height: 36px; }
  .footer-meta { text-align: left; }

}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* =========================================================
   Polish — motion, header, buttons, eyebrows
   ========================================================= */
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
          backdrop-filter: saturate(1.4) blur(14px);
}

.button { gap: 0.65rem; }
.btn-arrow { width: 14px; height: 14px; transition: transform 0.35s var(--ease); }
.button.primary:hover .btn-arrow,
.button.primary:focus-visible .btn-arrow { transform: translateY(2px); }
.button.ghost:hover .btn-arrow,
.button.ghost:focus-visible .btn-arrow { transform: translateX(3px); }

.eyebrow {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow--light { color: var(--muted); }

/* hero divider drawn as a line that grows in */
.hero-headline { font-size: clamp(2rem, 3.8vw, 3.6rem); }
.hero-text { position: relative; border-left: 0; }
.hero-text::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.5rem;
  bottom: -0.5rem;
  width: 1px;
  background: var(--sage-2);
  transform-origin: top;
}

/* hero entrance */
@keyframes ust-rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes ust-logo { from { opacity: 0; transform: scale(0.92); } }
@keyframes ust-line-y { from { transform: scaleY(0); } }
@keyframes ust-fade { from { opacity: 0; } }
.hero-logo     { animation: ust-logo 1.2s var(--ease) 0.1s both; }
.hero-text::before { animation: ust-line-y 1s var(--ease) 0.35s both; }
.hero-headline { animation: ust-rise 1s var(--ease) 0.5s both; }
.cta-row       { animation: ust-rise 1s var(--ease) 0.7s both; }
.site-nav      { animation: ust-fade 0.8s var(--ease) 0.9s both; }

/* scroll reveal (only when JS is running; otherwise everything is visible) */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease) var(--d, 0s), transform 0.9s var(--ease) var(--d, 0s);
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

/* =========================================================
   Mobile — centred hero, inline menu (no hamburger)
   ========================================================= */
@media (max-width: 860px) {
  .hero-grid { justify-items: center; text-align: center; }
  .hero-mark { justify-content: center; width: 100%; }
  .hero-logo { max-width: 130px; }
  .hero-text { border-top: 0; padding-top: 2.25rem; }
  .hero-text::before { display: none; }
  .hero-headline { max-width: 20ch; margin-inline: auto; }
  .cta-row { justify-content: center; }

  /* logo + headline centred in the hero, buttons side by side near the bottom */
  .hero { align-items: stretch; padding-bottom: 2.25rem; }
  .hero-grid { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
  .hero-text { display: contents; }
  .hero-mark { margin-top: auto; }
  .hero-headline { margin-bottom: auto; }
  .cta-row { flex-wrap: nowrap; gap: 0.6rem; margin-top: 2.5rem; }
  .cta-row .button { padding: 0.85rem 1.2rem; font-size: 0.74rem; letter-spacing: 0.1em; gap: 0.5rem; }
}
/* =========================================================
   Header states
   At the top: inline menu, no logo (the hero carries it).
   Scrolled:   logo appears on the left; on phones the menu also collapses
               to a hamburger panel. Back at the top it returns to inline.
   ========================================================= */
.site-nav a { position: relative; }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.site-nav a:hover,
.site-nav a:focus-visible { opacity: 1; }

.brand { flex-shrink: 0; transform: translateX(-8px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }
.site-header.is-scrolled .brand { transform: none; }
.site-header.is-scrolled .brand-logo { height: 44px; }

/* hamburger */
.nav-toggle {
  display: none;
  flex-shrink: 0;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  margin: -0.5rem -0.6rem -0.5rem 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--green);
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1.4rem;
  height: 2px;
  background: currentColor;
  transform: translateX(-50%);
  transition: transform 0.35s var(--ease), background 0.2s var(--ease), top 0.35s var(--ease);
}
.nav-toggle-bars { top: 50%; margin-top: -1px; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: translateX(-50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { top: 0; transform: translateX(-50%) rotate(-45deg); }

/* phones only: once scrolled, the menu collapses to a hamburger panel.
   On larger screens the inline menu stays and the logo just appears. */
@media (max-width: 560px) {
  .site-header.is-scrolled .nav-toggle { display: inline-block; animation: ust-fade 0.4s var(--ease) both; }

  /* scrolled: the nav becomes a full-width panel under the header */
  .site-header.is-scrolled .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.25rem var(--gutter) 1rem;
    background: #fff;
    box-shadow: 0 1px 0 var(--line), 0 24px 40px rgba(2, 57, 43, 0.06);
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    text-transform: none;
    animation: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s var(--ease);
  }
  .site-header.is-scrolled .site-nav a {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
  }
  .site-header.is-scrolled .site-nav a:last-child { border-bottom: 0; }
  .site-header.is-scrolled .site-nav a::after { display: none; }
  .site-header.is-scrolled .site-nav a:hover { opacity: 0.65; }
  .site-header.is-scrolled .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}


/* mobile, at the top: no logo, menu spread across the width */
@media (max-width: 560px) {
  .site-header:not(.is-scrolled) .brand { display: none; }
  .site-header:not(.is-scrolled) .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
  }
  .site-header.is-scrolled .brand-logo { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal],
  html.js [data-reveal] * { opacity: 1 !important; transform: none !important; }
}
