/* =========================================================
   Tobiáš Surový — portfolio
   Dark #111 + one light-blue accent. Change --blue to re-theme.
   One main animation (hero), calm fade-ins while scrolling.
   ========================================================= */

:root {
  --bg: #111214;
  --bg-2: #18191c;
  --ink: #f2f1ee;
  --muted: rgba(242, 241, 238, 0.78);
  --faint: rgba(242, 241, 238, 0.62);
  --line: rgba(242, 241, 238, 0.12);
  --blue: #8fd0ff;
  --on-blue: #0f1215;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --edge: clamp(20px, 3vw, 48px);
  --max: 1240px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Headings, buttons, labels and big numbers use the display font.
   Paragraphs and longer text use Inter (set on body) for easier reading. */
h1,
h2,
h3,
.pill,
.header__name,
.header__nav,
.hero__kicker,
.wordmark,
.scroll-down,
.sec-head,
.lead,
.about__lead,
.facts dt,
.case__kicker,
.meta dt,
.row__when,
.skills__title,
.services__num,
.contact__title,
.contact__grid dt,
.big-cta,
.modal__label,
.form__field > span,
.copy,
.footer {
  font-family: var(--font-display);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

p,
h1,
h2,
h3,
dl,
dd,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--blue);
  color: var(--on-blue);
}

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

.skip {
  position: fixed;
  top: -60px;
  left: var(--edge);
  z-index: 200;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--blue);
  color: var(--on-blue);
}

.skip:focus {
  top: 14px;
}

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

.accent {
  color: var(--blue);
}

/* ---------- Smooth scrolling (Lenis) ---------- */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: clip;
}

/* ---------- Smoke trail canvas (created by script.js) ---------- */

.smoke {
  position: fixed;
  inset: 0;
  z-index: 45;
  mix-blend-mode: screen;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 1px 16px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    transform 160ms var(--ease-out);
}

.pill--blue {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--on-blue);
}

.pill--lg {
  height: 44px;
  padding: 1px 22px 0;
  font-size: 14px;
}

.pill:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .pill:hover {
    border-color: var(--blue);
    color: var(--blue);
  }

  .pill--blue:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--on-blue);
  }
}

/* ---------- Status badge ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status__dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--blue);
  animation: ping 2.6s var(--ease-out) infinite;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  70%,
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* ---------- Header ---------- */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--edge);
  border-bottom: 1px solid transparent;
  transition:
    background-color 300ms ease,
    border-color 300ms ease;
}

.header.is-scrolled {
  background: rgba(17, 18, 20, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: var(--line);
}

.header__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.header__name {
  color: var(--blue);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.header__name span {
  color: var(--ink);
}

.header__nav {
  display: flex;
  gap: 28px;
  font-size: 15px;
}

.header__nav a {
  position: relative;
  color: var(--muted);
  transition: color 200ms ease;
}

.header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 300ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .header__nav a:hover {
    color: var(--ink);
  }

  .header__nav a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }
}

.header__actions {
  display: flex;
  gap: 8px;
}

.header__menu {
  display: none;
}

/* ---------- Hero (the one main animation) ---------- */

/* The hero stays pinned while the next sections slide over it.
   --hero-top is set by script.js: 0 normally, negative when the hero is taller
   than the window, so you first scroll to its bottom and only then it stops. */
.hero {
  position: sticky;
  top: var(--hero-top, 0px);
  z-index: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: clamp(120px, 22vw, 340px);
  overflow: hidden;
}

.hero__content {
  will-change: transform, opacity;
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(100px, 18vh, 190px) var(--edge) 0;
  transform-origin: 50% 0;
}

.hero__kicker {
  margin-bottom: 28px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(68px, 10vw, 176px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.indent {
  padding-left: 0.7em;
}

.indent-2 {
  padding-left: 1.4em;
}

.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.mask > .line {
  display: inline-block;
}

.hero__sub {
  max-width: 40ch;
  margin-top: 36px;
  color: var(--muted);
  font-size: clamp(18px, 1.4vw, 22px);
  font-weight: 400;
  line-height: 1.5;
}

.hero__sub strong {
  color: var(--ink);
  font-weight: 500;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

/* Two columns on wide screens: text left, terminal right */
@media (min-width: 1100px) {
  .hero__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
    column-gap: clamp(40px, 5vw, 96px);
    align-items: center;
  }

  .hero__content > :not(.term) {
    grid-column: 1;
  }

  .hero__content > .term {
    grid-column: 2;
    grid-row: 1 / span 4;
  }
}

/* ---------- Terminal that types by itself ---------- */

.term {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(24, 25, 28, 0.92);
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 40px 90px -35px rgba(0, 0, 0, 0.85);
}

.term__chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.term__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(242, 241, 238, 0.16);
}

.term__dot--on {
  background: var(--blue);
}

.term__path {
  margin-left: 10px;
  color: var(--faint);
  font-size: 13px;
}

.term__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 420px;
  padding: 20px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.65;
}

.term__line {
  display: flex;
  gap: 10px;
}

.term__prompt {
  flex-shrink: 0;
  min-width: 10px;
  color: var(--blue);
}

.term__text {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.term__line--out .term__prompt {
  color: var(--faint);
}

.term__line--out .term__text {
  color: var(--muted);
}

.term__line--gap {
  margin-top: 8px;
}

.term__cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--blue);
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 1099px) {
  .term {
    max-width: 520px;
    margin-top: 40px;
  }
}

.js .term {
  opacity: 0;
  transform: translateY(16px);
}

.is-ready .term {
  opacity: 1;
  transform: none;
  transition:
    opacity 800ms ease 700ms,
    transform 1000ms var(--ease-out) 700ms;
}

@media (prefers-reduced-motion: reduce) {
  .js .term {
    transform: none;
  }

  .term__cursor {
    animation: none;
  }
}

/* Giant outlined surname, two offset outlines */
.wordmark {
  will-change: transform, opacity;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5vw;
  z-index: 0;
  height: 24vw;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}

.wordmark__layer {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 var(--edge);
  font-size: 29vw;
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
}

.wordmark__layer span {
  display: inline-block;
}

.wordmark__layer--front {
  -webkit-text-stroke: 1px rgba(143, 208, 255, 0.5);
}

.wordmark__layer--back {
  -webkit-text-stroke: 1px rgba(242, 241, 238, 0.1);
  transform: translate3d(10px, 10px, 0);
  will-change: transform;
}

.scroll-down {
  position: absolute;
  right: var(--edge);
  bottom: 28px;
  z-index: 2;
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 200ms ease;
}

.scroll-down:hover {
  color: var(--blue);
}

/* Entrance: lines slide up, the rest fades in, the surname rises */
.js .hero__title .line {
  transform: translateY(105%);
}

.js .hero__kicker,
.js .hero__sub,
.js .hero__links,
.js .scroll-down,
.js .wordmark__layer span {
  opacity: 0;
}

.js .hero__kicker,
.js .hero__sub,
.js .hero__links {
  transform: translateY(12px);
}

.js .wordmark__layer span {
  transform: translateY(16%);
}

.is-ready .hero__title .line {
  transform: none;
  transition: transform 1000ms var(--ease-out);
  transition-delay: calc(var(--i) * 90ms + 150ms);
}

.is-ready .hero__kicker,
.is-ready .hero__sub,
.is-ready .hero__links,
.is-ready .scroll-down {
  opacity: 1;
  transform: none;
  transition:
    opacity 700ms ease,
    transform 900ms var(--ease-out);
}

.is-ready .hero__kicker { transition-delay: 50ms; }
.is-ready .hero__sub { transition-delay: 520ms; }
.is-ready .hero__links { transition-delay: 600ms; }
.is-ready .scroll-down { transition-delay: 1100ms; }

.is-ready .wordmark__layer span {
  opacity: 1;
  transform: none;
  transition:
    opacity 1000ms ease,
    transform 1300ms var(--ease-out);
}

.is-ready .wordmark__layer span:nth-child(1) { transition-delay: 300ms; }
.is-ready .wordmark__layer span:nth-child(2) { transition-delay: 360ms; }
.is-ready .wordmark__layer span:nth-child(3) { transition-delay: 410ms; }
.is-ready .wordmark__layer span:nth-child(4) { transition-delay: 450ms; }
.is-ready .wordmark__layer span:nth-child(5) { transition-delay: 485ms; }
.is-ready .wordmark__layer span:nth-child(6) { transition-delay: 515ms; }

/* ---------- Sections ---------- */

/* Every section is a full-width band with a clear top edge.
   Alternate bands get a faint tint (transparent, so the smoke still shows). */
.section {
  --pad-x: max(var(--edge), calc((100% - var(--max)) / 2 + var(--edge)));
  position: relative;
  z-index: 1;
  padding: clamp(100px, 15vh, 160px) var(--pad-x);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.section--alt {
  background: #18191c;
}

/* The first card that slides over the pinned hero */
.hero + .section {
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.55);
}

.sec-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(48px, 8vh, 80px);
}

.sec-head__num {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 1px 10px 0;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
}

.sec-head h2 {
  font-size: clamp(36px, 4.4vw, 68px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.lead {
  color: var(--ink);
  font-size: clamp(21px, 1.8vw, 27px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.about__lead {
  font-size: clamp(26px, 2.6vw, 40px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 62ch;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--blue);
  font-size: clamp(40px, 4vw, 64px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.05em;
}

.facts dd {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
}

/* ---------- Work ---------- */

.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}

.case__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--muted);
}

.case__kicker {
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case__title {
  color: var(--ink);
  font-size: clamp(52px, 6.4vw, 104px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.meta {
  margin-top: 8px;
}

.meta div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.meta dt {
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.9;
}

.meta dd {
  color: var(--ink);
  font-size: 17px;
}

.note {
  margin-top: 12px;
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* App preview (pure HTML/CSS, fictional data) */
.device {
  container-type: inline-size;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #f3f6f9;
  color: #14212e;
  line-height: 1.35;
  box-shadow:
    0 50px 100px -40px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.4);
}

.device__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #e6ebf0;
  color: #6b7a88;
  font-size: 11px;
}

.device__bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c9d2db;
}

.device__bar span {
  margin-left: 8px;
}

.app {
  display: grid;
  grid-template-columns: 130px 1fr;
  min-height: 360px;
  font-size: 12px;
}

.app__side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  background: #13283c;
  color: rgba(255, 255, 255, 0.72);
}

.app__logo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 9px;
  background: var(--blue);
  color: #13283c;
  font-weight: 500;
}

.app__nav {
  padding: 7px 10px;
  border-radius: 7px;
}

.app__nav.is-on {
  background: rgba(143, 208, 255, 0.18);
  color: #fff;
}

.app__main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.app__hello {
  font-size: 15px;
  font-weight: 500;
}

.app__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid #e1e7ed;
  border-radius: 10px;
  background: #fff;
  color: #5b6b7a;
}

.app__card strong {
  color: #14212e;
  font-size: 15px;
  font-weight: 500;
}

.app__card--next {
  border-color: #b9e1ff;
  box-shadow: inset 3px 0 0 #3a9be0;
}

.app__kicker {
  color: #3a7fb3;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app__rsvp {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
}

.chip--yes {
  background: #dcf0ff;
  color: #0d4a75;
}

.chip--maybe {
  background: #fff1d9;
  color: #7a5200;
}

.chip--no {
  background: #ffe3e3;
  color: #9b1c1c;
}

.app__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.app__card .app__score {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.app__bar {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e6edf3;
}

.app__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #3a9be0;
}

@container (max-width: 420px) {
  .app {
    grid-template-columns: 1fr;
  }

  .app__side {
    display: none;
  }

  .app__row {
    grid-template-columns: 1fr;
  }
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 32px;
  margin-top: clamp(48px, 8vh, 88px);
}

.features li {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 17px;
}

.features li::before {
  content: "→";
  color: var(--blue);
}

/* ---------- Experience ---------- */

.row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: baseline;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.row:first-child {
  padding-top: 0;
}

.row__when {
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.row__title {
  font-size: clamp(22px, 2vw, 32px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.row__where {
  margin-top: 6px;
  color: var(--muted);
  font-size: 17px;
}

.row__desc {
  color: var(--muted);
  font-size: 17px;
}

.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 48px;
  margin-top: clamp(56px, 9vh, 96px);
}

.skills__group {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.skills__title {
  margin-bottom: 16px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Skill tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags li {
  padding: 6px 13px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(242, 241, 238, 0.03);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  transition:
    border-color 200ms ease,
    color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .tags li:hover {
    border-color: var(--blue);
    color: var(--blue);
  }
}

.languages {
  margin-top: 48px;
}

.languages p {
  font-size: 18px;
  line-height: 1.6;
}

/* ---------- Services ---------- */

.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 32px;
}

.services li {
  padding-top: 22px;
  border-top: 1px solid var(--line);
  transition: border-color 300ms ease;
}

.services__num {
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
}

.services h3 {
  margin: 10px 0 10px;
  font-size: clamp(21px, 1.7vw, 26px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.services p {
  color: var(--muted);
  font-size: 17px;
}

@media (hover: hover) and (pointer: fine) {
  .services li:hover {
    border-color: var(--blue);
  }
}

/* ---------- Contact ---------- */

.contact__title {
  max-width: 20ch;
  font-size: clamp(36px, 4.4vw, 68px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.contact__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 32px;
  margin-top: clamp(48px, 8vh, 80px);
}

.contact__grid dt {
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.contact__grid dd {
  font-size: 19px;
  line-height: 1.4;
}

.link {
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  background-color: transparent;
  transition:
    color 200ms ease,
    background-size 300ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .link:hover {
    color: var(--blue);
  }
}

.copy {
  margin-left: 10px;
  padding: 2px 10px 1px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 3px;
  transition:
    color 200ms ease,
    border-color 200ms ease;
}

.copy:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.big-cta {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.1em;
  margin-top: clamp(64px, 12vh, 140px);
  font-size: clamp(64px, 11vw, 200px);
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: -0.07em;
}

.big-cta__arrow {
  width: 0.4em;
  height: 0.4em;
  margin-bottom: 0.08em;
  color: var(--blue);
  transition: transform 500ms var(--ease-out);
}

.big-cta span {
  transition: color 300ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .big-cta:hover span {
    color: var(--blue);
  }

  .big-cta:hover .big-cta__arrow {
    transform: translate(0.05em, -0.05em);
  }
}

/* ---------- Contact window ---------- */

html.modal-open {
  overflow: hidden;
}

.modal {
  width: min(900px, calc(100% - 32px));
  max-height: calc(100% - 24px);
  margin: auto;
  padding: clamp(24px, 4.5vh, 44px) clamp(22px, 4vw, 48px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 241, 238, 0.18) transparent;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-2);
  color: var(--ink);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.modal.is-open {
  opacity: 1;
  transform: none;
  transition:
    opacity 260ms ease,
    transform 320ms var(--ease-out);
}

.modal::backdrop {
  background: rgba(8, 9, 10, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition:
    background-color 260ms ease,
    backdrop-filter 260ms ease;
}

.modal.is-open::backdrop {
  background: rgba(8, 9, 10, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition:
    color 200ms ease,
    border-color 200ms ease,
    transform 160ms var(--ease-out);
}

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal__close:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.modal__close:active {
  transform: scale(0.94);
}

.modal__compose {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.modal__compose > .modal__title,
.modal__compose > .modal__sub,
.modal__compose > .modal__mail {
  grid-column: 1;
}

.modal__compose > .form {
  grid-column: 2;
  grid-row: 1 / span 3;
  margin-top: 0;
  padding-top: 6px;
}

.modal__compose[hidden] {
  display: none;
}

/* Thank-you view after sending */
.modal__done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 12px 0 4px;
}

.modal__done[hidden] {
  display: none;
}

.modal__done:not([hidden]) {
  animation: done-in 450ms var(--ease-out) both;
}

.modal__done .modal__title:focus {
  outline: none;
}

.done__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--on-blue);
}

.done__icon svg {
  width: 28px;
  height: 28px;
}

.done__icon path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: tick 500ms var(--ease-out) 200ms forwards;
}

.done__text {
  max-width: 40ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.done__text strong {
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}

.modal__done .pill {
  margin-top: 8px;
}

@keyframes done-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes tick {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal__done:not([hidden]) {
    animation: none;
  }

  .done__icon path {
    animation: none;
    stroke-dashoffset: 0;
  }
}

.modal__title {
  font-size: clamp(38px, 4.2vw, 56px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.05em;
}

.modal__sub {
  max-width: 40ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
}

.modal__mail {
  margin-top: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.modal__mail .copy {
  margin-left: 6px;
}

.modal__label,
.form__field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form__field input,
.form__field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS from zooming in */
  line-height: 1.4;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.form__field textarea {
  height: clamp(96px, 20vh, 150px);
  min-height: 80px;
  resize: none;
}

.form__field input::placeholder,
.form__field textarea::placeholder {
  color: var(--faint);
}

.form__field input:focus,
.form__field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(143, 208, 255, 0.15);
}

.form__privacy {
  color: var(--faint);
  font-size: 13px;
  line-height: 1.4;
}

.form__trap {
  position: absolute;
  left: -9999px;
}

.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 4px;
}

.form__actions .pill[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.form__status {
  color: var(--muted);
  font-size: 15px;
}

.form__status.is-ok {
  color: var(--blue);
}

.form__status.is-error {
  color: #ffb4a8;
}

@media (max-width: 760px) {
  .modal__compose {
    display: block;
  }

  .modal__title {
    font-size: 36px;
    padding-right: 48px;
  }

  .modal__sub {
    margin-top: 10px;
    font-size: 15px;
  }

  .modal__mail {
    margin-top: 16px;
    padding: 12px 0;
  }

  .modal__compose > .form {
    margin-top: 18px;
    padding-top: 0;
  }

  .form__row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form__field textarea {
    height: clamp(80px, 16vh, 120px);
  }
}

@media (max-width: 760px) and (max-height: 700px) {
  .modal__sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal.is-open {
    transform: none;
  }
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  padding: 22px max(var(--edge), calc((100% - var(--max)) / 2 + var(--edge))) 28px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.footer a {
  transition: color 200ms ease;
}

.footer a:hover {
  color: var(--blue);
}

/* ---------- Calm scroll reveal ---------- */

/* Section headings: the title slides up from behind its edge, the number fades in */
.sec-head h2 .mask > .line {
  display: inline-block;
}

.js [data-reveal-lines] .line {
  transform: translateY(105%);
}

.js [data-reveal-lines] .sec-head__num {
  opacity: 0;
  transform: scale(0.9);
}

.js [data-reveal-lines].is-in .line {
  transform: none;
  transition: transform 1000ms var(--ease-out) 80ms;
}

.js [data-reveal-lines].is-in .sec-head__num {
  opacity: 1;
  transform: none;
  transition:
    opacity 500ms ease,
    transform 600ms var(--ease-out);
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 700ms ease,
    transform 900ms var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .about,
  .case {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .row__desc {
    grid-column: 2;
  }

  .services,
  .contact__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .header__menu {
    display: inline-flex;
  }

  /* Mobile menu: a calm drop-down panel */
  .header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--edge) 20px;
    background: rgba(17, 18, 20, 0.96);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition:
      opacity 160ms ease,
      transform 160ms ease,
      visibility 0s linear 160ms;
  }

  .header__nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 18px;
  }

  .header__nav a::after {
    display: none;
  }

  .header.is-open {
    background: rgba(17, 18, 20, 0.96);
    border-color: var(--line);
  }

  .header.is-open .header__nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity 220ms var(--ease-out),
      transform 260ms var(--ease-out),
      visibility 0s;
  }
}

@media (max-width: 640px) {
  .header__actions .pill--blue {
    display: none;
  }

  .hero__title {
    font-size: clamp(64px, 21vw, 120px);
  }

  .wordmark {
    bottom: -3vw;
    height: 30vw;
  }

  .scroll-down {
    display: none;
  }

  .facts,
  .features,
  .skills,
  .services,
  .contact__grid {
    grid-template-columns: 1fr;
  }

  .facts {
    gap: 20px;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .row__desc {
    grid-column: auto;
  }

  .big-cta {
    font-size: clamp(56px, 18vw, 110px);
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }
}

/* ---------- Phone polish ---------- */

a,
button {
  -webkit-tap-highlight-color: transparent;
}

/* Respect the notch / home indicator on phones */
.header {
  padding-top: max(16px, env(safe-area-inset-top));
  padding-left: max(var(--edge), env(safe-area-inset-left));
  padding-right: max(var(--edge), env(safe-area-inset-right));
}

.footer {
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

@media (max-width: 640px) {
  /* Less empty space */
  .hero__content {
    padding-top: 112px;
  }

  .hero__kicker {
    margin-bottom: 20px;
    font-size: 13px;
  }

  .hero__sub {
    margin-top: 26px;
    font-size: 17px;
  }

  .section {
    padding-top: 76px;
    padding-bottom: 76px;
  }

  .sec-head {
    margin-bottom: 40px;
  }

  /* Hero buttons: two side by side, "Contact me" full width below */
  .hero__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 26px;
  }

  .hero__links .pill {
    justify-content: center;
    padding: 1px 12px 0;
  }

  .hero__links .pill:last-child {
    grid-column: 1 / -1;
  }

  /* Terminal: everything fits, nothing is cut off */
  .term__body {
    min-height: 450px;
    padding: 16px;
  }

  .term__line--gap {
    margin-top: 6px;
  }

  /* About */
  .about__lead {
    font-size: 23px;
  }

  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .facts dt {
    font-size: 34px;
  }

  .facts dd {
    font-size: 14px;
  }

  /* Project meta: label above value, full width for the text */
  .meta div {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 12px 0;
  }

  .meta dt {
    line-height: 1.5;
  }

  .case__title {
    font-size: 56px;
  }

  /* Denser skill tags */
  .tags {
    gap: 6px;
  }

  .tags li {
    padding: 5px 11px 4px;
    font-size: 14px;
  }

  .skills {
    gap: 32px;
  }

  /* Contact */
  .contact__title {
    font-size: 34px;
  }

  .contact__grid {
    gap: 26px;
  }

  .contact__grid dd {
    font-size: 17px;
  }

  .big-cta {
    margin-top: 56px;
  }
}

/* ---------- Reduced motion: keep fades, drop movement ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .hero__title .line,
  .js .hero__kicker,
  .js .hero__sub,
  .js .hero__links,
  .js .wordmark__layer span,
  .js [data-reveal] {
    transform: none !important;
  }

  .js [data-reveal] {
    transition: opacity 300ms ease;
  }

  .status__dot::after {
    animation: none;
  }

  .js [data-reveal-lines] .line,
  .js [data-reveal-lines] .sec-head__num {
    transform: none !important;
  }

  .header__nav,
  .header.is-open .header__nav {
    transform: none;
  }

  .big-cta:hover .big-cta__arrow {
    transform: none;
  }
}
