/* =====================================================
   Kliviti site styles
   Modern, white, classy, hi-key. Referral-only edition.
   ===================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f8f7f4;          /* warm off-white */
  --bg-deep: #f1efea;
  --ink: #0e1818;             /* almost-black, slight teal undertone */
  --ink-2: #4a5656;
  --muted: #8a9696;
  --line: #ece9e3;
  --line-2: #ddd9d2;
  --accent: #00bdbf;          /* exact logo teal */
  --accent-deep: #008a8c;
  --accent-soft: #e6f7f7;

  --serif: "Cormorant Garamond", "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 48px);

  --radius: 4px;
  --radius-lg: 14px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, object { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

::selection { background: var(--accent); color: #fff; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 14px;
  z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 22px;
  font-weight: 500;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

.display, .h-display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.02;
  color: var(--ink);
  margin: 0;
}

.display em, .h-display em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.display {
  font-size: clamp(64px, 10vw, 156px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.h-display {
  font-size: clamp(38px, 5.4vw, 76px);
  line-height: 1.04;
  font-weight: 400;
}

.lede {
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 58ch;
  margin: 32px 0 0;
  font-weight: 300;
}

.prose {
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.75;
  margin: 0 0 20px;
  max-width: 60ch;
  font-weight: 400;
}
.prose:last-child { margin-bottom: 0; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section {
  padding: clamp(80px, 12vw, 160px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: 820px;
  margin: 0 0 72px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.two-col__left { position: sticky; top: 100px; }

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .two-col__left { position: static; }
}

/* ---------- Status bar ---------- */
.status-bar {
  background: var(--ink);
  color: #f4f4f1;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.status-bar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 11px var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0,189,191,.6);
  animation: pulse 2.6s var(--ease) infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0,189,191,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(0,189,191,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,189,191,0); }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled { border-color: var(--line); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; }
.brand__mark {
  height: 26px;
  width: auto;
  pointer-events: none;
}

.nav-links {
  display: flex; align-items: center; gap: 36px;
}
.nav-links a {
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  font-weight: 400;
  transition: color .2s var(--ease);
}
.nav-links a:hover { color: var(--ink); }

.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  align-items: center; justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block; width: 16px; height: 1.5px; background: var(--ink);
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px var(--gutter) 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.mobile-nav a {
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  color: var(--ink);
  font-family: var(--serif);
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-nav.is-open { display: flex; }
  .mobile-nav.is-open[hidden] { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(96px, 14vw, 160px) 0 clamp(40px, 6vw, 80px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -180px; right: -160px;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(0,189,191,0.10), rgba(0,189,191,0) 65%);
  pointer-events: none;
  z-index: 0;
}
.hero__inner { position: relative; z-index: 1; max-width: 1100px; }

.hero__meta {
  margin-top: clamp(80px, 11vw, 140px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}
.hero__meta > div {
  display: flex; align-items: baseline; gap: 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
}
.hero__meta .num {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 20px;
  letter-spacing: 0;
}

@media (max-width: 700px) {
  .hero__meta { grid-template-columns: 1fr; gap: 12px; padding-top: 24px; }
}

/* ---------- Philosophy ---------- */
.section--philosophy { background: var(--bg); }

.pillars {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 32px;
}
.pillars li span {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

/* ---------- Practice / Services ---------- */
.section--practice { background: var(--bg-alt); border-top-color: transparent; }

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.service {
  background: var(--bg);
  padding: clamp(28px, 3.5vw, 48px);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  transition: background .35s var(--ease);
}
.service:hover { background: #fdfdfb; }

.service__num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0;
}
.service__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.4vw, 34px);
  margin: 18px 0 16px;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.service__body {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 28px;
  font-weight: 400;
}
.service__list {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.service__list li {
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 6px 0;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: 0.01em;
}
.service__list li::before {
  content: ""; width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  flex: none;
}

@media (max-width: 980px) {
  .services { grid-template-columns: 1fr; }
  .service { min-height: 0; }
}

/* ---------- Engagements ---------- */
.engagements {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.engagement {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 3.2vw, 40px);
  background: var(--bg);
  transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.engagement:hover { transform: translateY(-3px); border-color: var(--ink); }

.engagement--accent {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.engagement--accent .engagement__kicker { color: var(--accent); }
.engagement--accent p { color: #cdd3d3; }
.engagement--accent h3 { color: #fff; }

.engagement__kicker {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 22px;
  font-weight: 500;
}
.engagement h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.2vw, 32px);
  margin: 0 0 16px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.engagement p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}

@media (max-width: 980px) {
  .engagements { grid-template-columns: 1fr; }
}

/* ---------- Clients ---------- */
.industries { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.industries ul {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px;
}
.industries li {
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-2);
}

/* ---------- Pull quote ---------- */
.section--quote {
  padding: clamp(80px, 11vw, 140px) 0;
  background: var(--bg-alt);
  border-top-color: transparent;
}
.pull-quote {
  margin: 0;
  text-align: center;
  max-width: 1100px;
  margin-inline: auto;
}
.pull-quote p {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(34px, 5.2vw, 72px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.pull-quote em { font-style: italic; color: var(--accent); font-weight: 400; }

/* ---------- Closing (replaces inquire) ---------- */
.section--closing {
  background: var(--bg);
  padding: clamp(96px, 13vw, 180px) 0;
}
.closing {
  text-align: center;
  max-width: 1000px;
  margin-inline: auto;
}
.closing__line {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(28px, 3.8vw, 50px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 28px;
}
.closing__line em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
.closing__sub {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

/* ---------- Referral code field ---------- */
.referral {
  margin: 56px auto 0;
  max-width: 520px;
}
.referral__label {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 500;
}
.referral__group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 18px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.referral__group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,189,191,0.12);
}
.referral.is-error .referral__group {
  border-color: #c08484;
  box-shadow: 0 0 0 4px rgba(192,132,132,0.12);
}
.referral__group input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 4px;
  letter-spacing: 0.01em;
  min-width: 0;
}
.referral__group input::placeholder {
  color: var(--muted);
  font-style: italic;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0;
}
.referral__submit {
  flex: none;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 13px;
  letter-spacing: 0.06em;
  font-weight: 500;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.referral__submit:hover { background: var(--accent-deep); }
.referral__submit:active { transform: scale(.98); }

.referral__feedback {
  margin: 14px 0 0;
  min-height: 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.4;
  color: transparent;
  transition: color .25s var(--ease);
}
.referral.is-error .referral__feedback {
  color: #9a5151;
}

.referral__success {
  text-align: center;
  animation: referralFadeIn .6s var(--ease) both;
}
.referral__welcome {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 400;
  color: var(--ink);
  margin: 0 0 18px;
  line-height: 1.4;
}
.referral__welcome em { font-style: italic; color: var(--accent); }
.referral__mailto {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 400;
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 4px;
  letter-spacing: -0.005em;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.referral__mailto:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
}

@keyframes referralFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
  .referral__group { padding: 5px 5px 5px 14px; }
  .referral__submit { padding: 10px 16px; font-size: 12.5px; }
  .referral__group input::placeholder { font-size: 15px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding: clamp(64px, 8vw, 96px) 0 36px;
}
.footer {
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: 56px;
  align-items: start;
}
.footer__brand { display: flex; flex-direction: column; gap: 14px; }
.footer__mark {
  height: 22px;
  width: auto;
  pointer-events: none;
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.footer__cols ul { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.footer__cols a { font-size: 14px; color: var(--ink-2); }
.footer__cols a:hover { color: var(--ink); }

.footer__legal {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 28px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

@media (max-width: 760px) {
  .footer { grid-template-columns: 1fr; gap: 36px; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
