/* ==========================================================================
   Khilco Holdings — design tokens
   Dark charcoal base, off-white type, one accent (electric lime) used
   sparingly. Update tokens here to retint or restyle the whole site.
   ========================================================================== */

:root {
  --bg-0: #0a0b0d;        /* deepest background (hero) */
  --bg-1: #0e1012;        /* foundation section */
  --bg-2: #101215;        /* momentum section */
  --bg-3: #0b0d0f;        /* future/contact section */
  --ink: #f4f2ec;         /* primary off-white text */
  --ink-dim: #a8a9ad;     /* secondary/muted text */
  --ink-faint: #7b7d83;   /* tertiary, captions — kept >= 4.5:1 against bg-0 for AA */
  --line: rgba(244, 242, 236, 0.1);
  --line-strong: rgba(244, 242, 236, 0.18);
  --accent: #c6ff5c;      /* electric lime — sparing use only */
  --accent-dim: rgba(198, 255, 92, 0.14);
  --accent-glow: rgba(198, 255, 92, 0.22);

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--bg-0);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

/* Skip link for keyboard/screen reader users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #08110a;
  padding: 12px 18px;
  font-weight: 600;
  z-index: 999;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Grain / noise overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 22px 0;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background-color: rgba(10, 11, 13, 0.82);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #08110a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.main-nav a {
  font-size: 0.88rem;
  color: var(--ink-dim);
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #08110a;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  box-shadow: 0 0 0 1px var(--accent), 0 8px 30px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.82rem;
}

/* ==========================================================================
   Hero — Pressure
   Tight, moody, restrained. Confident, not loud.
   ========================================================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 160px 0 120px;
  overflow: hidden;
  background: var(--bg-0);
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(700px 420px at 78% 12%, var(--accent-glow), transparent 60%),
    radial-gradient(900px 600px at 10% 100%, rgba(255,255,255,0.05), transparent 55%),
    linear-gradient(180deg, #0a0b0d 0%, #0b0c0e 60%, #0a0b0d 100%);
}

.hero-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.5;
}

.hero-lines path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
}

.hero-lines .live {
  stroke: var(--accent);
  stroke-dasharray: 6 10;
  opacity: 0.55;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-lines .live {
    animation: dash-flow 10s linear infinite;
  }
  .hero-atmosphere {
    will-change: transform;
  }
}

@keyframes dash-flow {
  to { stroke-dashoffset: -320; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 28px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero h1 .accent {
  color: var(--accent);
}

.hero .lead {
  margin-top: 26px;
  max-width: 540px;
  font-size: 1.1rem;
  color: var(--ink-dim);
}

.hero .actions {
  margin-top: 44px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: var(--gutter);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.scroll-cue .line {
  width: 28px;
  height: 1px;
  background: var(--ink-faint);
  position: relative;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-cue .line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: translateX(-100%);
    animation: cue-sweep 2.6s ease-in-out infinite;
  }
}

@keyframes cue-sweep {
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   Reveal utility — used across sections for staggered entrance
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: calc(var(--reveal-index, 0) * 90ms);
  }
}

[data-reveal].in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Section shell + eyebrow/heading pattern shared by Foundation/Momentum/Future
   ========================================================================== */

section {
  position: relative;
  padding: 130px 0;
}

.section-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

.section-label .index {
  color: var(--accent);
  margin-right: 10px;
}

/* ==========================================================================
   Foundation — Clarity
   Calmer, grounded, more whitespace than the hero.
   ========================================================================== */

.foundation {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
}

.foundation-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 72px;
  align-items: start;
}

.foundation h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.2;
  max-width: 420px;
}

.foundation-copy p {
  color: var(--ink-dim);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 22px;
}

.foundation-copy p:last-child { margin-bottom: 0; }

.founder-note {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  max-width: 520px;
  position: relative;
}

.founder-note::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.founder-note {
  padding-left: 24px;
}

.founder-note .role {
  display: block;
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

/* ==========================================================================
   Momentum — the system graphic + portfolio cards
   ========================================================================== */

.momentum {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}

.momentum-head {
  max-width: 640px;
  margin-bottom: 64px;
}

.momentum-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.2;
}

.momentum-head p {
  margin-top: 18px;
  color: var(--ink-dim);
  font-size: 1.05rem;
}

.system-graphic {
  width: 100%;
  height: auto;
  margin-bottom: 72px;
}

.system-graphic .node-line {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1;
}

.system-graphic .node-line.active {
  stroke: var(--accent);
  stroke-dasharray: 4 8;
}

@media (prefers-reduced-motion: no-preference) {
  .system-graphic .node-line.active {
    animation: dash-flow 12s linear infinite;
  }
}

.system-graphic circle.node {
  fill: var(--bg-2);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.system-graphic circle.node.active {
  stroke: var(--accent);
  fill: var(--accent-dim);
}

.system-graphic text {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.system-graphic text.active {
  fill: var(--ink);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.venture-card {
  background: rgba(244, 242, 236, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.venture-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
}

.venture-card.is-active {
  border-color: rgba(198, 255, 92, 0.35);
  background: linear-gradient(180deg, rgba(198,255,92,0.06), rgba(198,255,92,0.01));
}

.venture-card .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.venture-card.is-active .tag { color: var(--accent); }

.venture-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.venture-card p {
  font-size: 0.9rem;
  color: var(--ink-dim);
}

.venture-card .status {
  margin-top: 18px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-faint);
}

.venture-card.is-active .status { color: var(--ink); }

/* ==========================================================================
   Future — Possibility
   Expansive, brighter glow, calm confident close.
   ========================================================================== */

.future {
  background:
    radial-gradient(900px 500px at 50% 0%, var(--accent-glow), transparent 65%),
    var(--bg-3);
  border-top: 1px solid var(--line);
  text-align: center;
}

.future .container {
  max-width: 760px;
}

.future h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.14;
}

.future p.lead {
  margin: 22px auto 0;
  max-width: 540px;
  font-size: 1.1rem;
  color: var(--ink-dim);
}

.future .actions {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Contact block, nested inside Future */
.contact-panel {
  margin-top: 90px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
  text-align: left;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.contact-item .label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.contact-item .value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
}

.contact-item .value a {
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-item .value a:hover,
.contact-item .value a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.needs-input {
  color: #d8b657;
  font-style: italic;
  font-weight: 400;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  padding: 40px 0;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.site-footer .brand {
  font-size: 0.9rem;
  color: var(--ink-dim);
}

.site-footer .brand .mark {
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .foundation-grid { grid-template-columns: 1fr; gap: 40px; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-panel { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 760px) {
  .main-nav { display: none; }
  section { padding: 90px 0; }
  .hero { padding: 140px 0 100px; min-height: auto; }
  .scroll-cue { display: none; }
}

@media (max-width: 560px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .hero .actions,
  .future .actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
