/* KOVA brand tokens: Branding Book v2, November 2026. */
:root {
  --kova-teal: #3F8E93;
  --aqua: #8AC8CB;
  --stone: #DFDCD5;
  --mist: #E6E5E5;
  --white: #FFFFFF;
  --deep-teal: #2F7D85;
  --deep-ocean: #0D2B45;

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* The left gutter is never smaller than the logo's height, which is its required clear space. */
  --gutter: clamp(29px, 6vw, 96px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--deep-ocean);
  color: var(--deep-ocean);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
img, svg, canvas { display: block; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; }
.services :focus-visible { outline-color: var(--deep-teal); }

.wrap { max-width: 1480px; margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  padding: 10px 16px; background: var(--white); color: var(--deep-ocean);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Opening sequence ---------- */

/* The logo appears on the open water, a wave runs out from it and draws the contour lines in,
   then the logo moves up into the header. The overlay is transparent so the water shows through. */
.intro { display: none; position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.play-intro .intro {
  display: grid; place-items: center; pointer-events: auto; cursor: pointer;
  /* Failsafe: the page must never stay hidden if main.js fails to load. */
  animation: intro-failsafe .3s 7s forwards;
}
@keyframes intro-failsafe { to { opacity: 0; visibility: hidden; } }

.intro__logo { width: clamp(220px, 34vw, 460px); height: auto; will-change: transform; animation: intro-arrive 1.4s var(--ease) both; }
@keyframes intro-arrive {
  from { opacity: 0; transform: translateY(14px) scale(.97); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Held back while the opening plays, with the same failsafe. */
.play-intro .brand img, .play-intro .site-nav, .play-intro .hero__title {
  visibility: hidden; animation: intro-failsafe-show 0s 7s forwards;
}
.play-intro .site-nav { opacity: 0; transition: opacity .9s ease; }
.intro-done .brand img, .intro-done .site-nav, .play-intro.is-ready .hero__title { visibility: visible; }
.intro-done .site-nav { opacity: 1; }
@keyframes intro-failsafe-show { to { visibility: visible; opacity: 1; } }

/* ---------- Living water background ---------- */

.water {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0;
  background:
    radial-gradient(70% 60% at 82% 30%, rgba(47, 125, 133, .34), transparent 75%),
    var(--deep-ocean);
}

/* ---------- Header ---------- */

.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  max-width: 1480px; margin: 0 auto;
  padding: 36px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  color: var(--white);
}
.brand { flex: none; }
.brand img { width: clamp(120px, 12vw, 158px); height: auto; }

.site-nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); font-size: 15px; font-weight: 400; }
.site-nav a { text-decoration: none; position: relative; padding: 6px 0; }
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--aqua); transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}
.site-nav a:hover::after, .site-nav__cta::after { transform: scaleX(1); }

/* ---------- Hero ---------- */

.hero {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  color: var(--white);
}
.hero__inner {
  width: 100%; max-width: 1480px; margin: 0 auto;
  padding: 150px var(--gutter) clamp(150px, 17vh, 200px);
  will-change: transform, opacity;
}
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(47px, 7.6vw, 122px);
  line-height: 1.06; letter-spacing: -.015em;
  max-width: 11.5em; text-wrap: balance;
}
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.word__inner { display: inline-block; }
.js .word__inner { transform: translateY(112%); transition: transform 1.25s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.is-ready .word__inner { transform: none; }

.hero__foot {
  margin-top: clamp(28px, 4vh, 48px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 48px;
}
.hero__lede { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; max-width: 26em; color: var(--white); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }

.js [data-hero-fade] { opacity: 0; transform: translateY(16px); transition: opacity 1s ease .55s, transform 1.2s var(--ease) .55s; }
.is-ready [data-hero-fade] { opacity: 1; transform: none; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 28px; border: 0; border-radius: 0; cursor: pointer;
  background: var(--deep-teal); color: var(--white);
  font-size: 16px; font-weight: 400; text-decoration: none;
  position: relative; overflow: hidden; isolation: isolate;
}
.button::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--deep-ocean); box-shadow: inset 0 0 0 1px var(--aqua);
  transform: translateY(101%); transition: transform .55s var(--ease);
}
.button:hover::before { transform: none; }
.button[disabled] { cursor: progress; opacity: .75; }

.text-link {
  text-decoration: none; font-weight: 400; font-size: 16px;
  padding-bottom: 4px;
  background: linear-gradient(var(--aqua), var(--aqua)) left bottom / 100% 1px no-repeat;
  transition: background-size .5s var(--ease);
}
.text-link:hover { background-size: 40% 1px; }

/* ---------- Tide lines between dark and light sections ---------- */

.wave { position: absolute; left: 0; width: 100%; height: clamp(64px, 10vw, 140px); overflow: visible; pointer-events: none; z-index: 2; }
.wave--over { top: 1px; transform: translateY(-100%); }
.wave--under { bottom: 1px; transform: translateY(100%); }
.wave__echo { fill: none; stroke: var(--aqua); stroke-width: 1; opacity: .55; vector-effect: non-scaling-stroke; }
.wave--over .wave__fill { fill: var(--mist); }
.wave--under .wave__fill { fill: var(--mist); }

/* ---------- Section labels: Outfit Light, capitals, spaced, short rule below ---------- */

.section-label {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(20px, 1.9vw, 26.67px);
  text-transform: uppercase; letter-spacing: .1em; line-height: 1.2;
  padding-bottom: 14px; position: relative; width: fit-content;
}
.section-label::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 64px; height: 2px;
  background: var(--deep-ocean);
}
.js .section-label::after { transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease) .15s; }
.js .section-label.in::after { transform: none; }
.section-label--dark { color: var(--white); }
.section-label--dark::after { background: var(--aqua); }

/* Scroll reveal only applies when JS is there to trigger it. */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform 1.2s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Services ---------- */

.services { position: relative; z-index: 2; background: var(--mist); padding: clamp(70px, 9vw, 130px) 0 clamp(90px, 11vw, 160px); }

.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 48px; align-items: start; }
.section-intro { font-family: var(--serif); font-size: clamp(28px, 3.3vw, 50px); line-height: 1.2; max-width: 19em; text-wrap: balance; }

.service-list { position: relative; margin-top: clamp(50px, 7vw, 100px); padding-left: 64px; }
.thread { position: absolute; left: 0; top: 0; width: 40px; height: 100%; overflow: visible; }
html:not(.js) .thread { display: none; }
.thread__rail { fill: none; stroke: var(--aqua); stroke-width: 1; }
.thread__draw { fill: none; stroke: var(--kova-teal); stroke-width: 2; }
.thread__head { fill: var(--deep-ocean); }

.service {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(220px, .8fr);
  gap: 24px clamp(28px, 4vw, 64px); align-items: center;
  padding: clamp(32px, 4vw, 56px) 0;
  border-top: 1px solid var(--aqua);
}
.service:last-of-type { border-bottom: 1px solid var(--aqua); }

.service__index { display: block; font-size: 15px; font-weight: 400; margin-bottom: 10px; }
.service h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 4.3vw, 66px); line-height: 1.08;
  transition: transform .8s var(--ease);
}
@media (hover: hover) { .service:hover h3 { transform: translateX(10px); } }
.service__sub { font-weight: 500; font-size: 17px; margin-bottom: 8px; }
.service__copy p:last-child { max-width: 34em; }
.service__art { width: 100%; aspect-ratio: 3 / 2; }
.services__note { margin-top: 28px; padding-left: 64px; font-size: 15px; max-width: 34em; }

/* ---------- Contact ---------- */

.contact {
  position: relative; z-index: 1; color: var(--white);
  padding-top: clamp(150px, 19vw, 280px);
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: space-between;
}
.contact > .wrap { width: 100%; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px clamp(40px, 8vw, 130px); align-items: start; }
.contact__title { font-family: var(--serif); font-size: clamp(38px, 5.2vw, 80px); line-height: 1.1; margin-top: clamp(26px, 3vw, 40px); }
.contact__lede { margin-top: 20px; font-size: 18px; }
.contact__details { margin-top: 36px; display: grid; gap: 8px; font-weight: 400; }
.contact__details a { text-decoration: none; background: linear-gradient(var(--aqua), var(--aqua)) left bottom / 100% 1px no-repeat; padding-bottom: 2px; }
.contact__details a:hover { color: var(--aqua); }

.contact__panel {
  padding: clamp(26px, 3.2vw, 46px);
  background: rgba(13, 43, 69, .72);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(138, 200, 203, .35);
}

.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.field { position: relative; padding-top: 22px; margin-bottom: 24px; }
.field input, .field textarea {
  display: block; width: 100%; background: transparent; border: 0; border-radius: 0;
  border-bottom: 1px solid rgba(138, 200, 203, .6);
  padding: 8px 0 10px; font-size: 17px; font-weight: 400; color: var(--white); outline: 0;
  transition: border-color .3s ease; resize: vertical;
}
.field textarea { min-height: 84px; }
.field label {
  position: absolute; left: 0; top: 30px; font-size: 17px; color: var(--white);
  pointer-events: none; transform-origin: left top;
  transition: transform .35s var(--ease);
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-28px) scale(.82);
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--aqua); box-shadow: 0 1px 0 0 var(--aqua); }
.field.has-error input, .field.has-error textarea { border-bottom-color: var(--white); box-shadow: 0 1px 0 0 var(--white); }
.field__error { font-size: 14px; font-weight: 400; color: var(--white); margin-top: 6px; }
.field__error:empty { display: none; }

.button--submit { margin-top: 6px; min-width: 190px; }
.form__status { margin-top: 16px; font-size: 15px; font-weight: 400; }
.form__status:empty { display: none; }
.form__status a { color: var(--white); }

.sent { outline: 0; }
.sent__line { width: 100%; max-width: 320px; height: auto; margin-bottom: 26px; }
.sent__line path { fill: none; stroke: var(--aqua); stroke-width: 1.5; stroke-dasharray: 400; stroke-dashoffset: 400; animation: sent-draw 1.6s var(--ease) forwards; }
@keyframes sent-draw { to { stroke-dashoffset: 0; } }
.sent__title { font-family: var(--serif); font-size: clamp(34px, 3.4vw, 52px); line-height: 1.15; margin-bottom: 10px; }

.site-footer {
  width: 100%; max-width: 1480px; margin: clamp(60px, 9vw, 120px) auto 0;
  padding: 22px var(--gutter) 30px;
  display: flex; flex-wrap: wrap; gap: 6px 36px; justify-content: space-between;
  font-size: 13px; font-weight: 400;
  position: relative;
}
.site-footer::before { content: ''; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: rgba(138, 200, 203, .5); }

/* ---------- Smaller screens ---------- */

@media (max-width: 1040px) {
  .service { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .service__art { grid-column: 1 / -1; max-height: 240px; }
  .contact__grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .site-header { padding-top: 29px; padding-bottom: 29px; }
  .site-nav a:not(.site-nav__cta) { display: none; }
  .hero__foot { flex-direction: column; align-items: flex-start; }
  .service-list { padding-left: 38px; }
  .thread { width: 24px; }
  .services__note { padding-left: 38px; }
  .service { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal], .js [data-hero-fade], .js .word__inner { opacity: 1; transform: none; }
  .js .section-label::after { transform: none; }
  .sent__line path { stroke-dashoffset: 0; }
}
