/* radimbohac.com mock: the page's own CSS on top of the kit (system.css, layout.css).
   Tokens first, then the parts the kit lacks: the grain, the hero (portrait + wordmark), the travelling characters and the
   sections they form in (services, work, close). */

/* ------------------------------------------------------------- tokens
   The brand block in index.html is the client's emerald (ref/colour.webp) as start.mjs brand printed it.
   WCAG on the ground #052a22: ink 12.6, muted 5.9, jade 7.8, deep ink on the jade button 7.8;
                 on the surface #0a3a30: ink 10.4, muted 4.8, jade 6.4. */
:root {
  --font-art: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;   /* the portrait's glyphs (portrait.js) */
  --jade: var(--p-accent);                /* the wordmark, the accent words, the dots, the focus ring */
  --focus: var(--jade);
  /* the portrait's ink, read by portrait.js: the low tones a dim jade, the highlights paper */
  --ascii-lo: #3f9c80; --ascii-hi: #f1ede4; --ascii-spark: #7ff0c4;
  --grain: .075;
  /* one ease for everything that moves on this page: out, no overshoot (Radim 11-13: no jiggle) */
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
@media (max-width: 639px) { :root { --gut: 16px; } }
:focus-visible { outline-color: var(--focus); }
.footer--dark { --focus: var(--p-accent); }

/* ------------------------------------------------------------- the type (Radim 11-13: option C)
   Space Grotesk for the headings and the name, Inter for the text, JetBrains Mono for the mono parts; each from
   Google Fonts with its latin-ext subset (ř ů ě č ū ō). The name is sized to the wrap from its own measure in
   Space Grotesk 700 (--word-em one line, --word-em2 the longer of two lines on a phone, with 5% to spare). */
:root {
  --font-display: "Space Grotesk", system-ui, sans-serif; --font-text: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --head-weight: 700; --head-track: -0.04em; --word-weight: 700; --word-track: -0.05em; --word-em: 5.73; --word-em2: 2.95;
}

/* ------------------------------------------------------------- film grain
   one still noise tile, drawn once and composited over everything: no blend mode, no animation, no cost on scroll */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 2.2 -.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
@media print { body::after { display: none; } }

/* ------------------------------------------------------------- hero: the portrait full bleed, the wordmark over it
   After ref/hero-ref.webp: the figure fills the screen right of centre, the name runs edge to edge across the collar
   and tie in solid and outline letters (outline over the figure's middle, so the tie and collar show through), the
   facts, the line and the buttons sit at the face's height on the left. */
.hero--ascii, .hero--ascii[data-box="none"][data-tone="dark"] {
  background: var(--p-bg); color: var(--p-ink); --ink: var(--p-ink); --muted: var(--p-muted);
  --line: color-mix(in oklab, var(--p-ink) 14%, transparent); --line-strong: color-mix(in oklab, var(--p-ink) 26%, transparent);
  overflow: clip;
}
/* the figure's box, as shares of the hero (portrait.js reads --cell, --cols and --fig-fade); no photograph band above
   the words on a phone or tablet (the kit's --photo): the portrait is the hero's own ground */
.hero--ascii { --photo: 0px; --fig-h: 1.02; --fig-cx: .64; --fig-top: .085; --fig-fade: .16; --cell: 4; --cols: 190; }
/* the canvas starts under the bar (nothing of the picture lies under it) and runs to the hero's foot */
.hero--ascii > .portrait { position: absolute; left: 0; top: var(--nav); z-index: 0; width: 100%; height: calc(100% - var(--nav)); display: block; }
.hero--ascii > .portrait__fig {
  position: absolute; z-index: 0; pointer-events: none; container-type: inline-size;
  top: calc(var(--fig-top) * 100%); left: calc(var(--fig-cx) * 100%); translate: -50% 0;
  height: calc(var(--fig-h) * 100%); aspect-ratio: 420 / 510;
}
.portrait__pre {
  position: absolute; inset: 0; margin: 0; overflow: hidden; white-space: pre;
  font: 500 calc(100cqw / 72) / 1 var(--font-art); letter-spacing: 0; color: var(--ascii-lo);
  -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent);
}
/* once the canvas draws, the box only measures (portrait.js); the <pre> shows only without script */
.hero.is-live > .portrait__fig { visibility: hidden; }
.hero--ascii > .wrap { position: relative; z-index: 1; }

.hero--ascii > .wrap > .hero__stack {
  container-type: inline-size; display: grid; height: 100%; justify-content: stretch; align-content: stretch;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "side" "title";
}
.hero__side { grid-area: side; align-self: center; width: min(100%, 520px); padding-bottom: var(--s-6); }
.hero--ascii .hero__title { grid-area: title; margin: 0; max-width: none; font: inherit; letter-spacing: 0; text-wrap: nowrap; }
/* the name: the display face at its --word-weight, sized to the wrap's width by its own measure (--word-em) */
.hero__word {
  display: block; font: var(--word-weight) calc(100cqw / var(--word-em)) / .86 var(--font-display); letter-spacing: var(--word-track); color: var(--jade); white-space: nowrap;
}
/* the mask the letters rise out of, only while they rise (site.js) */
.hero__word.is-rising { overflow: clip; padding-top: .2em; margin-top: -.2em; }
/* every letter is its own element. At rest the split is by name part: the first name solid (it sits on the empty
   ground), the surname in outline (it sits over the figure, so the collar, the tie and the shoulder show through).
   Near the cursor or a finger (site.js) a letter takes the other state and eases back when it leaves: in fast,
   out slow, on the page's one ease, which never passes its mark. Reduced motion: the static mix, nothing moves. */
.hero__word { touch-action: pan-y; }
/* an outline letter keeps a 10% glaze of the jade inside its stroke: over the characters it reads as a letter, not a wire,
   and the portrait still shows through it */
.hero__word { --glaze: color-mix(in oklab, var(--jade) 10%, transparent); }
.hero__word .w { display: inline-block; color: var(--glaze); -webkit-text-stroke: max(1.5px, .0095em) var(--jade);
  transition: color 650ms var(--ease); }
.hero__word .w--first { color: var(--jade); }
.hero__word .w--first.is-on { color: var(--glaze); }
.hero__word .w--last.is-on { color: var(--jade); }
.hero__word .w.is-on { transition-duration: 220ms; }
.hero__word .w--sp { display: inline-block; width: .2em; }
@media (prefers-reduced-motion: reduce) { .hero__word .w { transition: none; } }
.hero__cat, .hero__kicker {
  font: 500 13px / 1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
}
.hero__cat { display: block; margin-top: var(--s-4); }
.hero__kicker { list-style: none; margin: 0 0 var(--s-6); padding: 0; display: grid; gap: var(--s-2); }
.hero__kicker li { display: flex; align-items: center; gap: var(--s-3); }
.hero__kicker li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--jade); flex: none; }
.hero--ascii .hero__lead {
  margin: 0 0 var(--s-6); max-width: 15ch;
  font: var(--head-weight) clamp(30px, 3.1vw, 46px) / 1.06 var(--font-display); letter-spacing: var(--head-track); color: var(--ink); text-wrap: balance;
}
.hero__lead .accent { color: var(--jade); }

/* a laptop of 1024 to 1279: the face takes a little more of the width, the line a little less */
@media (min-width: 1024px) and (max-width: 1279px) { .hero--ascii { --fig-cx: .66; --fig-h: .98; } .hero__side { width: min(100%, 440px); } }
/* a tablet: the figure centred higher, the words under the face */
@media (min-width: 640px) and (max-width: 1023px) {
  .hero--ascii { --fig-h: .7; --fig-cx: .5; --fig-top: .06; --fig-fade: .24; --cell: 3.6; --cols: 170; }
  .hero--ascii > .wrap > .hero__stack { grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "." "title" "side"; }
  .hero__side { align-self: end; width: 100%; padding: var(--s-6) 0 0; }
  .hero__side .hero__kicker { display: none; }
  .hero--ascii .hero__lead { margin: 0 0 var(--s-5); max-width: 18ch; }
}
/* a phone: the face fills the top, the name in two lines over the collar, then the line and the buttons */
@media (max-width: 639px) {
  .hero--ascii { --fig-h: .7; --fig-cx: .5; --fig-top: .07; --fig-fade: .3; --fig-fit: .6; --cell: 3.4; --cols: 140; }
  .hero--ascii > .portrait__fig { height: min(calc(var(--fig-h) * 100%), 150vw); }
  .hero--ascii > .wrap > .hero__stack { grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "." "title" "side"; }
  .hero__word { font-size: calc(100cqw / var(--word-em2)); line-height: .84; }
  .hero__word .w--sp { display: block; width: auto; height: 0; }
  .hero__cat { margin-top: var(--s-3); font-size: 12px; letter-spacing: .1em; }
  .hero__side { width: 100%; padding: var(--s-5) 0 0; }
  .hero__side .hero__kicker { display: none; }
  .hero--ascii .hero__lead { font-size: 26px; max-width: none; margin-bottom: var(--s-5); }
  .hero__side .btn-row { flex-direction: column; align-items: stretch; gap: var(--s-3); }
  .hero__side .btn-row .btn { justify-content: center; }
}
/* a short phone (an SE, 667 tall): the name on one line, so the face keeps its room above it */
@media (max-width: 639px) and (max-height: 720px) {
  .hero__word { font-size: calc(100cqw / var(--word-em)); line-height: .86; }
  .hero__word .w--sp { display: inline-block; width: .2em; height: auto; }
  .hero--ascii .hero__lead { font-size: 22px; }
}

/* ------------------------------------------------------------- the sky: the drift and the travelling characters
   One fixed layer over the screen, over the grounds and the face, under every .wrap (z-index 1, earlier in the page):
   drift.js's characters drifting below the hero, and field.js's characters in flight, hidden while none fly. At rest
   each formation's characters are drawn in its section's canvas. */
.sky { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.sky > canvas { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; }
canvas.form { display: block; width: 100%; }

/* ------------------------------------------------------------- section heads: bolder than the kit's, after the name */
.eyebrow { color: var(--muted); margin: 0 0 var(--s-3); }
main > .section h2, footer.closing h2 { font-family: var(--font-display); font-weight: var(--head-weight); letter-spacing: var(--head-track); }

/* ------------------------------------------------------------- services: three subjects the face breaks into */
.services { list-style: none; margin: var(--head-gap) 0 0; padding: 0; align-items: stretch; grid-auto-rows: 1fr; }
/* the subjects take what the screen leaves under the words (the list is the section's .fill) */
.service { display: flex; flex-direction: column; }
.service .form { flex: 1 1 0; min-height: 140px; }
.service { border-top: 1px solid var(--line); padding-top: var(--s-5); }
.service .form { margin-bottom: var(--s-5); }
/* a desktop: the three columns share one row for the subjects, one for the titles, one for the lines */
@media (min-width: 1024px) {
  .services { grid-template-rows: minmax(0, 1fr) auto auto; grid-auto-rows: auto; }
  .service { grid-row: span 3; display: grid; grid-template-rows: subgrid; row-gap: 0; }
  .service .form { margin: 0; min-height: 0; height: calc(100% - var(--s-5)); }
}
.service h3, .project__name { margin: 0 0 var(--s-3); font: var(--head-weight) var(--t-h3)/1.12 var(--font-display); letter-spacing: var(--head-track); }
.service__no, .project__meta { font: 500 13px/1 var(--font-mono); letter-spacing: .08em; color: var(--jade); }
.service__no { display: inline-block; margin-right: var(--s-3); vertical-align: .3em; }
.service p { margin: 0; max-width: 40ch; }

/* ------------------------------------------------------------- work: the site's own screen in a window of characters */
.project { --bar: 46px; --rim: 12px; align-items: start; }
.group:first-child > .project { margin-top: var(--head-gap); }
/* every screen's content runs to its foot, so the space between two sections is one measure (section-gaps): under
   the window its foot melts into characters down to the screen's foot, as the bust's foot does in the hero */
.project__media { display: flex; flex-direction: column; align-self: stretch; }
.window__foot { flex: 1 1 0; min-height: 0; }
.project__text { display: grid; justify-items: start; gap: var(--s-3); }
.project__text > p:not(.project__meta) { margin: 0 0 var(--s-3); max-width: 38ch; }
.project__meta { display: flex; gap: var(--s-3); margin: 0; }
.project__meta span + span { color: var(--muted); }
.project__name { margin: 0; overflow-wrap: anywhere; }
/* the window: the bar over the screen (its lights and the address are characters) and a rim under it, two canvases
   that never lie over the screen; the screen runs edge to edge on the column lines (field.js draws the window once at
   the .window's size and cuts each canvas's part out of it) */
.window { position: relative; padding: var(--bar) 0 var(--rim); }
.window > .form { position: absolute; left: 0; }
.window__t { top: 0; height: var(--bar); }
.window__b { bottom: 0; height: var(--rim); }
.window__shot img { transition: transform 600ms var(--ease); }
.project:hover .window__shot img { transform: scale(1.025); }
.project__go { min-height: 44px; }
/* the split's two columns start on one line: the words beside the screen's top edge, the bar above it */
@media (min-width: 1024px) { .project:not(.project--col) .project__text { padding-top: var(--bar); } }
/* the second screen: two projects side by side, each its words over its window, the window's foot to the screen's foot */
.duo { align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.project--col { display: flex; flex-direction: column; min-height: 0; }
.project--col .project__media { flex: 1 1 0; min-height: 0; margin-top: var(--s-5); }
.window__shot { position: relative; z-index: 1; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 3px; background: var(--p-surface); }
.window__shot picture { display: block; height: 100%; }
.window__shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }

/* ------------------------------------------------------------- close: the characters come back to the face */
.closing__cta.close--face { display: grid; column-gap: var(--gutter); row-gap: var(--s-6); align-items: start; }
.close__text { display: grid; justify-items: start; gap: var(--s-5); }
.close__text h2, .close__text .t-lead { margin: 0; }
.close__face { height: min(46svh, 440px); }
.closing__cta h2 { max-width: 14ch; }
@media (min-width: 640px) and (max-width: 1279px) { footer.closing > .wrap { row-gap: var(--s-6); } }
/* a short laptop screen (1366 x 657 and the like): a section grows to its content instead of running under the next */
@media (min-width: 1024px) and (max-height: 760px) { main > section:not(.hero), footer.closing { height: auto; min-height: 100vh; } }
.footer__mark { font: var(--display-weight) var(--t-h2)/1 var(--font-display); letter-spacing: var(--display-tracking); }
.footer__tag { margin: 0; color: var(--muted); }
.contact { display: grid; gap: var(--s-2); }
.contact li { display: grid; grid-template-columns: 76px 1fr; align-items: baseline; gap: var(--s-3); }
.contact__label { color: var(--muted); font-size: var(--t-small); }
.contact a { overflow-wrap: anywhere; }

/* ------------------------------------------------------------- a tablet: one service a row, its subject left; work and close keep their split */
@media (min-width: 640px) and (max-width: 1023px) {
  .service { grid-column: 1 / -1; display: grid; grid-template-columns: 5fr 7fr; column-gap: var(--s-6); align-items: start; }
  .service .form { grid-row: 1 / 4; margin: 0; min-height: 0; aspect-ratio: 16 / 10; flex: none; }
  .services { row-gap: var(--s-5); }
  .project { --bar: 38px; --rim: 8px; grid-template-rows: auto minmax(0, 1fr); }
  .project__media { margin-top: var(--s-5); }
  .duo > .project--col.span-5 { grid-column: 1 / span 5; } .duo > .project--col.span-7 { grid-column: 6 / -1; }
  .closing__cta.close--face > .close__text { grid-column: 1 / span 6; }
  .closing__cta.close--face > .close__face { grid-column: 7 / -1; height: min(31svh, 330px); }
}
/* ------------------------------------------------------------- a phone */
@media (max-width: 639px) {
  #sluzby { --hm: 2; }
  .services { row-gap: var(--s-6); }

  .project__text, .window { grid-column: 1 / -1; }
  .project { --bar: 34px; --rim: 8px; grid-template-rows: auto minmax(0, 1fr); }
  .project__media { margin-top: var(--s-4); }
  .window__shot { aspect-ratio: 780 / 1040; }   /* the phone shots (*-phone-780.jpg) whole, at their own 3:4 (Radim 11-13: "fit pictures on phone") */
  /* the second screen's two projects stack, so the three fit the section's two screens */
  #projekty .group > .fill { flex: none; min-height: auto; }
  #projekty .window__foot { display: none; }   /* a phone's section grows with its words: no foot to fill */
  .duo { grid-template-rows: none; row-gap: var(--s-5); }
  .project--col, .project--col .project__media { min-height: auto; flex: none; }
  .project--col .project__media { margin-top: var(--s-4); }
  .project__text > p:not(.project__meta) { margin-bottom: 0; }
  footer.closing { --hm: 2; }
  footer.closing > .wrap { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); row-gap: calc(var(--padt) + var(--padb) + var(--bar)); }
  .close__text, .close__face { grid-column: 1 / -1; }
  .close__face { height: min(44svh, 380px); margin-top: var(--s-5); }
  .closing__links { align-self: start; }
  .closing__links .footer__col { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------- the bar's mark on the part on screen (site.js), as the kit draws aria-current="page" */
.nav__link[aria-current="true"]::after { content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -2px; height: 2px; border-radius: 2px; background: currentColor; }
@media (max-width: 1023px) { .nav.is-open .nav__link[aria-current="true"]::after { left: 0; right: auto; width: 24px; bottom: 10px; } }

/* ------------------------------------------------------------- the contact form in the close (Radim 11-13)
   The kit's .form (fields, errors, status line) under the close's words; the face stays beside it. With the form the
   close is taller than one screen, so the footer grows with it instead of laying the links over it. */
@media (min-width: 640px) { footer.closing { height: auto; min-height: 100vh; min-height: 100svh; } }
.close__text > .contact-form { display: grid; justify-self: stretch; width: 100%; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
.contact-form .field label { color: var(--ink); }
.contact-form .field :is(input, textarea) { background: color-mix(in oklab, var(--p-bg) 70%, black); }
.contact-form .field :is(input, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.contact-form .btn-row .btn { min-height: 48px; }
.contact-form .form__note { margin: 0; color: var(--muted); }
.contact-form .form__status:empty { margin-top: calc(-1 * var(--s-5)); }   /* no empty gap under the button until a send */
.form__status a { color: var(--jade); text-decoration: underline; text-underline-offset: 3px; }
/* "Co potřebujete?": checkboxes as chips, each a 44px target, the chosen one filled jade */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.chips legend { width: 100%; padding: 0; margin-bottom: var(--s-2); font: 500 var(--t-small)/1.4 var(--font-text); color: var(--ink); }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--line-strong);
  border-radius: 999px; font: 500 var(--t-small)/1 var(--font-text); color: var(--ink);
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease); }
.chip:hover span { border-color: var(--jade); }
.chip input:checked + span { background: var(--jade); border-color: var(--jade); color: var(--p-accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the honeypot: off screen, out of the tab order and the accessibility tree */
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
