/* ============================================================================
   Naďa Ryšánková — portfolio
   Page & section styles. Design tokens live in tokens.css; this file only
   composes them into the layouts of the site.
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body { margin: 0; position: relative; }

img { max-width: 100%; }

/* Sticky nav must not cover the section an anchor jumps to. */
:target, [id] { scroll-margin-top: 90px; }

a { cursor: pointer; }

/* ---------------------------------------------------------------------------
   Full-screen sections — fill the viewport and centre their content;
   sections with more content than one screen simply grow.
   ------------------------------------------------------------------------- */
.screen {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
}

/* ---------------------------------------------------------------------------
   Skip link
   ------------------------------------------------------------------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--action); color: var(--action-inverse);
  padding: 12px 20px; border-radius: 0 0 var(--rounded-sm) 0;
  font-size: 0.875rem; font-weight: 500;
}
.skip-link:focus { left: 0; color: var(--action-inverse); }

/* ---------------------------------------------------------------------------
   Nav — dark bar that joins the dark hero
   ------------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-on-dark); white-space: nowrap;
}
.nav-links {
  display: flex; gap: var(--space-5); align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  font-size: 0.85rem; font-weight: 500; color: var(--text-on-dark-muted);
  transition: color var(--dur) var(--ease);
}
.nav-links a:hover { color: var(--text-on-dark); }
.nav-links a:not(.nav-cta) { position: relative; }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 280ms var(--ease);
}
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-links a.nav-cta {
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: var(--rounded-pill);
  padding: 7px 16px; color: var(--text-on-dark); white-space: nowrap;
}
.nav-links a.nav-cta:hover {
  background: var(--action-inverse); border-color: var(--action-inverse); color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   Placeholders for content still to come
   ------------------------------------------------------------------------- */
.todo {
  display: inline-block; font-family: var(--font-sans);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-secondary);
  border: 1px dashed var(--text-muted); border-radius: var(--rounded-sm);
  padding: 2px 8px; background: var(--surface);
}
.todo-block {
  display: block;
  border: 1px dashed var(--border-hairline); border-radius: var(--rounded-md);
  padding: var(--space-4); background: var(--surface);
  color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5;
}
.ph-fill {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: var(--space-3);
  color: var(--text-muted); font-size: 0.85rem; text-align: center;
}

/* ---------------------------------------------------------------------------
   Hero — dark, fills the screen below the nav
   ------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  min-height: calc(100svh - 65px);   /* 65px = nav height */
  padding-block: var(--space-8);
}
.hero .container { position: relative; }
.hero h1 { margin: 0 0 var(--space-6); }
/* .h1-shift starts a new line (the hero claim after "Dávám webům", the contact
   question after "který"); the word splitter wraps that span in inline blocks,
   so those wrappers go block too. */
.h1-shift,
.word:has(.h1-shift), .word:has(.h1-shift) > .word-in { display: block; }
.hero .lead {
  font-size: 1.25rem; line-height: 1.5;
  max-width: 54ch; margin: 0 0 var(--space-6);
}
/* the claim's lead is two short paragraphs; the second is quieter and sits close */
.hero .lead:has(+ .lead-sub) { margin-bottom: var(--space-3); }
.hero .lead-sub { font-size: 1.05rem; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-4); }

/* ---------------------------------------------------------------------------
   Section heads
   ------------------------------------------------------------------------- */
.section-head {
  display: flex; flex-direction: column; gap: var(--space-3);
  margin-bottom: var(--space-6); max-width: 60ch;
}
.section-head.row {
  flex-direction: row; justify-content: space-between; align-items: flex-end;
  max-width: none;
}
.approach-head { margin-bottom: var(--space-6); }

/* ---------------------------------------------------------------------------
   Work / samples
   ------------------------------------------------------------------------- */
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8) var(--space-6); }
.work-card { display: block; color: inherit; }
.work-card .media { aspect-ratio: 16 / 11; margin-bottom: var(--space-5); position: relative; }
.work-card .media img { height: 100%; object-fit: cover; }
/* projects that are not live yet show their mockup in greyscale */
.work-card.is-upcoming .media img { filter: grayscale(1); }
.work-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.work-meta .caption { white-space: nowrap; }
.work-card h3 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.15;
  margin: var(--space-3) 0;
}
a.work-card:hover h3 {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.work-card .prose { margin: 0 0 var(--space-2); line-height: 1.65; }

/* ---------------------------------------------------------------------------
   How I work (dark section)
   ------------------------------------------------------------------------- */
.list-row { justify-content: space-between; }
.list-row .row-left { display: flex; align-items: baseline; gap: var(--space-4); }
.list-row .h-ui { transition: transform 320ms var(--ease); }
.list-row:hover .h-ui { transform: translateX(10px); }
.list-row .row-note {
  color: var(--text-on-dark-muted); font-size: 0.9rem;
  /* fixed width so the notes start on one line down the list, ragged right */
  flex: 0 0 min(60ch, 48%); text-align: left;
}
.list-row.last { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }

/* ---------------------------------------------------------------------------
   About
   ------------------------------------------------------------------------- */
.about-grid {
  display: grid; grid-template-columns: 0.85fr 1.15fr;
  gap: var(--space-7); align-items: center;
}
.about-media { aspect-ratio: 4 / 5; }
.about-media img { height: 100%; object-fit: cover; object-position: 50% 20%; }
.about-copy h2 { margin: 0 0 var(--space-4); text-wrap: balance; }
.about-copy .prose + .prose { margin-top: var(--space-4); }
.about-copy .about-belief { color: var(--text-primary); font-weight: 500; }

/* ---------------------------------------------------------------------------
   Contact (dark, full screen)
   ------------------------------------------------------------------------- */
.contact-cta { text-align: center; }
.contact-cta .big {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  line-height: 1.08; letter-spacing: -0.03em;
  margin: 0 0 var(--space-6); text-wrap: balance;
}
.contact-cta .prose { margin: 0 auto var(--space-3); text-align: center; }
.contact-cta .hero-actions { justify-content: center; margin-top: var(--space-6); }

/* ---------------------------------------------------------------------------
   Footer (dark, joins the contact section)
   ------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-block: var(--space-5);
}
.site-footer .container {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--space-3);
}
.site-footer .caption { margin: 0; color: var(--text-on-dark-muted); }
.site-footer .foot-links { display: flex; gap: var(--space-4); }
.site-footer .foot-links a { font-size: 0.875rem; font-weight: 500; color: var(--text-on-dark-muted); }
.site-footer .foot-links a:hover { color: var(--text-on-dark); }

/* ---------------------------------------------------------------------------
   Case study
   ------------------------------------------------------------------------- */
.cs-back { display: inline-flex; margin-bottom: var(--space-5); font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.cs-back:hover { color: var(--text-primary); }
.cs-hero { padding-block: var(--space-8) var(--space-6); }
.cs-hero h1 { max-width: 20ch; text-wrap: balance; margin: 0 0 var(--space-5); }
.cs-summary { font-size: 1.35rem; line-height: 1.45; color: var(--text-secondary); max-width: 60ch; margin: 0; }
.cs-meta {
  display: flex; flex-wrap: wrap; gap: var(--space-6);
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: 1px solid var(--border-hairline);
}
.cs-meta .k {
  display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em;
  color: var(--text-muted); margin-bottom: 4px;
}
.cs-meta .v { font-size: 0.95rem; color: var(--text-primary); }
.cs-meta .v a { text-decoration: underline; text-underline-offset: 3px; }
.cs-cover { padding-top: 0; padding-bottom: var(--space-5); }   /* the hero above and the first block below already leave room */
.cs-cover .media { aspect-ratio: 16 / 9; }
.cs-cover.is-upcoming .media img { filter: grayscale(1); }
/* A real cover image sets the frame's shape itself */
.cs-cover .media:has(img) { aspect-ratio: auto; }
.cs-block { padding-block: var(--space-7); border-top: 1px solid var(--border-hairline); }
.cs-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: var(--space-6); align-items: start; }
.cs-grid h2 { margin: 0; }
.cs-block .prose + .prose { margin-top: var(--space-4); }

.constraints { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin-top: var(--space-2); }
.constraint {
  background: var(--surface); border: 1px solid var(--border-hairline);
  border-radius: var(--rounded-md); padding: var(--space-4);
}
.constraint strong { display: block; font-size: 0.95rem; margin-bottom: 4px; }
/* block, so the line-height applies instead of the body's 1.65 */
.constraint span { display: block; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.4; }

/* Solutions: numbered decisions */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-top: var(--space-5); }
.pillar { border-top: 1px solid var(--border-hairline); padding-top: var(--space-4); }
.pillar-num {
  display: block; margin-bottom: var(--space-3);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.5rem, 4vw, 3.5rem); line-height: 1; letter-spacing: -0.04em;
  color: var(--text-primary);
}
.pillar h3 { font-size: 1.15rem; margin: 0 0 var(--space-2); }
.pillar p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }

.process-list { margin-top: var(--space-4); }
.process-list .h-ui { font-size: 1.15rem; }
.process-list .list-row.last { border-bottom: 1px solid var(--border-hairline); }

/* Social posts grouped by series, four per row (4:5) */
.social-series { margin-top: var(--space-6); }
.social-label { margin: 0 0 var(--space-3); }
/* slides sit 4px apart and only the outer corners are rounded, so a series reads as one carousel */
.social-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.social-post { margin: 0; overflow: hidden; background: var(--bg-muted); }
.social-post:first-child { border-radius: var(--rounded-md) 0 0 var(--rounded-md); }
.social-post:last-child { border-radius: 0 var(--rounded-md) var(--rounded-md) 0; }
/* standalone posts are not a series, so each keeps all four corners */
.social-strip.is-single .social-post { border-radius: var(--rounded-md); }
.social-post img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  transition: transform var(--dur) var(--ease);
}

.beforeafter { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-top: var(--space-4); }
.beforeafter figure { margin: 0; }
.beforeafter .media { aspect-ratio: 4 / 3; margin-bottom: var(--space-2); }
.beforeafter figcaption {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; color: var(--text-muted);
}

.impact-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.stat {
  background: var(--surface); border: 1px solid var(--border-hairline);
  border-radius: var(--rounded-md); padding: var(--space-5);
}
.stat .num { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.stat .lbl { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.4; margin-top: var(--space-2); }

/* Ukázky: real screens in a flat browser window and phone frame, same look as the mockups */
.cs-gallery h2 { margin: 0 0 var(--space-6); }
/* the first screen runs full width, the rest pair up below it */
.gallery-desk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7); align-items: start; max-width: 1040px; margin-inline: auto; }
.gallery-desk .shot-browser:first-child, .gallery-desk .shot-browser:last-child:nth-child(even) { grid-column: 1 / -1; }
/* two smaller screens side by side, for shots that do not hold up full width */
.gallery-desk.is-pair .shot-browser:nth-child(n) { grid-column: auto; }
/* three equal screens in a row */
.gallery-desk.is-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); max-width: none; }
.gallery-desk.is-trio .shot-browser:nth-child(n) { grid-column: auto; }
/* flex rather than grid so a phone left alone on the last row still sits in the middle */
.gallery-phones {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-6) var(--space-5); margin-top: var(--space-8);
}
.gallery-desk:empty, .gallery-phones:first-child { margin-top: 0; }
/* the figure is the grid item; the device frame sits on .frame so the caption can hang below it */
.shot-browser { margin: 0; }
.shot-browser .frame {
  border-radius: var(--rounded-md); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-hairline); box-shadow: var(--shadow-card);
}
.shot-browser .bar { display: flex; gap: 6px; padding: 12px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border-hairline); }
.shot-browser .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-hairline); }
.shot-browser img { display: block; width: 100%; height: auto; }
/* a whole page, scrolled top to bottom, stays narrow so it reads as a page and not a poster */
.shot-browser.is-page { justify-self: center; width: 100%; max-width: 620px; }
.shot-phone { margin: 0; flex: 1 1 170px; max-width: 230px; min-width: 0; }
.shot-phone .frame {
  padding: 10px; border-radius: 30px; background: #1B1C1F; box-shadow: var(--shadow-card);
}
/* each screen keeps its own height: live captures are 1:2, the Peníze.cz phone screenshots only allow 1:1.8 once the browser bar is cut */
.shot-phone img { display: block; width: 100%; height: auto; border-radius: 21px; }

/* a logo shown on its own light panel */
.cs-logo h2 { margin: 0 0 var(--space-6); }
.shot-logo { margin: 0 auto; max-width: 1040px; }
.shot-logo img { display: block; width: 100%; height: auto; border-radius: var(--rounded-md); }

/* finished visuals (print mockups, campaign images): no frame, rounded, a soft shadow */
.cs-visuals h2 { margin: 0 0 var(--space-6); }
.gallery-visuals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7); max-width: 1040px; margin-inline: auto; }
.gallery-visuals .shot-visual:first-child { grid-column: 1 / -1; }
.shot-visual { margin: 0; }
.shot-visual img { display: block; width: 100%; height: auto; border-radius: var(--rounded-md); box-shadow: var(--shadow-card); }

/* posters: print pieces, so no device frame, just a soft shadow; three to a row */
.cs-posters h2 { margin: 0 0 var(--space-6); }
.gallery-posters { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-7); max-width: 1040px; margin-inline: auto; }
.shot-poster { margin: 0; flex: 0 1 calc((100% - 2 * var(--space-7)) / 3); }
.shot-cap { margin-top: var(--space-3); font-size: 0.875rem; font-weight: 500; font-style: italic; line-height: 1.4; color: var(--text-muted); }
.shot-phone .shot-cap { text-align: center; }
.shot-poster img { display: block; width: 100%; aspect-ratio: 700 / 990; object-fit: cover; object-position: top; border-radius: var(--rounded-sm, 6px); box-shadow: var(--shadow-card); }

.cs-next { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); }
.cs-next .next-label { font-size: 0.8rem; letter-spacing: 0.08em; color: var(--text-muted); }
.cs-next h2 { margin: var(--space-1) 0 0; }

/* ---------------------------------------------------------------------------
   Motion — quiet reveals on scroll
   ------------------------------------------------------------------------- */
/* Every hidden start state is gated behind .js, which the inline snippet in
   <head> sets. Without JavaScript the page renders fully visible instead of
   waiting for a reveal that will never come. */
.js .reveal { opacity: 0; transform: translateY(16px); animation: rise 520ms var(--ease) forwards; }
.reveal.d1 { animation-delay: 80ms; }
.reveal.d2 { animation-delay: 180ms; }
.reveal.d3 { animation-delay: 280ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

.js [data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.js [data-reveal].in { opacity: 1; transform: none; }

.word { display: inline-block; }
.js .word-in {
  display: inline-block; opacity: 0; transform: translateY(0.7em);
  transition: opacity 520ms var(--ease), transform 680ms var(--ease-out);
}
.js [data-words].in .word-in { opacity: 1; transform: none; }

.js .stagger > * {
  opacity: 0; transform: translateY(22px);
  transition: opacity 560ms var(--ease), transform 640ms var(--ease);
}
.js .stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(2) { transition-delay: 90ms; }
.stagger.in > *:nth-child(3) { transition-delay: 180ms; }
.stagger.in > *:nth-child(4) { transition-delay: 270ms; }
.stagger.in > *:nth-child(5) { transition-delay: 360ms; }
.stagger.in > *:nth-child(6) { transition-delay: 450ms; }

/* Service rows slide in from the left; the About photo rises and settles */
.js #sluzby .stagger > .list-row { transform: translateX(-40px); }
.js #o-mne .stagger > .about-media { transform: translateY(40px) scale(0.96); }
.js #sluzby .stagger.in > .list-row,
.js #o-mne .stagger.in > .about-media { transform: none; }

/* Project cards: the image unveils from a soft clip and settles its zoom */
.js .work-card[data-reveal] .media {
  clip-path: inset(12% 6% 12% 6% round var(--rounded-lg));
  transition: clip-path 900ms var(--ease-out);
}
.js .work-card[data-reveal] .media img {
  transform: scale(1.12);
  transition: transform 1200ms var(--ease-out);
}
.js .work-card[data-reveal].in .media { clip-path: inset(0 0 0 0 round var(--rounded-lg)); }
.js .work-card[data-reveal].in .media img { transform: scale(1); }
a.work-card:hover .media img,
.js a.work-card[data-reveal].in:hover .media img { transform: scale(1.04); }
.work-grid > .work-card:nth-child(even) { transition-delay: 120ms; }

/* Scroll progress along the top edge, over the dark nav */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30;
  background: var(--action-inverse);
  transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .pillars, .impact-stats { grid-template-columns: 1fr; }
  .work-grid, .about-grid, .cs-grid { grid-template-columns: 1fr; }
  .constraints, .beforeafter { grid-template-columns: 1fr; }
  .gallery-desk, .gallery-desk.is-trio, .gallery-visuals { grid-template-columns: 1fr; gap: var(--space-6); }
  .gallery-phones { margin-top: var(--space-7); }
  .shot-phone .frame { padding: 6px; border-radius: 22px; }
  .shot-phone img { border-radius: 16px; }
  .gallery-posters { gap: var(--space-5); }
  .shot-poster { flex-basis: calc((100% - var(--space-5)) / 2); }
  /* The step texts carry the content, so they move under the titles */
  .list-row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .list-row .row-note { flex: none; max-width: 60ch; }
  .section-head.row { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .section { padding-block: var(--space-8); }
  .section-dark { padding-block: var(--space-8); }
  /* Each series scrolls sideways */
  .social-strip {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-2);
  }
  .social-post { scroll-snap-align: start; }
}

@media (max-width: 640px) {
  /* Stack the bar so all four links stay reachable on a phone. */
  .nav .container { flex-direction: column; align-items: stretch; gap: var(--space-2); }
  .nav-logo { text-align: center; }
  .nav-links { justify-content: center; gap: var(--space-4); flex-wrap: wrap; }
  .nav-links a { font-size: 0.8rem; }
  :target, [id] { scroll-margin-top: 120px; }
  .hero { min-height: calc(100svh - 110px); }   /* the stacked nav is taller */
  .site-footer .container { justify-content: center; text-align: center; }
  .cs-meta { gap: var(--space-4) var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { animation: none; opacity: 1; transform: none; }
  .js [data-reveal], .js .word-in { opacity: 1; transform: none; transition: none; }
  .js .stagger > * { opacity: 1; transform: none; }
  .js .work-card[data-reveal] .media { clip-path: none; }
  .js .work-card[data-reveal] .media img { transform: none; }
  .scroll-progress { display: none; }
  * { transition: none !important; }
}

/* small phones: the device shots sit two by two, an odd last one stays centred */
@media (max-width: 560px) {
  .shot-phone { flex: 0 1 calc((100% - var(--space-5)) / 2); }
}

/* the case studies end close to the dark Co nabízím block */
#ukazky { padding-bottom: var(--space-6); }
