/* =============================================================================
   Orange — Zlaté návyky / Golden Habits
   One stylesheet: tokens · base · type · layout · components · motion states
   Built on Orange brand foundations: #FF7900, Helvetica Neue, the square mark.
   Orange is a spotlight, never a wash.
   ========================================================================== */

/* ----------------------------------------------------------------- TOKENS -- */
:root {
  /* brand colour */
  --orange:    #FF7900;
  --orange-12: rgba(255,121,0,.12);
  --orange-40: rgba(255,121,0,.40);
  --gold:      linear-gradient(96deg, #FF7900 0%, #FFB05C 100%);

  --black:     #000000;
  --ink:       #0D0D0D;
  --surface:   #161616;
  --surface-2: #1F1F1F;
  --line:      #2A2A2A;
  --white:     #FFFFFF;
  --smoke:     #B3B3B3;
  --mute:      #767676;   /* nudged from brand #666 to clear WCAG AA on black */

  /* type — Orange's system: one family, personality from scale/weight/tracking */
  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, system-ui, sans-serif;

  --fs-display-xl: clamp(3rem, 9vw, 8.5rem);
  --fs-display-l:  clamp(2.4rem, 6vw, 5rem);
  --fs-h-mid:      clamp(1.85rem, 4vw, 3rem);
  --fs-lead:       clamp(1.2rem, 2.1vw, 1.6rem);
  --fs-habit:      clamp(1.18rem, 1.7vw, 1.45rem);
  --fs-body:       1.0625rem;
  --fs-label:      0.75rem;

  /* layout */
  --maxw:   1320px;
  --gutter: clamp(20px, 6vw, 120px);
  --pad-y:  clamp(80px, 12vh, 180px);

  /* the square through-line */
  --sq:  min(42vw, 440px);
  --sep: 2px;             /* gap between quadrants; grows on "split" */

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ------------------------------------------------------------------ RESET -- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--white);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

::selection { background: var(--orange); color: var(--black); }

/* Lenis smooth-scroll plumbing */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* --------------------------------------------------------- A11Y HELPERS --- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 2000;
  background: var(--orange); color: var(--black);
  padding: .65rem 1rem; font-weight: 700; transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

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

/* --------------------------------------------------------------- LAYOUT --- */
.eyebrow {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--smoke);
  display: inline-flex;
  align-items: center;
  gap: .7em;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--orange);
  flex: none;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.4;
  color: var(--smoke);
  max-width: 30ch;
}

/* ================================================================ HEADER == */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: rgba(13,13,13,.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(14px, 2.2vh, 24px) var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  transition: padding .4s var(--ease);
}
.site-header.is-solid .site-header__inner { padding-top: 12px; padding-bottom: 12px; }

.brand { display: inline-flex; }
.brand__logo {
  width: clamp(38px, 4vw, 46px); height: auto;
  transition: width .4s var(--ease);
}
.site-header.is-solid .brand__logo { width: 38px; }

/* quadrant nav (desktop) */
.quad-nav { display: none; }
@media (min-width: 1200px) {
  .quad-nav { display: flex; gap: clamp(1.1rem, 2.4vw, 2.6rem); align-items: center; }
  .quad-nav__link {
    position: relative;
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--smoke);
    padding: .55rem 0;
    transition: color .25s var(--ease);
    display: inline-flex; align-items: center; gap: .55em;
  }
  .quad-nav__link::before {
    content: ""; width: 6px; height: 6px; background: var(--orange);
    transform: scale(0); transition: transform .25s var(--ease);
  }
  .quad-nav__link:hover { color: var(--white); }
  .quad-nav__link.is-active { color: var(--orange); }
  .quad-nav__link.is-active::before { transform: scale(1); }
}

/* menu button (mobile) */
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; color: var(--white);
}
.menu-btn__icon { width: 24px; height: 24px; display: block; }
.menu-btn__icon svg { width: 100%; height: 100%; }
@media (min-width: 1200px) { .menu-btn { display: none; } }

/* mobile nav overlay */
.nav-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  display: flex; align-items: center;
  padding: var(--gutter);
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }
.nav-overlay__list { display: flex; flex-direction: column; gap: clamp(1rem, 4vh, 2rem); }
.nav-overlay__link {
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 700; letter-spacing: -.02em; color: var(--white);
  display: inline-flex; align-items: baseline; gap: .6em;
}
.nav-overlay__link .idx {
  font-size: var(--fs-label); letter-spacing: .14em; color: var(--mute);
  transform: translateY(-.2em);
}
.nav-overlay__link:active { color: var(--orange); }
.nav-flag {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5px;
  width: 22px; height: 22px; flex: none; align-self: center;
}
.nav-flag span { background: transparent; border: 1px solid var(--line); }
.nav-flag span.is-active { background: var(--orange); border-color: var(--orange); }

html.menu-open, html.menu-open body { overflow: hidden; }

/* ===================================================== SQUARE (through-line) */
/* Decorative geometry, NOT the logo. Fixed on desktop only. */
.square-stage {
  position: fixed; inset: 0; z-index: 1;
  display: none;                /* shown ≥1200 */
  align-items: center; justify-content: flex-end;
  padding-right: clamp(40px, 6vw, 120px);
  pointer-events: none;
}
@media (min-width: 1200px) { .square-stage { display: flex; } }

.square {
  position: relative;
  width: var(--sq); height: var(--sq);
  will-change: transform;
}
.quad {
  position: absolute;
  width:  calc((var(--sq) - var(--sep)) / 2);
  height: calc((var(--sq) - var(--sep)) / 2);
  background: var(--orange);
  border: 1.5px solid var(--orange);
  transition: background .55s var(--ease), border-color .55s var(--ease), opacity .55s var(--ease);
}
.quad--tl { top: 0; left: 0; }
.quad--tr { top: 0; right: 0; }
.quad--bl { bottom: 0; left: 0; }
.quad--br { bottom: 0; right: 0; }

/* split state: only the active quarter stays orange, others become outlines */
.square.is-split .quad { background: transparent; border-color: var(--line); }
.square.is-split .quad.is-active { background: var(--orange); border-color: var(--orange); }

/* ================================================================== HERO == */
.hero {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--pad-y) + 6vh) var(--gutter) var(--pad-y);
  max-width: var(--maxw); margin: 0 auto;
}
.hero__inner { max-width: 16ch; }
@media (min-width: 1200px) {
  .hero__inner { max-width: none; width: min(48%, 600px); transform: translateY(-6vh); }
}

.hero .eyebrow { margin-bottom: clamp(1.4rem, 3vh, 2.4rem); }

.hero__title {
  font-size: var(--fs-display-xl);
  font-weight: 700;
  line-height: .92;
  letter-spacing: -.035em;
}
/* mask for the line-by-line clip reveal; padding gives Slovak accents headroom,
   negative margin keeps the visual position unchanged */
.hero__title .line { display: block; overflow: hidden; padding: .2em 0 .5em; margin: -.2em 0 -.46em; }
.hero__title .line__in { display: block; }
.hero__title .line__in--gold {
  background: var(--gold);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  /* line-height < 1 pushes descenders below the element box; without extra
     bottom padding the gradient fill stops short and the y/ý tails vanish.
     Negative margin cancels the padding so layout position is unchanged. */
  padding-bottom: .3em; margin-bottom: -.3em;
}
/* tighter leading between the two title lines on large screens */
@media (min-width: 1200px) {
  .hero__title { line-height: .76; }
}
.hero__sub { margin-top: clamp(1.6rem, 3.5vh, 2.6rem); max-width: 36ch; }

.hero__scroll {
  position: absolute; left: var(--gutter); bottom: clamp(20px, 4vh, 40px);
  display: flex; align-items: center; gap: .9rem;
}
.hero__scroll-line {
  position: relative; width: 1px; height: 46px; background: var(--line); overflow: hidden;
}
.hero__scroll-line::after {
  content: ""; position: absolute; inset: 0; background: var(--orange);
  transform: translateY(-100%); animation: scrollPulse 2s var(--ease) infinite;
}
@keyframes scrollPulse {
  0%   { transform: translateY(-100%); }
  45%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}
.hero__scroll-label {
  font-size: var(--fs-label); letter-spacing: .2em; text-transform: uppercase; color: var(--mute);
}

/* inline hero square — shown on mobile, and on any device in the no-motion
   fallback (where the fixed through-line square is dropped) */
.hero__square { margin-top: clamp(2.4rem, 6vh, 4rem); }
.hero__square .square { --sq: min(62vw, 320px); }
@media (min-width: 1200px) { .hero__square { display: none; } }

/* no-motion fallback (reduced motion, missing library, or a JS error):
   drop the fixed through-line, lean on the inline squares instead */
.no-motion .square-stage { display: none; }
.no-motion .hero__square { display: block; }

/* ============================================================= MANIFESTO == */
.manifesto {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--pad-y) var(--gutter);
}
.manifesto__text {
  font-size: var(--fs-h-mid);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.02em;
  max-width: 22ch;
}
@media (min-width: 1200px) { .manifesto__text { max-width: 16ch; } }
/* split-words reveal (clip-safe rise, no overflow mask so accents never clip) */
.manifesto__text .word { display: inline-block; }
.manifesto__text .word__in { display: inline-block; will-change: transform, opacity; }

/* ============================================================== CHAPTERS == */
.chapters { position: relative; z-index: 2; }

.chapter {
  position: relative;
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--pad-y) var(--gutter);
  border-top: 1px solid var(--line);
}
.chapter:first-child { border-top: 0; }

.chapter__head { margin-bottom: clamp(2.4rem, 6vh, 4rem); }
.chapter__eyebrow { margin-bottom: 1.4rem; }

.chapter__title {
  font-size: var(--fs-display-l);
  font-weight: 700; line-height: .98; letter-spacing: -.03em;
}
.chapter__intro { margin-top: 1.3rem; max-width: 32ch; }

/* mobile / tablet inline quadrant flag (which quarter this area is) */
.quad-flag {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px;
  width: 40px; height: 40px; margin-bottom: 1.6rem;
}
.quad-flag span { background: transparent; border: 1.5px solid var(--line); }
.quad-flag span.is-active { background: var(--orange); border-color: var(--orange); }
@media (min-width: 1200px) { .quad-flag { display: none; } }

/* habit grid */
.habits {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
@media (min-width: 560px) { .habits { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1200px) {
  .chapter__inner { width: min(50%, 560px); }
  .habits { gap: 18px; }
}

/* habit tile — the core component */
.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(20px, 2.4vw, 28px);
  display: flex; flex-direction: column;
  min-height: 100%;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
@media (hover: hover) {
  .tile:hover {
    background: var(--surface-2);
    border-color: var(--orange-40);
    transform: translateY(-4px);
  }
}
.tile__icon { width: 28px; height: 28px; color: var(--orange); margin-bottom: clamp(1rem, 2vw, 1.5rem); }
.tile__icon svg { width: 100%; height: 100%; }
.tile__title {
  font-size: var(--fs-habit); font-weight: 700; line-height: 1.18; letter-spacing: -.01em;
  text-wrap: balance;
}
.tile__rec { margin-top: .6rem; color: var(--smoke); font-size: var(--fs-body); line-height: 1.5; }
.tile__mark {
  margin-top: clamp(1rem, 2vw, 1.4rem);
  width: 26px; height: 2px; background: var(--orange);
  transform-origin: left center;
}

/* =============================================================== CLOSING == */
.closing {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: var(--pad-y) var(--gutter);
  border-top: 1px solid var(--line);
}
.closing__square { margin-bottom: clamp(2.6rem, 7vh, 5rem); }
.closing__square .square { --sq: min(64vw, 300px); }
.closing__eyebrow { justify-content: center; margin-bottom: clamp(1.6rem, 4vh, 2.4rem); }
.closing__line {
  font-size: var(--fs-display-l);
  font-weight: 700; line-height: 1.0; letter-spacing: -.03em;
  max-width: 16ch;
}
.closing__sub { margin-top: 1.4rem; color: var(--smoke); max-width: none; }
/* ================================================================ FOOTER == */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink);
}
.site-footer__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(26px, 3.5vh, 40px) var(--gutter);
  display: flex; flex-wrap: wrap; gap: 1.4rem 2rem;
  align-items: center; justify-content: space-between;
}

.site-footer__brand { display: flex; align-items: center; gap: 1.1rem; }
.brand--footer .brand__logo { width: 44px; }
.site-footer__id { display: flex; flex-direction: column; gap: .35rem; }
.footer-title {
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -.01em; color: var(--white);
}
.footer-copy { font-size: var(--fs-label); letter-spacing: .04em; color: var(--mute); }

.site-footer__cta { display: flex; flex-direction: column; gap: .6rem; align-items: flex-end; text-align: right; }
.footer-link {
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  font-weight: 700; letter-spacing: -.01em;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 4px;
  transition: color .2s var(--ease);
}
.footer-link:hover { color: var(--orange); }

@media (max-width: 560px) {
  .site-footer__inner { align-items: flex-start; }
  .site-footer__cta { align-items: flex-start; text-align: left; }
}

/* ============================================================= PRELOADER == */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
}
.preloader[hidden] { display: none; }
.preloader__square { position: relative; width: 104px; height: 104px; }
.pq { position: absolute; width: 50px; height: 50px; background: var(--orange); }
.pq--tl { top: 0; left: 0; } .pq--tr { top: 0; right: 0; }
.pq--bl { bottom: 0; left: 0; } .pq--br { bottom: 0; right: 0; }

/* ===================================================== MOBILE REDESIGN ===== */
/* Below 1200px the fixed through-line square doesn't exist. Hero + manifesto
   keep the desktop's left-aligned editorial voice; the chapters and their habit
   cards centre up, and the quadrant marks do the wayfinding. Desktop (≥1200px)
   is deliberately left untouched. */
@media (max-width: 1199.98px) {

  /* ---- HERO + MANIFESTO: left-aligned & editorial -----------------------
     Centring the hero is what made it read as a generic template. Keep the
     same left-aligned voice as the desktop layout; just drop the old cramped
     16ch column so the title and copy use the full width. */
  .hero__inner { max-width: none; }

  /* ---- CHAPTERS: centred head + centred cards ---------------------------- */
  .chapter__inner { text-align: center; }
  .chapter__eyebrow { justify-content: center; }
  .quad-flag { margin-inline: auto; }
  .chapter__intro { margin-inline: auto; }

  /* habit cards: centred content; accent bar grows from the middle */
  .tile { align-items: center; text-align: center; }
  .tile__icon { margin-inline: auto; }
  .tile__mark { margin-inline: auto; transform-origin: center; }

  /* ---- MOBILE MENU: realign the quadrant marks --------------------------- */
  /* index column gives every label the same start; align-items:center stops
     the mini-square from floating off the text baseline */
  .nav-overlay__list { counter-reset: navidx; gap: clamp(1.4rem, 5vh, 2.4rem); }
  .nav-overlay__link { align-items: center; gap: .75em; }
  .nav-overlay__link::before {
    counter-increment: navidx;
    content: counter(navidx, decimal-leading-zero);
    min-width: 2ch;
    font-size: var(--fs-label); font-weight: 700; letter-spacing: .14em;
    color: var(--mute);
  }
  .nav-flag {
    width: clamp(28px, 7vw, 34px); height: clamp(28px, 7vw, 34px);
    gap: 2px; align-self: center;
  }
}

/* =================================================== MOTION INITIAL STATES = */
/* Applied only when JS will animate (html.js-motion). Without JS everything
   is visible by default — the page is "finished" with zero motion. */
.js-motion .reveal { opacity: 0; transform: translateY(22px); }
.js-motion .hero__title .line__in { transform: translateY(140%); }
.js-motion .hero__sub,
.js-motion .hero .eyebrow,
.js-motion .hero__scroll { opacity: 0; }
.js-motion .manifesto__text .word__in { opacity: 0; transform: translateY(.55em); }
.js-motion .tile { opacity: 0; transform: translateY(24px); }
.js-motion .tile__mark { transform: scaleX(0); }
.js-motion .square-stage { opacity: 0; }

/* =================================================== REDUCED MOTION ======== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .hero__scroll-line::after { display: none; }
  /* ensure nothing is left hidden by motion classes */
  .js-motion .reveal,
  .js-motion .hero__sub, .js-motion .hero .eyebrow, .js-motion .hero__scroll,
  .js-motion .tile { opacity: 1; transform: none; }
  .js-motion .hero__title .line__in,
  .js-motion .manifesto__text .word__in { transform: none; opacity: 1; }
  .js-motion .tile__mark { transform: scaleX(1); }
  .js-motion .square-stage { opacity: 1; }
}
