/* ==========================================================================
   Adam Bartoš — personal portfolio
   "Warm terminal" direction: cream base, terracotta accent, editorial type,
   IBM Plex Mono chrome. Ported from the Fable 5 design into plain HTML/CSS/JS.
   ========================================================================== */

:root {
  /* color */
  --bg: #f7f5f1;
  --surface: #ffffff;
  --hero-canvas: #efebe4;
  --ink: #1b1d1f;
  --ink-2: #4a4f4c;
  --muted: #6c716e;
  --muted-2: #9a9e9b;
  --accent: #c2603a;
  --accent-hover: #9e4826;
  --accent-soft: rgba(194, 96, 58, 0.09);
  --border: rgba(27, 29, 31, 0.07);
  --border-strong: rgba(27, 29, 31, 0.18);

  /* type */
  --font-sans: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* layout */
  --maxw: 1080px;
  --gutter: 28px;
  --radius: 18px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- reset -------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

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

h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-hover); }
::selection { background: var(--ink); color: var(--bg); }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -48px; left: 16px; z-index: 100;
  background: var(--ink); color: var(--bg); font-family: var(--font-mono);
  font-size: 13px; padding: 10px 16px; border-radius: 10px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; color: var(--bg); }

@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;
  }
}

/* ---- background system-prompt easter egg -------------------------------- */

.sysprompt {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.sysprompt__scroll {
  animation: sysScroll 110s linear infinite;
  font-family: var(--font-mono);
  font-size: 12px; line-height: 2.6;
  color: rgba(27, 29, 31, 0.045);
  white-space: pre-wrap; padding: 0 40px; text-align: justify;
}
@keyframes sysScroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

.page { position: relative; z-index: 1; }

/* ---- nav ---------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(247, 245, 241, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 13px;
}
.nav__path { display: flex; align-items: center; color: var(--ink); font-weight: 500; }
.nav__cursor {
  display: inline-block; width: 7px; height: 15px; margin-left: 8px;
  background: var(--accent); animation: blink 1.15s step-end infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.nav__links { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.nav__links a { color: var(--muted); font-size: 13px; }
.nav__links a:hover { color: var(--ink); }

/* ---- buttons ------------------------------------------------------------ */

.btn {
  display: inline-block; font-size: 15px; font-weight: 500;
  padding: 15px 30px; border-radius: 999px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn--dark { background: var(--ink); color: var(--bg); }
.btn--dark:hover { background: var(--accent); color: var(--bg); }

.btn--ghost { border: 1px solid var(--border-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); background: rgba(27, 29, 31, 0.04); }

.btn--light { background: var(--bg); color: var(--ink); }
.btn--light:hover { background: var(--accent); color: var(--bg); }

.btn--outline { border: 1px solid rgba(247, 245, 241, 0.24); color: var(--bg); }
.btn--outline:hover { border-color: var(--bg); color: var(--bg); background: rgba(247, 245, 241, 0.08); }

/* ---- shared section ----------------------------------------------------- */

.section { }
.section__inner { max-width: var(--maxw); margin: 0 auto; padding: 80px var(--gutter); }

.section__head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 44px; }
.section__lead { margin-top: 6px; font-size: 16px; color: var(--ink-2); max-width: 540px; }

.eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--muted-2); }
.eyebrow--dark { color: rgba(247, 245, 241, 0.5); }

.section__title {
  font-size: clamp(30px, 3.6vw, 42px); font-weight: 700; letter-spacing: -0.025em;
}

/* ---- hero --------------------------------------------------------------- */

.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 56px var(--gutter) 96px;
  display: flex; flex-direction: column; gap: 32px; align-items: center;
}
.hero__frame {
  position: relative; width: 100%;
  border-radius: 20px; overflow: hidden; background: var(--hero-canvas);
  box-shadow: 0 24px 60px -32px rgba(27, 29, 31, 0.28);
}
.hero__canvas { display: block; width: 100%; height: clamp(380px, 52vw, 540px); cursor: crosshair; }
.hero__overlay {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 22px; padding: 40px;
  background: radial-gradient(ellipse 66% 56% at center,
    rgba(247, 245, 241, 0.7) 0%, rgba(247, 245, 241, 0.34) 58%, rgba(247, 245, 241, 0) 84%);
}
.hero__badge {
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  background: rgba(247, 245, 241, 0.7); padding: 6px 14px; border-radius: 999px;
}
.hero__title {
  font-size: clamp(46px, 7vw, 88px); line-height: 1.02; font-weight: 700;
  letter-spacing: -0.035em; color: var(--ink);
}
.hero__tagline {
  font-size: clamp(18px, 2.4vw, 26px); font-weight: 500; color: var(--accent);
  letter-spacing: -0.01em;
}
.hero__lead {
  font-size: 17px; line-height: 1.65; color: var(--ink-2);
  max-width: 560px; text-wrap: pretty;
}
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- about -------------------------------------------------------------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(320px, 1.3fr);
  gap: 56px;
}
.about__head { display: flex; flex-direction: column; gap: 10px; }
.about__body { display: flex; flex-direction: column; gap: 22px; }
.about__lead-p {
  font-size: 21px; line-height: 1.55; color: var(--ink);
  letter-spacing: -0.01em; text-wrap: pretty;
}
.about__lead-p strong { color: var(--accent); font-weight: 600; }
.about__p { font-size: 16px; line-height: 1.75; color: var(--ink-2); text-wrap: pretty; }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-top: 8px;
}
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.stat__k { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); letter-spacing: 0.04em; }
.stat__v { font-size: 17px; font-weight: 600; margin-top: 6px; color: var(--ink); }

@media (max-width: 720px) {
  .about__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ---- cards (shared) ----------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
/* cap card width (auto-fill + fixed max) so a single project reads as a normal
   card instead of stretching full-width; future cards pack in neatly. */
.cards--projects { grid-template-columns: repeat(auto-fill, minmax(300px, 400px)); align-items: start; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column;
}

/* service + project hover lift */
.card--service, .card--project {
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card--service:hover, .card--project:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -26px rgba(27, 29, 31, 0.4);
}

.card--service { padding: 30px; gap: 12px; }
.card__num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.card__title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.card__desc { font-size: 15px; line-height: 1.65; color: var(--ink-2); }

/* ---- project cards ------------------------------------------------------ */

.card--project { overflow: hidden; }
.card__media { display: block; overflow: hidden; border-bottom: 1px solid var(--border); }
.card__media img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top;
  transition: transform 0.35s var(--ease);
}
.card--live:hover .card__media img { transform: scale(1.04); }

.card__body { display: flex; flex-direction: column; gap: 14px; padding: 30px; flex: 1; }
.card__row { display: flex; align-items: center; justify-content: space-between; }
.card__id { font-family: var(--font-mono); font-size: 12px; color: var(--muted-2); }

.card__badge {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  background: var(--accent-soft); padding: 4px 10px; border-radius: 999px;
}
.card__badge--live { color: #2f7d4f; background: rgba(47, 125, 79, 0.1); }

.card--project .card__title {
  font-size: 19px; font-weight: 600; letter-spacing: -0.015em;
  display: flex; align-items: center; gap: 8px;
}
.card__redacted {
  display: inline-block; width: 100px; height: 16px;
  background: rgba(27, 29, 31, 0.1); border-radius: 4px;
}

.card__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.tag {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  background: rgba(27, 29, 31, 0.05); padding: 4px 10px; border-radius: 999px;
}

.card__link {
  align-self: flex-start; font-family: var(--font-mono); font-size: 13px;
  color: var(--ink); border-bottom: 1px solid transparent;
}
.card__link:hover { color: var(--accent); border-color: var(--accent); }

/* ---- references note (honest "on request" state) ----------------------- */

.reviews-note {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(30px, 5vw, 44px); max-width: 720px;
  display: flex; flex-direction: column; gap: 18px;
}
.reviews-note__text { font-size: 18px; line-height: 1.65; color: var(--ink); text-wrap: pretty; }

/* ---- contact ------------------------------------------------------------ */

.contact {
  background: var(--ink); border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 72px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 26px;
}
.contact__title {
  font-size: clamp(32px, 4.5vw, 54px); font-weight: 700; letter-spacing: -0.03em;
  color: var(--bg); line-height: 1.05; max-width: 640px; text-wrap: pretty;
}
.contact__lead {
  font-size: 17px; line-height: 1.65; color: rgba(247, 245, 241, 0.68); max-width: 500px;
}
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---- footer ------------------------------------------------------------- */

.footer { border-top: 1px solid var(--border); }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 26px var(--gutter);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted-2);
}

/* ---- 404 ---------------------------------------------------------------- */

.notfound {
  min-height: 100vh; min-height: 100svh;
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 18px;
}
.notfound__eyebrow { font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.notfound__eyebrow span { color: var(--accent); }
.notfound__title { font-size: clamp(40px, 8vw, 80px); font-weight: 700; letter-spacing: -0.03em; }
.notfound__text { font-size: 18px; color: var(--ink-2); max-width: 32rem; }
.notfound .btn { margin-top: 10px; }
