/* ==========================================================================
   Ooble — styles
   Palette and type are unchanged from the original; --ember is sampled from
   the orange drip in the logo and used sparingly (progress bar, errors).
   ========================================================================== */

:root {
  --ink: #070706;
  --ink-2: #14120e;
  --ink-3: #1d1a15;
  --bone: #f3efe6;
  --mute: #b7b1a6;
  --line: #2c2923;
  --lime: #d6f34a;
  --ember: #f66a08;
  --sans: "Syne", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --bar-h: 4rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, label { cursor: pointer; }

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

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

/* ---------- Language switch (CSS-only, JS remembers the choice) ---------- */

.lang-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.sk { display: none; }
#lang-sk:checked ~ * .sk { display: inline; }
#lang-sk:checked ~ * .en { display: none; }

/* ---------- Skip link ---------- */

.skip {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--lime);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Top bar ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--bar-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  transition: transform 0.35s var(--ease);
}

/* Hides on scroll-down, comes back on scroll-up (set by script.js). */
.bar.is-hidden { transform: translateY(-100%); }

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 72rem;
  height: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.bar-mark {
  display: block;
  height: 2.25rem;
  width: auto;
  transition: transform 0.5s var(--ease);
}
.brand:hover .bar-mark { transform: rotate(-8deg) scale(1.05); }

.bar-nav { display: none; }

.bar-nav a,
.bar-cta {
  position: relative;
  padding: 0.5rem 0;
  color: var(--mute);
  transition: color 0.2s;
}
.bar-cta { color: var(--bone); }

.bar-nav a::after,
.bar-cta::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.bar-nav a:hover,
.bar-nav a.is-active,
.bar-cta:hover,
.bar-cta.is-active { color: var(--bone); }

.bar-nav a:hover::after,
.bar-nav a.is-active::after,
.bar-cta:hover::after,
.bar-cta.is-active::after { transform: scaleX(1); }

.bar-tools { display: flex; align-items: center; gap: 1.5rem; }

.kicker {
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lang { display: flex; align-items: center; gap: 0.35rem; }
.lang label { padding: 0.5rem 0.15rem; transition: color 0.2s; }
.lang label:hover { color: var(--lime) !important; }
.lang label[for="lang-en"] { color: var(--bone); }
.lang label[for="lang-sk"] { color: var(--mute); }
#lang-sk:checked ~ header label[for="lang-en"] { color: var(--mute); }
#lang-sk:checked ~ header label[for="lang-sk"] { color: var(--bone); }
#lang-en:focus-visible ~ header label[for="lang-en"],
#lang-sk:focus-visible ~ header label[for="lang-sk"] {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}
.slash { color: var(--mute); }

/* Scroll progress, fed by script.js through --p (0–1). */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--lime), var(--ember));
  transform: scaleX(var(--p, 0));
  transform-origin: left;
}

/* ---------- Chapters ---------- */

.chapter {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100dvh;
}

.chapter-pad {
  width: min(100%, 64rem);
  margin: 0 auto;
  padding: 7.5rem 1.25rem 5.5rem;
}

.hero { padding: 6rem 1.25rem 7rem; }

/* The logo is 880×490 (about 1.8:1). Size it by the screen height as well as
   the width, so the lede and the scroll cue still fit on a laptop screen. */
.hero img {
  display: block;
  width: min(100%, 64rem, (100dvh - 28rem) * 1.8);
  min-width: min(100%, 22rem);
  height: auto;
  margin: 0 auto;
}

.lede {
  max-width: 46rem;
  margin: 2.5rem auto 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  line-height: 1.2;
}
.lede-left { margin-left: 0; margin-top: 1.25rem; }

.cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem;
  translate: -50% 0;
  transition: color 0.2s;
}
.cue:hover { color: var(--bone); }

.cue-drip {
  position: relative;
  width: 2px;
  height: 3.25rem;
  overflow: hidden;
  background: var(--line);
  border-radius: 2px;
}
.cue-drip::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lime);
  transform: translateY(-100%);
}

.display {
  margin-top: 1rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 8vw, 6.75rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.copy {
  max-width: 40rem;
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.mute { color: var(--mute); }

/* ---------- Cards ---------- */

.cards, .partners {
  display: grid;
  gap: 2.5rem;
  margin-top: 3rem;
  padding: 0;
  list-style: none;
}

.cards h3, .method h3, .partners h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1;
}

.cards p, .method p { margin-top: 0.75rem; }

.lime { background: var(--lime); color: var(--ink); }
.lime :focus-visible { outline-color: var(--ink); }
.lime ::selection { background: var(--ink); color: var(--lime); }

.ruled h3,
.tools-list h3 {
  position: relative;
  padding-top: 1.25rem;
}
.ruled h3 { border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); }
.tools-list h3 { border-top: 1px solid var(--line); }

/* A line that draws across the rule on hover. */
.ruled h3::before,
.tools-list h3::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.ruled h3::before { background: var(--ink); }
.tools-list h3::before { background: var(--lime); }
.ruled li:hover h3::before,
.tools-list li:hover h3::before { transform: scaleX(1); }

/* ---------- Partners ---------- */

.partners { gap: 1px; background: var(--line); border: 1px solid var(--line); }

.partners li {
  position: relative;
  background: var(--ink-2);
  padding: 1.75rem 1.25rem;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.partners h3 { font-size: 2.5rem; transition: transform 0.4s var(--ease); }
.partners p { margin-top: 1rem; transition: color 0.3s; }

@media (hover: hover) {
  .partners li:hover { background: var(--lime); color: var(--ink); }
  .partners li:hover p { color: color-mix(in srgb, var(--ink) 70%, transparent); }
  .partners li:hover h3 { transform: translateX(0.35rem); }
}

/* ---------- Method ---------- */

.method { margin-top: 2rem; padding: 0; list-style: none; }

.method li {
  display: grid;
  gap: 0.75rem;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.method li:last-child { border-bottom: 1px solid var(--line); }
.method li > .kicker { transition: color 0.3s; }
.method li:hover > .kicker { color: var(--lime); }

/* ---------- Contact form ---------- */

.form {
  display: grid;
  gap: 1.25rem;
  max-width: 40rem;
  margin-top: 3rem;
}

.form-row { display: grid; gap: 1.25rem; }

.field { display: grid; gap: 0.5rem; cursor: default; }
.field-head { display: flex; justify-content: space-between; gap: 1rem; }
.optional { margin-left: 0.5rem; color: color-mix(in srgb, var(--mute) 60%, transparent); }
.count { font-variant-numeric: tabular-nums; transition: color 0.2s; }
.count.is-near { color: var(--ember); }

.form input,
.form textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--ink-2);
  color: var(--bone);
  font: inherit;
  font-size: 1rem; /* 16px stops iOS zooming on focus */
  transition: border-color 0.2s, background 0.2s;
}
.form input:hover,
.form textarea:hover { border-color: #3d3931; }
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--lime);
  background: var(--ink-3);
}

.form textarea { min-height: 8rem; resize: vertical; }

.field.is-invalid input,
.field.is-invalid textarea { border-color: var(--ember); }

.field-error {
  min-height: 0;
  color: var(--ember);
  font-size: 0.85rem;
}
.field-error:empty { display: none; }

.trap {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.25rem;
}

.fine { font-size: 0.85rem; }

.form button {
  position: relative;
  min-height: 3rem;
  padding: 0 1.75rem;
  border: 0;
  background: var(--lime);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s;
}
.form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 -2px var(--ember);
}
.form button:active { transform: translateY(0); box-shadow: none; }
.form button[disabled] { cursor: progress; opacity: 0.8; transform: none; box-shadow: none; }

.btn-busy { display: none; }
.form.is-busy .btn-label { display: none; }
.form.is-busy .btn-busy { display: inline; }
.form.is-busy .btn-busy::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: dots 1.2s steps(4) infinite;
}

.form-status {
  min-height: 1.5rem;
  font-size: 0.95rem;
}
.form-status:empty { display: none; }
.form-status.is-ok,
.form-status.is-bad {
  padding: 1rem 1.25rem;
  border-left: 2px solid;
  background: var(--ink-2);
}
.form-status.is-ok { border-color: var(--lime); }
.form-status.is-bad { border-color: var(--ember); }

/* After a successful send, the form collapses to the thank-you note. */
.form.is-sent .field,
.form.is-sent .form-row,
.form.is-sent .form-foot { display: none; }

/* No-JS fallback notices. */
.notice {
  display: none;
  max-width: 40rem;
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--lime);
  background: var(--ink-2);
}
.notice-bad { border-color: var(--ember); }
.notice:target { display: block; }

.foot { margin-top: 3rem; }

/* ---------- Footer ---------- */

.site-foot { border-top: 1px solid var(--line); }
.site-foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom));
}
.to-top { padding: 0.5rem 0; transition: color 0.2s; }
.to-top:hover { color: var(--lime); }

/* ---------- Motion (only with JS and when the visitor allows it) ---------- */

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

@keyframes drip {
  0% { transform: translateY(-100%); }
  55% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

@keyframes pour {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-0.75rem); }
  to { clip-path: inset(0 0 -2% 0); transform: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .cue-drip::before { animation: drip 2.4s var(--ease) infinite; }

  .js .hero-logo img { animation: pour 1.4s var(--ease) 0.1s both; }
  .js .hero .lede { animation: rise 0.9s var(--ease) 0.7s both; }
  .js .hero .cue { animation: rise 0.9s var(--ease) 1s both; }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(1.25rem);
    transition:
      opacity 0.8s var(--ease) var(--d, 0s),
      transform 0.8s var(--ease) var(--d, 0s);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- Larger screens ---------- */

@media (min-width: 768px) {
  html { scroll-snap-type: y proximity; }
  .chapter { scroll-snap-align: start; }

  .bar-inner, .chapter-pad, .hero, .site-foot-inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .cards, .partners { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .method li {
    grid-template-columns: 6rem 14rem 1fr;
    align-items: baseline;
  }
  .method p { margin-top: 0; }
}

@media (min-width: 960px) {
  .bar-nav { display: flex; gap: 2rem; }
}

@media (max-width: 380px) {
  .bar-tools { gap: 1rem; }
  .brand .kicker { display: none; }
}
