/* =========================================================================
   KLUS & CO — Stylesheet
   IDX 01 / SS01
   One file. Square corners. Hairline rules. Type does the work.
   ========================================================================= */

/* ---- Design Tokens -------------------------------------------------------- */
:root {
  /* Palette — light default */
  --bg:        #f4f3ee;
  --fg:        #0a0a0a;
  --fg-soft:   rgba(10, 10, 10, 0.72);
  --fg-faint:  rgba(10, 10, 10, 0.42);
  --rule:      rgba(10, 10, 10, 0.16);
  --rule-soft: rgba(10, 10, 10, 0.08);
  --hover-tint:rgba(10, 10, 10, 0.04);

  /* Accent — warm amber/gold */
  --accent:       #d4a24e;
  --accent-hover: #e0b365;
  --accent-soft:  rgba(212, 162, 78, 0.18);
  --accent-faint: rgba(212, 162, 78, 0.10);
  --accent-fg:    #f4f3ee;

  /* Typography — two families only */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:    "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    var(--font-sans);

  /* Type scale */
  --fs-mega: clamp(2.5rem, 5.5vw, 5rem);
  --fs-h1:   clamp(1.75rem, 3.5vw, 2.75rem);
  --fs-h2:   clamp(1.25rem, 2vw, 1.75rem);
  --fs-body: clamp(1rem, 1.05vw, 1.125rem);
  --fs-meta: 11px;

  /* Spacing — 8pt-ish but a touch wider */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --space-8: 9rem;
  --space-9: 13rem;

  /* Layout */
  --gutter: clamp(1.5rem, 5vw, 4rem);
  --maxw:   1120px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --d-slow: 900ms;
  --d-base: 600ms;
  --d-fast: 280ms;
}

/* Dark-mode stub — invert palette. CSS is ready; no toggle wired. */
:root[data-theme="dark"] {
  --bg:        #0a0a0a;
  --fg:        #f4f3ee;
  --fg-soft:   rgba(244, 243, 238, 0.72);
  --fg-faint:  rgba(244, 243, 238, 0.42);
  --rule:      rgba(244, 243, 238, 0.14);
  --rule-soft: rgba(244, 243, 238, 0.08);
  --hover-tint:rgba(244, 243, 238, 0.04);

  --accent:       #d4a24e;
  --accent-hover: #e0b365;
  --accent-soft:  rgba(212, 162, 78, 0.18);
  --accent-faint: rgba(212, 162, 78, 0.10);
  --accent-fg:    #0a0a0a;
}

/* ---- Smooth scroll (respects prefers-reduced-motion via rule at bottom) --- */
html { scroll-behavior: smooth; }

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--accent-fg); }

/* ---- Base ----------------------------------------------------------------- */
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-feature-settings: "ss01", "ss02", "kern";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Grain overlay — disabled for light theme */
body::after {
  display: none;
}

/* Vignette — disabled for light theme */
body::before {
  display: none;
}

/* ---- Utility -------------------------------------------------------------- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
  font-weight: 400;
}

.mono--faint { color: var(--fg-faint); }
.mono--solid { color: var(--fg); }

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  width: 100%;
}

/* ---- Top bar -------------------------------------------------------------- */
.topbar {
  display: none;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-4);
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  font-weight: 500;
}
.wordmark__mark {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.18em;
  color: var(--accent);
  font-style: normal;
  border: 1px solid var(--accent-soft);
  padding: 0.25rem 0.45rem;
  text-transform: uppercase;
}
.wordmark__name em {
  font-style: italic;
  font-weight: 400;
}

.nav {
  display: flex;
  gap: var(--space-5);
}
.nav__item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  position: relative;
  padding: 0.4rem 0;
}
.nav__num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--fg-faint);
}
.nav__label {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.nav__item::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--d-fast) var(--ease);
}
.nav__item:hover::after { transform: scaleX(1); }
.nav__item:hover .nav__label { color: var(--accent); }

/* ---- Nav toggle (hamburger) ----------------------------------------------- */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  position: relative;
  border: 1px solid var(--rule);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 52;
}
.nav-toggle__line {
  display: block;
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--fg);
  transition: transform var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease);
}
.nav-toggle__line:nth-child(1) { top: 13px; }
.nav-toggle__line:nth-child(2) { top: 19px; }
.nav-toggle__line:nth-child(3) { top: 25px; }

/* Hamburger → × animation */
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 51;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--d-fast) var(--ease);
  }
  .nav.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__item {
    font-size: 1.25rem;
  }
  .nav__label {
    font-size: 0.875rem;
  }
  .nav__num {
    font-size: 0.75rem;
  }
}

/* ---- Reveal motion -------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--d-base) var(--ease), transform var(--d-base) var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Page-load stagger — applied via inline --i index */
.stagger > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise var(--d-base) var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 80ms + 120ms);
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

/* 2-column hero grid on desktop */
.hero__grid {
  display: block;
}
@media (min-width: 880px) {
  .hero__grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--space-5);
    align-items: end;
  }
}

.hero__right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero__eyebrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}
.hero__eyebrow .mono {
  font-size: 0.875rem;
  letter-spacing: 0.18em;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: var(--fs-mega);
  line-height: 0.88;
  letter-spacing: -0.035em;
  font-weight: 400;
  margin: 0;
  color: var(--fg);
}
.hero__headline .word {
  display: inline-block;
  margin-right: 0.18em;
}
.hero__headline .word.italic {
  font-style: italic;
  font-weight: 300;
}
.hero__headline .br { display: block; height: 0; }

/* Word-level reveal */
.hero__headline .word {
  opacity: 0;
  transform: translateY(40%);
  clip-path: inset(0 0 100% 0);
  animation: wordRise var(--d-slow) var(--ease) forwards;
  animation-delay: calc(var(--wi, 0) * 90ms + 220ms);
}
@keyframes wordRise {
  to {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0 0 0 0);
  }
}

/* CTA button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.85rem 1.6rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
}
.btn-cta::after {
  content: "→";
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0;
  transition: transform var(--d-fast) var(--ease);
}
.btn-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}
.btn-cta:hover::after {
  transform: translateX(3px);
}

/* Services tags */
.hero__services {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
@media (max-width: 879px) {
  .hero__services { margin-top: var(--space-3); }
}
.hero__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
  border: 1px solid var(--rule);
  padding: 0.35rem 0.7rem;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.hero__tag:hover {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-faint);
  color: var(--fg);
}

/* USP blocks — inline flex */
.hero__usps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
}
.hero__usp {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.hero__usp:not(:first-child)::before {
  content: "·";
  color: var(--fg-faint);
  margin-right: var(--space-1);
}
.hero__usp-icon {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
}
.hero__usp-text {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
}

/* Hero support — subtitle under headline */
.hero__support {
  margin-top: var(--space-2);
}

.hero__support p {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  line-height: 1.4;
  font-weight: 400;
  color: var(--fg-soft);
  max-width: 48ch;
  margin: 0;
}

/* ---- Ticker --------------------------------------------------------------- */
.ticker {
  overflow: hidden;
  padding: var(--space-4) 0;
  position: relative;
}
.ticker__track {
  display: flex;
  gap: var(--space-6);
  width: max-content;
  animation: scroll 48s linear infinite;
  white-space: nowrap;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
}
.ticker__item::after {
  content: "✦";
  font-style: normal;
  font-size: 0.5em;
  color: var(--accent);
  transform: translateY(-0.5em);
}
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- About ---------------------------------------------------------------- */
.about {
  padding: var(--space-8) 0;
}
.about__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
@media (min-width: 880px) {
  .about__grid {
    grid-template-columns: 5fr 1fr 5fr 1fr;
    gap: var(--space-6);
  }
}

.about__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0;
}
.about__title em { font-style: italic; font-weight: 300; }

.about__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.about__col p {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--fg-soft);
  margin: 0;
  max-width: 44ch;
}

.about__aside {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-left: 1px solid var(--rule);
  padding-left: var(--space-4);
}
@media (max-width: 879px) {
  .about__aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: var(--space-4); }
}
.about__aside p {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--fg);
  margin: 0;
}

.about__spacer { display: none; }
@media (min-width: 880px) { .about__spacer { display: block; } }

/* ---- Index list ----------------------------------------------------------- */
.indexlist {
  padding: var(--space-4) 0 var(--space-3);
}
.indexlist__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
  gap: var(--space-4);
}
.indexlist__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0;
}
.indexlist__title em { font-style: italic; font-weight: 300; }

.indexlist__rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  position: relative;
  cursor: default;
  transition: background var(--d-fast) var(--ease), padding var(--d-fast) var(--ease);
}
@media (min-width: 880px) {
  .row {
    grid-template-columns: 80px minmax(0, 6fr) minmax(0, 5fr) 90px;
    gap: var(--space-5);
    align-items: baseline;
  }
}
.row:hover { background: var(--accent-faint); padding-left: var(--space-3); padding-right: var(--space-3); }

.row__num {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.16em;
  color: var(--fg-faint);
}

.row__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--fg);
  margin: 0;
}
.row:nth-child(odd) .row__title em,
.row:nth-child(even) .row__title { font-style: normal; }
.row:nth-child(2n) .row__title { font-style: italic; font-weight: 300; }

.row__desc {
  color: var(--fg-soft);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 52ch;
  margin: 0;
}

.row__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  text-align: right;
  white-space: nowrap;
}
@media (max-width: 879px) {
  .row__desc, .row__tag { grid-column: 2 / -1; }
  .row__tag { text-align: left; margin-top: var(--space-2); }
}

/* ---- Footer --------------------------------------------------------------- */
.footer {
  margin-top: auto;
  padding: var(--space-4) 0 var(--space-3);
}
.footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
@media (min-width: 720px) {
  .footer__top {
    grid-template-columns: repeat(2, 1fr);
    align-items: end;
  }
}
.footer__big {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin: 0 0 var(--space-4) 0;
}
.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-3);
}
.footer__clock::before {
  content: "●";
  display: inline-block;
  margin-right: 0.5em;
  color: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* ---- 404 page ------------------------------------------------------------- */
.notfound {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) 0 var(--space-8);
  text-align: center;
}
.notfound__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.notfound__big {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 14rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  font-weight: 400;
  margin: 0;
}
.notfound__big em { font-style: italic; font-weight: 300; }
.notfound__rule { width: 80px; height: 1px; background: var(--fg-faint); margin: var(--space-3) 0; }
.notfound__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.7rem 1rem;
  border: 1px solid var(--rule);
  position: relative;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.notfound__back::before {
  content: "←";
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0;
  transform: translateY(-1px);
  transition: transform var(--d-fast) var(--ease);
}
.notfound__back:hover { background: var(--hover-tint); border-color: var(--accent); color: var(--accent); }
.notfound__back:hover::before { transform: translateX(-3px) translateY(-1px); }

/* ---- Floating CTA --------------------------------------------------------- */
.fab-cta {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: var(--fs-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  background: #c0392b;
  color: #fff;
  padding: 0.85rem 1.4rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(192, 57, 43, 0.25);
  transition: background var(--d-fast) var(--ease), transform var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.fab-cta:hover {
  background: #e74c3c;
  transform: translateY(-2px);
  box-shadow: 0 6px 32px rgba(192, 57, 43, 0.35);
}
.fab-cta__arrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0;
  transition: transform var(--d-fast) var(--ease);
}
.fab-cta:hover .fab-cta__arrow {
  transform: translateX(3px);
}
@media (max-width: 480px) {
  .fab-cta {
    bottom: var(--space-3);
    right: var(--space-3);
    padding: 0.75rem 1.1rem;
    font-size: 10px;
  }
}

/* ---- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .stagger > *,
  .hero__headline .word {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
  .ticker__track { animation: none; }
}
