/* ============================================================
   skrivanek.cc — design system
   Functionalist minimalism · Poppins · Rosso Corsa accent (#FF0200)
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --paper:        #fafaf8;
  --paper-deep:   #f1f1ed;
  --paper-line:   rgba(16, 16, 16, 0.12);
  --ink:          #101010;
  --ink-2:        #101010;
  --ink-3:        #171717;
  --rosso:        #ff0200;
  --rosso-deep:   #d80200;
  --rosso-tint:   rgba(255, 2, 0, 0.07);
  --cream:        #f6f2ea;
  --muted:        rgba(16, 16, 16, 0.6);
  --muted-dark:   rgba(246, 242, 234, 0.6);

  --font-display: "Poppins", system-ui, sans-serif;
  --font-body:    "Poppins", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;
  --font-time:    "Public Sans", "Poppins", sans-serif;

  --ease-out:     cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout:   cubic-bezier(0.65, 0, 0.35, 1);
  --container:    1280px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-weight: 400;
}

::selection { background: var(--rosso); color: #fff; }

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-tag { color: var(--muted); margin-bottom: 1.2rem; }
.section-tag--dark { color: var(--muted-dark); }
.work-label { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.work-label__rule { flex: 0 0 3.5rem; height: 2px; background: var(--rosso); }
.period { color: var(--rosso); }

/* ============================================================
   Nav link (footer only)
   ============================================================ */
.nav-link {
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); position: relative; padding: 0.3rem 0;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1.5px; background: var(--rosso);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-link--dark { color: var(--cream); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 76svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 4rem 2rem 2.5rem;
  max-width: var(--container); margin: 0 auto;
}

.hero-kicker {
  display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.4rem;
}
.hero-kicker .mono { color: var(--muted); font-size: 0.7rem; }
.hero-kicker__rule { flex: 0 0 3.5rem; height: 2px; background: var(--rosso); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 600; line-height: 1.02;
  font-size: clamp(2.7rem, 9.5vw, 7.8rem);
  letter-spacing: -0.04em;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span {
  display: inline-block;
  transform: translateY(112%);
  animation: rise 1.1s var(--ease-out) forwards;
}
@keyframes rise { to { transform: translateY(0); } }

.hero-foot {
  display: flex; align-items: center; gap: 2rem;
  margin-top: 2.2rem; padding-top: 1.3rem;
  border-top: 1px solid var(--paper-line);
}
.hero-sub { max-width: 46ch; color: var(--muted); font-size: 0.98rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.85rem;
  border-radius: 999px; padding: 1rem 1.7rem;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: transform 0.3s var(--ease-out), background 0.3s, color 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn-icon { display: inline-block; font-size: 1rem; line-height: 1; transition: transform 0.3s var(--ease-out); }
.btn:hover .btn-icon { transform: translate(3px, -3px); }

.btn--solid { background: var(--rosso); color: #fff; }
.btn--solid:hover { background: var(--rosso-deep); }
.btn--ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ============================================================
   Project strip
   ============================================================ */
.strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}
.strip__item {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 1rem 1.4rem;
  border-left: 1px solid var(--paper-line);
  transition: background 0.25s, color 0.25s;
}
.strip__item:first-child { border-left: 0; }
.strip__name { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.strip__url { color: var(--muted); font-size: 0.6rem; transition: color 0.25s; }
.strip__item:hover { background: var(--rosso); }
.strip__item:hover .strip__name,
.strip__item:hover .strip__url { color: #fff; }

/* ============================================================
   Manifesto
   ============================================================ */
.manifesto { padding: 5rem 2rem 6rem; max-width: var(--container); margin: 0 auto; }
.manifesto__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.8rem, 4.4vw, 3.4rem);
  line-height: 1.2; letter-spacing: -0.02em;
  max-width: 20ch; margin-bottom: 1.5rem;
}
.manifesto__text {
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  line-height: 1.7;
  max-width: 52ch;
}

/* ============================================================
   Work / Projects
   ============================================================ */
.work { padding: 0 2rem 5.5rem; max-width: var(--container); margin: 0 auto; }
.work-head { margin-bottom: 2.4rem; display: flex; align-items: center; gap: 1.4rem; }
.work-title { margin-bottom: 0; white-space: nowrap; }
.work-head__line { display: block; flex: 1; height: 2px; background: var(--rosso); }
.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.3rem, 5.4vw, 4.5rem);
  line-height: 1.08; letter-spacing: -0.03em;
  margin-bottom: 1.1rem;
}
.work-intro { color: var(--muted); max-width: 44ch; }

.project { border-top: 1px solid var(--paper-line); padding: 2.2rem 0; }
.work .project:first-of-type { border-top: none; }
.project__meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 1.4rem;
}
.project__index { color: var(--rosso); font-weight: 500; }
.project__discipline { color: var(--muted); }
.project__body {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem; align-items: center;
}
.project__main { min-width: 0; }
.project__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.1rem, 4.3vw, 3.6rem);
  line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: 1.05rem;
}
.project__desc { color: var(--muted); max-width: 48ch; margin-bottom: 1.6rem; }
.project__links { display: flex; flex-wrap: wrap; gap: 1.8rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); position: relative; padding-bottom: 0.25rem;
}
.link-arrow::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.link-arrow:hover::after { transform: scaleX(1); transform-origin: left; }
.link-arrow span { color: var(--rosso); transition: transform 0.3s var(--ease-out); }
.link-arrow:hover span { transform: translate(3px, -3px); }

/* ---------- Project visual ---------- */
.project__visual {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid var(--paper-line);
  border-radius: 16px;
  transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
  box-shadow: 0 24px 60px -34px rgba(16, 16, 16, 0.28);
}
.project:hover .project__visual { transform: translateY(-6px); box-shadow: 0 40px 80px -40px rgba(16, 16, 16, 0.3); }
.project__visual--fill { padding: 0; }

.screen__img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   App replicas
   ============================================================ */
.app { width: 100%; height: 100%; }

/* --- Thinks --- */
.app--thinks {
  background: #fffef8; color: #000;
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 2.2rem 1.6rem;
}
.thinks__graph {
  position: absolute; top: 1rem; left: 1rem;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid #deddd9; background: #fffef8;
  display: grid; place-items: center; color: #000;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.thinks__graph:hover { background: #23221f; color: #fff; border-color: #23221f; }
.thinks__composer { width: 100%; max-width: 520px; }
.thinks__memories { margin-top: 1.4rem; }
.thinks__shead {
  display: flex; align-items: center; gap: 14px;
  color: #323232; font-size: 12px; font-weight: 500;
  margin-bottom: 12px;
}
.thinks__sline { flex: 1; height: 1px; background: #323232; }
.thinks__editor {
  width: 100%; resize: none; border: 0; outline: none; background: transparent;
  color: #000;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(22px, 2.6vw, 30px); line-height: 1.5;
  padding: 0; overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.thinks__editor::placeholder { color: #c4bcae; }
.thinks__editor.is-flying { animation: think-fly 0.5s ease forwards; }
@keyframes think-fly {
  0% { opacity: 1; transform: translateY(0); }
  60% { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-28px); filter: blur(4px); }
}
.thinks__suggestions {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.thinks__suggestion {
  border: 1px solid #deddd9; border-radius: 14px;
  background: linear-gradient(180deg, #fbfbf9 0%, #efefef 100%);
  color: #323232; padding: 13px 16px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 13px; font-weight: 500; line-height: 1.35;
  opacity: 0; transform: translateY(6px);
  animation: think-in 0.3s ease forwards;
}
@keyframes think-in { to { opacity: 1; transform: translateY(0); } }

/* --- Lum --- */
.app--lum {
  background: #f2f1f6; color: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.4rem;
  position: relative;
}
.lum-mini__brand {
  position: absolute; top: 1.1rem; left: 1.2rem;
  font-family: var(--font-display); font-weight: 500; font-size: 1.35rem;
  writing-mode: vertical-rl; transform: rotate(180deg); line-height: 1;
}
.lum-mini__clock {
  display: flex; align-items: baseline; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.lum-mini__time {
  font-family: var(--font-time); font-weight: 500;
  font-size: clamp(2.2rem, 5.5vw, 4.1rem);
  letter-spacing: -0.03em; line-height: 1;
}

/* --- QuickWiki --- */
.app--qw {
  background: #ffffff; color: #000;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.app--qw::-webkit-scrollbar { display: none; }
.qw__head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky; top: 0; background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}
.qw__logo {
  width: 1.55rem; height: 1.55rem; border-radius: 50%;
  background: #000; color: #fff;
  display: grid; place-items: center; flex: none;
}
.qw__name { font-weight: 600; font-size: 0.92rem; letter-spacing: -0.01em; margin-right: auto; }
.qw__langs { display: flex; gap: 0.15rem; }
.qw__lang {
  font-family: var(--font-mono); font-size: 0.5rem; font-weight: 500;
  letter-spacing: 0.08em; color: rgba(0, 0, 0, 0.4);
  border-radius: 999px; padding: 0.18rem 0.45rem;
  transition: background 0.2s, color 0.2s;
}
.qw__lang.is-on { background: #000; color: #fff; }
.qw__body {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 1rem 1.4rem 1.05rem; gap: 0.25rem;
}
.qw__hero { font-weight: 600; font-size: clamp(1.05rem, 2.2vw, 1.4rem); letter-spacing: -0.02em; }
.qw__sub { font-size: 0.75rem; color: rgba(0, 0, 0, 0.5); margin-bottom: 0.5rem; }
.qw__search {
  display: flex; align-items: center; width: 100%; max-width: 380px;
  background: rgba(0, 0, 0, 0.04); border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px; padding: 0.25rem 0.25rem 0.25rem 1rem;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.4);
}
.qw__input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 500;
  color: #000; min-width: 0;
}
.qw__btn {
  background: #000; color: #fff; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 0.55rem 1.05rem; white-space: nowrap;
  transition: opacity 0.2s, transform 0.1s;
}
.qw__btn:hover { opacity: 0.88; }
.qw__btn:active { transform: scale(0.96); }
.qw__result {
  margin-top: 0.7rem; width: 100%; max-width: 380px; text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 16px;
  padding: 0.85rem 1.1rem; background: rgba(0, 0, 0, 0.025);
  animation: qw-in 0.5s var(--ease-out) both;
}
@keyframes qw-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.qw__badge {
  display: inline-block; font-size: 0.52rem;
  background: rgba(0, 0, 0, 0.05); border-radius: 999px; padding: 0.22rem 0.6rem;
  color: rgba(0, 0, 0, 0.55);
}
.qw__title { font-size: 1.12rem; font-weight: 600; margin: 0.42rem 0 0.28rem; letter-spacing: -0.02em; }
.qw__def { font-size: 0.8rem; line-height: 1.45; color: rgba(0, 0, 0, 0.72); }
.qw__source { display: inline-block; margin-top: 0.55rem; font-size: 0.68rem; font-weight: 500; color: rgba(0, 0, 0, 0.5); }
.qw__loading {
  margin-top: 1rem; width: 100%; max-width: 380px; text-align: left;
}
.qw__loading-line {
  height: 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.05);
  margin-bottom: 8px; animation: shimmer 1.2s var(--ease-inout) infinite;
}
.qw__loading-line:nth-child(2) { width: 88%; }
.qw__loading-line:nth-child(3) { width: 60%; }
@keyframes shimmer { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* --- 4-7-8 --- */
.app--478 {
  background: #f9fafb; color: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 1.4rem; text-align: center;
  font-family: var(--font-mono);
}
.b478__head { font-size: clamp(1rem, 2.2vw, 1.4rem); font-weight: 400; }
.b478__time { font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.b478__segments { display: flex; gap: 6px; min-height: 48px; align-items: center; }
.b478__seg {
  width: 13px; height: 46px; border: 2px solid #000;
  transition: background 0.3s var(--ease-inout), height 0.3s var(--ease-inout);
}
.b478__seg.is-full { background: #000; }
.b478__controls { display: flex; gap: 10px; }
.b478__btn {
  font-family: var(--font-mono); font-size: 0.72rem;
  border-radius: 8px; padding: 0.5rem 1.4rem; font-weight: 500;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.b478__btn--solid { background: #000; color: #fff; }
.b478__btn--solid:hover { background: #222; }
.b478__btn--ghost { background: #e5e7eb; color: #000; }
.b478__btn--ghost:hover { background: #d1d5db; }
.b478__cycle { font-size: 0.62rem; color: rgba(0, 0, 0, 0.55); }

/* ---------- Alternating layout ---------- */
.project--alt .project__body { direction: rtl; }
.project--alt .project__body > * { direction: ltr; }

/* ============================================================
   Principles (dark)
   ============================================================ */
.principles {
  background: var(--ink-2); color: var(--cream);
  padding: 6rem 2rem;
}
.principles__grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3.5rem;
}
.principle { border-top: 1.5px solid rgba(246, 242, 234, 0.16); padding-top: 1.6rem; }
.principle__no { color: var(--rosso); font-weight: 500; }
.principle__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.5rem; letter-spacing: -0.01em; margin: 1rem 0 0.7rem;
}
.principle__text { color: var(--muted-dark); font-size: 0.92rem; }

/* ============================================================
   Contact
   ============================================================ */
.contact { padding: 5.5rem 2rem 6rem; max-width: var(--container); margin: 0 auto; }
.contact .section-title { margin-bottom: 2.6rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ============================================================
   Footer
   ============================================================ */
.footer { background: var(--ink-2); color: var(--cream); }
.footer__row {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 2.2rem 2rem;
}
.footer__copy { color: var(--muted-dark); }
.footer__links { display: flex; gap: 1.8rem; }
.nav-link--dark { color: var(--cream); }

/* ============================================================
   Reveal on scroll
   ============================================================ */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .project__body { grid-template-columns: 1fr; gap: 2rem; }
  .project--alt .project__body { direction: ltr; }
  .project--alt .project__body > * { direction: ltr; }
  .principles__grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip__item:nth-child(odd) { border-left: 0; }
  .strip__item:nth-child(n+3) { border-top: 1px solid var(--paper-line); }
  .hero { padding-top: 4.5rem; }
}

@media (max-width: 620px) {
  .nav { padding: 1rem 1.2rem; }
  .nav-links { display: none; }
  .hero, .manifesto, .work, .contact { padding-left: 1.2rem; padding-right: 1.2rem; }
  .hero { min-height: 66svh; padding-top: 3.5rem; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .hero-sub { font-size: 0.92rem; }
  .contact__actions { flex-direction: column; align-items: stretch; }
  .contact__actions .btn { justify-content: center; }
  .footer__row { flex-direction: column; gap: 1.2rem; text-align: center; }
  .thinks__suggestions { grid-template-columns: 1fr; }
  .principles { padding: 4rem 1.2rem; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
