/* Home page — same type system and layout tokens as kristynagottvald.github.io:
   Barlow Semi Condensed 300 for headings, Inter for body copy and all-caps labels, soft black ground. */
:root {
  /* Type scale: five sizes. Title / H2 / H3 are the condensed headings; body is the sans copy; label is the all-caps eyebrow, link and caption size. */
  --fs-title: 58px;
  --fs-h2: 40px;
  --fs-h3: 26px;
  --fs-body: 20px;
  --fs-label: 12px;
  --lh-title: 1;
  --lh-head: 1.1;
  --lh-body: 27px;
  --ls-head: -0.03em;
  --ls-label: .1em;
  --bg: #181716;          /* soft black */
  --off-black: #252423;   /* a step lighter than the page, for cards and media placeholders */
  --ink: #fff;
  --grey: #989898;
  --mid-grey: #6b6b6b;
  --line: rgba(255,255,255,.1);
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --cond: "Barlow Semi Condensed", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.15, 0, 0.15, 1);
  --pad: 8px;      /* margin around the hero, images and tiles */
  --indent: 12px;  /* right-hand text padding */
  --left: 22px;    /* left edge for text: 8px page margin + 22px = 30px, flush with the logo */
  --nav-h: 72px;
  --r-sm: 4px;
  --r-md: 8px;
}
@media (max-width: 639px) { :root { --fs-title: 40px; --fs-h2: 30px; --fs-h3: 22px; } }
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.25 var(--sans); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; font-weight: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid #d7ff3a; outline-offset: 3px; }
.grey { color: var(--grey); }
/* all-caps labels use the body font, letter-spaced */
.caps { font: 400 var(--fs-label)/1.3 var(--sans); letter-spacing: var(--ls-label); text-transform: uppercase; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; height: var(--nav-h); display: flex; align-items: baseline; gap: 48px; padding: 24px calc(var(--pad) + var(--left)) 0; background: var(--bg); white-space: nowrap; }
.logo { flex: none; font: 400 29px/1 var(--cond); letter-spacing: -0.02em; color: #fff; }
.top-nav { display: flex; gap: 32px; }
.top-nav a { color: var(--grey); transition: color .2s; }
.top-nav a:hover, .top-nav a[aria-current] { color: #fff; }
.status { margin-left: auto; display: block; color: var(--grey); transition: color .2s; }
.status:hover { color: #fff; }
.dot-live { position: relative; display: inline-block; vertical-align: .7px; margin-right: 10px; width: 6px; height: 6px; border-radius: 50%; background: #8fd694; }
.dot-live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid #8fd694; opacity: 0; animation: dot-ripple 4s ease-out infinite; }
@keyframes dot-ripple { 0% { opacity: .7; transform: scale(1); } 35% { opacity: 0; transform: scale(2.8); } 100% { opacity: 0; transform: scale(2.8); } }

/* ---------- Hero preview: 70% of the first screen, every tool's clip in turn ---------- */
.hero { position: relative; margin: 8px var(--pad) 0; height: max(360px, calc((100svh - var(--nav-h) - 8px) * .7)); border-radius: var(--r-sm); overflow: hidden; background: var(--off-black); container-type: size; --R: 6px; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s linear, visibility 0s .9s; background: var(--off-black); }
.slide.is-on { opacity: 1; visibility: visible; transition: opacity .9s linear; }
/* the clip is the whole hero background */
.slide-card { position: absolute; inset: 0; background: #000; }
.slide-card { overflow: hidden; }
.slide-card .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-frame { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; max-width: none; border: 0; background: #000; transform-origin: center; pointer-events: none; opacity: 0; transition: opacity .4s linear; }
.slide-frame.live { opacity: 1; }
/* inset soft-black tab in the bottom-right corner, flush with the edges. It stays put while the clips change; only the caption inside it swaps */
.hero-tab { position: absolute; right: 0; bottom: 0; z-index: 2; width: min(48cqw, 500px); height: 100px; display: grid; background: var(--bg); border-top-left-radius: var(--R); }
.hero-tab::before, .hero-tab::after { content: ""; position: absolute; width: var(--R); height: var(--R); background: radial-gradient(circle at 0 0, transparent var(--R), var(--bg) calc(var(--R) + .5px)); pointer-events: none; }
.hero-tab::before { right: 0; bottom: 100%; }   /* soft curve where the tab meets the right edge */
.hero-tab::after { right: 100%; bottom: 0; }    /* and where it meets the bottom edge */
.slide-cap { grid-area: 1 / 1; min-width: 0; padding: 0 30px 0 40px; align-content: center; display: grid; opacity: 0; visibility: hidden; transition: opacity .4s linear, visibility 0s .4s; }
.slide-cap.is-on { opacity: 1; visibility: visible; transition: opacity .4s linear .4s; }
/* title in white over the category in grey, both in Inter */
.slide-cap h2 { font: 400 var(--fs-body)/1.25 var(--sans); white-space: nowrap; color: #fff; }   /* same size as the titles and categories in the tool list */
.slide-name { display: flex; width: fit-content; align-items: center; gap: .3em; padding-bottom: 2px; border-bottom: 1px solid rgba(152,152,152,.5); color: var(--grey); transition: color .2s, border-color .2s; }   /* the category is the link to the tool: thin underline, arrow on the right */
.slide-name svg { width: .45em; height: .45em; transition: transform .3s var(--ease); }
.slide-name:hover, .slide-name:focus-visible { color: #fff; border-bottom-color: #fff; }
.slide-name:hover svg { transform: translate(2px, -2px); }

/* ---------- Intro: the other 30% of the first screen ---------- */
.intro { display: flex; align-items: center; min-height: calc((100svh - var(--nav-h) - 8px) * .3); padding: 28px var(--pad) 28px calc(var(--pad) + var(--left)); }
.intro p { max-width: 18em; font: 300 var(--fs-h2)/var(--lh-head) var(--cond); letter-spacing: var(--ls-head); text-wrap: pretty; }
.intro p span { color: var(--grey); }

/* ---------- All tools: heading left, 2-column grid right (same as Selected Work on the portfolio) ---------- */
.t-condensed { font-family: var(--cond); font-weight: 300; font-size: var(--fs-h2); line-height: var(--lh-head); letter-spacing: var(--ls-head); }
.work { display: grid; grid-template-columns: 1fr; padding: 72px var(--pad) 120px; border-top: 1px solid var(--line); margin: 72px var(--pad) 0; padding-left: 0; padding-right: 0; }
.work-side { padding: 0 0 24px var(--left); }
.work-list { display: grid; grid-template-columns: 1fr; }
.card a { display: flex; flex-direction: column; gap: 10px; padding: 12px; transition: opacity .17s linear; }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-md); background: var(--off-black); container-type: size; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-meta { position: relative; padding: 0 20px 4px 0; }
.card-title { font-size: var(--fs-body); }
.card-sub { color: var(--grey); font-size: var(--fs-body); font-weight: 300; }
.card-arrow { position: absolute; top: 5px; right: 0; color: var(--grey); transition: color .2s; }
.card a:hover .card-arrow { color: var(--ink); }
.work-list .card { border-top: 1px solid var(--line); }
.work-list .card:first-child { border-top: 0; }
@media (min-width: 700px) {
  .work { grid-template-columns: calc(25.45% - 12px) 1fr; gap: 12px; }
  .work-list { grid-template-columns: 1fr 1fr; }
  .work-list .card:nth-child(2) { border-top: 0; }
  .work-list .card:nth-child(even) { border-left: 1px solid var(--line); }
  /* an odd number of tools leaves the last right-hand cell empty: draw its lines so the grid stays closed */
  .work-list:has(> .card:last-child:nth-child(odd))::after { content: ""; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
  .work-list .card a { padding: 12px 12px 16px; }
  .work-list:hover .card a { opacity: .35; }
  .work-list .card a:hover { opacity: 1; }
}
@media (hover: none) { .work-list:hover .card a { opacity: 1; } }

/* ---------- About: 5fr / 9fr split, same as Contact ---------- */
.about { display: grid; grid-template-columns: 5fr 9fr; gap: 72px 8px; margin: 0 var(--pad); padding: 72px 0 120px; min-height: 90vh; align-content: start; border-top: 1px solid var(--line); }
.about h2 { grid-column: 1 / -1; padding-left: var(--left); font: 300 var(--fs-h2)/var(--lh-head) var(--cond); letter-spacing: var(--ls-head); max-width: 36ch; text-wrap: pretty; }
.about-cols { grid-column: 2; display: grid; gap: 24px; min-width: 0; padding-right: var(--indent); align-content: start; }
.about-cols p { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 300; color: var(--grey); max-width: 35em; text-wrap: pretty; }
.about-cols p:first-child { color: var(--ink); }
.about-cols a { color: var(--grey); border-bottom: 1px solid var(--mid-grey); transition: color .2s, border-color .2s; }
.about-cols a:hover { color: #fff; border-color: #fff; }

/* ---------- Contact ---------- */
.contact { padding: 24px var(--pad) 0; border-top: 1px solid var(--line); min-height: calc(100svh - 72px); display: flex; flex-direction: column; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 48px; padding-top: 24px; }
.contact-head { padding-left: var(--left); display: grid; gap: 14px; align-content: start; }
.contact-head .caps { color: var(--grey); }
.contact h2 { font: 300 var(--fs-h2)/var(--lh-head) var(--cond); letter-spacing: var(--ls-head); }
.contact-rows { display: grid; }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 5fr 9fr; gap: 8px; }
  .contact-grid .contact-rows { grid-column: 2; }
}
.contact-row { display: grid; grid-template-columns: 4fr 5fr; gap: 8px; padding: 12px 0 36px; border-top: 1px solid var(--line); }
.contact-row h3 { font-size: var(--fs-body); padding-left: var(--left); }
.contact-row > div { display: grid; gap: 2px; justify-items: start; color: var(--grey); font-weight: 300; }
.contact-row a { transition: color .2s; }
.contact-row a:hover { color: #fff; }
.foot { margin-top: auto; padding: 80px var(--indent) 16px var(--left); display: flex; justify-content: space-between; color: var(--mid-grey); }
.foot a:hover { color: var(--ink); }

@media (max-width: 899px) {
  .about { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .about-cols { grid-column: 1; padding-left: var(--left); }
}
@media (max-width: 800px) {
  /* one text edge on phones: 20px from the screen, the same as the tool cards' images and titles */
  :root { --left: 12px; }
  /* phone / tablet: clip on top, caption underneath, all inside the same rounded panel */
  .hero { height: auto; container-type: normal; display: grid; }
  .slide { position: relative; grid-area: 1 / 1; display: grid; align-content: start; background: var(--bg); }
  .slide-card { position: relative; inset: auto; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; }
  .hero-tab { position: static; grid-row: 2; width: 100%; height: auto; border-radius: 0; }
  .hero-tab::before, .hero-tab::after { display: none; }
  .slide-cap { padding: 22px var(--left) 18px; }
  .intro { padding-right: calc(var(--pad) + var(--left)); }
}
.nav-jump, .tagline { display: none; }
@media (max-width: 760px) {
  :root { --nav-h: 86px; }
  .top { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; align-items: baseline; align-content: start; padding-top: 22px; }
  .logo { grid-column: 1 / -1; }
  .status { display: none; }
  .tagline { display: block; grid-row: 2; grid-column: 1; color: var(--grey); }
  .nav-jump { display: inline-flex; align-items: center; gap: 6px; grid-row: 2; grid-column: 2; color: #fff; }
  .nav-jump svg { transition: transform .25s var(--ease); }
  .top.open .nav-jump svg { transform: rotate(180deg); }
  .top-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 4px calc(var(--pad) + var(--left)) 12px; background: var(--bg); border-bottom: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s linear, transform .25s var(--ease), visibility 0s .25s; }
  .top.open .top-nav { opacity: 1; visibility: visible; transform: none; transition: opacity .2s linear, transform .25s var(--ease); }
  .top-nav a { padding: 14px 0; border-top: 1px solid var(--line); }
  .top-nav a:first-child { border-top: 0; }
  .contact-row { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
