/* =========================================================
   SEIVEI — Business Consulting
   Design System
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600;9..144,700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink: #0e0f0c;
  --ink-soft: #1a1c18;
  --cream: #f4efe6;
  --cream-warm: #ebe4d6;
  --paper: #faf6ee;
  --line: #2a2c27;
  --line-soft: #d8cfbd;
  --muted: #6b6657;
  --accent: #ff5b1f;          /* sunset orange */
  --accent-2: #2f6b3a;        /* forest green */
  --accent-3: #c9a96e;         /* warm gold */

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-italic: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1320px;
  --gutter: clamp(1.25rem, 3vw, 2.25rem);
  --radius: 2px;
  --transition: 600ms cubic-bezier(.2,.7,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  font-optical-sizing: auto;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--ink); color: var(--cream); }

/* ============= Type system ============= */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  transform: translateY(-1px);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.02; }
h1 { font-size: clamp(3rem, 8.5vw, 8.5rem); font-weight: 300; }
h2 { font-size: clamp(2.25rem, 5vw, 4.5rem); font-weight: 300; }
h3 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); font-weight: 400; }
h4 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }

.italic { font-family: var(--font-italic); font-style: italic; font-weight: 400; }
em.serif-em { font-family: var(--font-italic); font-style: italic; font-weight: 400; }

p { color: var(--ink-soft); max-width: 62ch; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.5; color: var(--ink-soft); }

/* ============= Layout ============= */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(5rem, 10vw, 9rem) 0; position: relative; }
.section-tight { padding: clamp(3rem, 6vw, 5rem) 0; }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============= Navigation ============= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 400ms ease, backdrop-filter 400ms ease, border-color 400ms ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(244, 239, 230, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--line-soft);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.nav-logo .mark {
  font-family: var(--font-italic);
  font-style: italic;
  color: var(--accent);
}
.nav-logo .tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--line-soft);
}
@media (max-width: 700px) { .nav-logo .tag { display: none; } }

.nav-links {
  display: flex;
  gap: 2.25rem;
  align-items: center;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding: 0.5rem 0;
  transition: color 200ms ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 300ms ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--accent); }

.nav-links a.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  background: var(--ink);
  color: var(--cream) !important;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.nav-links a.nav-cta:hover {
  background: var(--accent);
  color: var(--cream) !important;
  transform: translateY(-1px);
}
.nav-links a.nav-cta.active {
  background: var(--accent);
  color: var(--cream) !important;
}
.nav-links a.nav-cta.active:hover {
  background: var(--ink);
}
.nav-links a.nav-cta::after { display: none !important; }

.nav-toggle {
  display: none;
  width: 34px; height: 34px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  transition: transform 300ms ease, opacity 300ms ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    width: min(380px, 80%);
    height: 100vh;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2.5rem 2rem;
    gap: 1.5rem;
    transform: translateX(110%);
    transition: transform 500ms cubic-bezier(.7,0,.3,1);
    border-left: 1px solid var(--line-soft);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 14px; }
  .nav-links li.cta-item { margin-top: 1rem; }
  .nav-links a.nav-cta {
    font-size: 12px;
    padding: 0.85rem 1.5rem;
  }
}

/* ============= Buttons ============= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.05rem 1.85rem;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: transform 200ms ease, background 200ms ease, color 200ms ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: var(--accent); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }
.btn-light { background: var(--cream); color: var(--ink); }
.btn-light:hover { background: var(--accent); color: var(--cream); transform: translateY(-2px); }

.btn .arrow {
  display: inline-block;
  transition: transform 250ms ease;
}
.btn:hover .arrow { transform: translateX(4px); }

/* ============= Footer ============= */
.footer {
  background: var(--ink);
  color: var(--cream);
  padding: clamp(4rem, 8vw, 6rem) 0 2rem;
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.footer-mark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(5rem, 18vw, 16rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin-bottom: 3rem;
  background: linear-gradient(180deg, var(--cream) 0%, transparent 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
}
.footer-mark em {
  font-family: var(--font-italic);
  font-style: italic;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(244, 239, 230, 0.15);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

.footer h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.5);
  margin-bottom: 1.25rem;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.6rem; }
.footer ul a { color: var(--cream); transition: color 200ms ease, padding-left 200ms ease; font-size: 0.95rem; }
.footer ul a:hover { color: var(--accent); padding-left: 4px; }

.footer-tagline {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--cream);
  max-width: 36ch;
  margin-bottom: 1.5rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 239, 230, 0.1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.5);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============= Reusable section header ============= */
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-bottom: clamp(3rem, 6vw, 5rem);
  align-items: end;
}
@media (max-width: 800px) { .section-head { grid-template-columns: 1fr; } }
.section-head h2 { max-width: 18ch; }

/* ============= Cards & generics ============= */
.card {
  background: var(--paper);
  padding: 2rem;
  border: 1px solid var(--line-soft);
  transition: transform 300ms ease, border-color 300ms ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--ink); }

.divider {
  width: 100%; height: 1px; background: var(--line-soft);
  margin: clamp(3rem, 6vw, 5rem) 0;
}

/* ============= Reveal animation ============= */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 800ms ease, transform 800ms cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }

/* ============= Marquee ============= */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 1.5rem 0;
  background: var(--paper);
}
.marquee-track {
  display: flex;
  gap: 4rem;
  white-space: nowrap;
  animation: scroll 40s linear infinite;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
}
.marquee-track span { display: inline-flex; align-items: center; gap: 4rem; }
.marquee-track .star { color: var(--accent); font-size: 0.7em; }
@keyframes scroll {
  to { transform: translateX(-50%); }
}

/* ============= Page hero (interior pages) ============= */
.page-hero {
  padding: clamp(9rem, 16vw, 14rem) 0 clamp(4rem, 8vw, 7rem);
  background: var(--cream);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0; right: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255, 91, 31, 0.12), transparent 70%);
  pointer-events: none;
}
.page-hero .crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
}
.page-hero .crumb a:hover { color: var(--accent); }
.page-hero .crumb .sep { margin: 0 0.6rem; color: var(--line-soft); }
.page-hero h1 { max-width: 16ch; margin-bottom: 1.5rem; }
.page-hero .lead { max-width: 56ch; }

/* ============= Forms ============= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea, .field select {
  font-family: var(--font-display);
  font-size: 1.05rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  padding: 0.65rem 0;
  color: var(--ink);
  outline: none;
  transition: border-color 200ms ease;
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); }
.field textarea { resize: vertical; min-height: 120px; }

/* ============= Utility ============= */
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; } .mb-3 { margin-bottom: 3rem; }

/* =========================================================
   INTERACTIONS — Custom cursor, scroll progress, parallax
   ========================================================= */

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}
.scroll-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transform-origin: left center;
  transition: width 80ms linear;
}

/* ---------- Custom cursor ---------- */
/* Show only on devices that can hover with a fine pointer */
.cursor,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  will-change: transform;
  opacity: 0;
  transition: opacity 250ms ease;
}

.cursor {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--accent);
  border-radius: 50%;
  mix-blend-mode: normal;
  transition:
    opacity 250ms ease,
    width 220ms cubic-bezier(.2,.7,.2,1),
    height 220ms cubic-bezier(.2,.7,.2,1),
    margin 220ms cubic-bezier(.2,.7,.2,1),
    background-color 220ms ease;
}

.cursor-ring {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transition:
    opacity 250ms ease,
    width 320ms cubic-bezier(.2,.7,.2,1),
    height 320ms cubic-bezier(.2,.7,.2,1),
    margin 320ms cubic-bezier(.2,.7,.2,1),
    border-color 220ms ease,
    background-color 220ms ease;
}

/* Cursor label (appears inside the ring on context) */
.cursor-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0;
  transition: opacity 200ms ease;
  white-space: nowrap;
}

/* Visible once JS has placed it once */
body.cursor-ready .cursor,
body.cursor-ready .cursor-ring { opacity: 1; }

/* Hover state — over an interactive element */
body.cursor-hover .cursor {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: var(--accent);
}
body.cursor-hover .cursor-ring {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-color: var(--ink);
  background: var(--ink);
}
body.cursor-hover .cursor-ring__label { opacity: 1; }

/* When over a dark section (cta-block, footer), invert */
body.cursor-on-dark .cursor { background: var(--accent); }
body.cursor-on-dark .cursor-ring { border-color: var(--cream); }
body.cursor-on-dark.cursor-hover .cursor-ring {
  background: var(--cream);
  border-color: var(--cream);
}
body.cursor-on-dark.cursor-hover .cursor-ring__label { color: var(--ink); }

/* When clicking */
body.cursor-down .cursor-ring {
  transform-origin: center;
}
body.cursor-down .cursor {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
}

/* Hide the default cursor only when our cursor is active */
body.cursor-active,
body.cursor-active a,
body.cursor-active button,
body.cursor-active .service-row,
body.cursor-active .btn,
body.cursor-active input,
body.cursor-active textarea,
body.cursor-active select {
  cursor: none;
}

/* On touch / coarse devices, suppress cursor entirely */
@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-ring { display: none !important; }
  body.cursor-active,
  body.cursor-active * { cursor: auto; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cursor, .cursor-ring { display: none !important; }
  body.cursor-active, body.cursor-active * { cursor: auto; }
  .scroll-progress__bar { transition: none; }
}

/* ---------- Magnetic button base (transform is set by JS) ---------- */
.magnetic {
  display: inline-block;
  transition: transform 360ms cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}
.magnetic > * {
  display: inline-block;
  transition: transform 360ms cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}

/* ---------- Parallax helpers (transform driven by JS) ---------- */
[data-parallax] { will-change: transform; }

/* ---------- Reveal enhancements: stagger line rise ----------
   Structure produced by interactions.js:
     <h1 class="reveal-lines">
       <span class="line"><span class="line-inner">…</span></span>
       …
     </h1>
   The OUTER .line clips during the animation; the INNER .line-inner is
   what translates. Padding gives descenders (g, y, p, q) room so they
   are never clipped at the line-box edge. After the reveal completes we
   release overflow:hidden entirely so the final, settled text never
   has its descenders cropped. */
.reveal-lines .line {
  display: block;
  overflow: hidden;
  /* Internal breathing room for descenders + ascenders. Counter-acted by
     negative margins so the headline's overall layout is unchanged. */
  padding: 0.18em 0 0.22em;
  margin-top: -0.18em;
  margin-bottom: -0.22em;
}
.reveal-lines .line-inner {
  display: block;
  transform: translateY(110%);
  transition: transform 900ms cubic-bezier(.2,.7,.2,1);
  will-change: transform;
}
.reveal-lines.in .line-inner { transform: translateY(0); }
.reveal-lines.in .line:nth-child(2) .line-inner { transition-delay: 80ms; }
.reveal-lines.in .line:nth-child(3) .line-inner { transition-delay: 160ms; }
.reveal-lines.in .line:nth-child(4) .line-inner { transition-delay: 240ms; }

/* Once the reveal has finished, release the clip entirely. This guarantees
   descenders are visible in the settled state regardless of line-height.
   1.4s = longest transition (900ms) + longest delay (240ms) + safety margin. */
.reveal-lines.in .line {
  animation: reveal-lines-release 0s linear 1.4s forwards;
}
@keyframes reveal-lines-release {
  to { overflow: visible; }
}

/* ---------- Service row — extra mouse-aware polish ---------- */
.service-row {
  position: relative;
  overflow: hidden;
}
.service-row::after {
  content: "";
  position: absolute;
  left: var(--mx, 50%);
  top: var(--my, 50%);
  width: 0; height: 0;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 240ms ease, width 480ms cubic-bezier(.2,.7,.2,1), height 480ms cubic-bezier(.2,.7,.2,1);
  z-index: 0;
}
.service-row:hover::after {
  opacity: 0.06;
  width: 380px;
  height: 380px;
}
.service-row > * { position: relative; z-index: 1; }
