/* ==========================================================================
   Veronika Šelepska Farkašova – háčkované čepice, deky a ponožky
   Stránka je poskládaná jako její pruhovaná deka: barvy i pořadí pruhů
   jsou převzaté z fotky deky. Psáno nejdřív pro mobil.
   ========================================================================== */

/* Písma jsou uložená přímo na webu: rychlejší načtení a žádné přenosy na servery Googlu. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Barvy z deky */
  --chocolate: #3b2a22;
  --cream: #f1e8d6;
  --lilac: #cfa3c8;
  --hazel: #6b4f3d;
  --snow: #fbf8f2;
  /* Pomocné odstíny */
  --ink-soft: #66564a;
  --line: #ddcfbe;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(20px, 5.5vw, 48px);
  --max: 1120px;
  --radius: 24px;
  --edge: 16px;
  --overlap: clamp(150px, 44vw, 190px);

  /* Hrbolatý okraj pruhu, jako očka plyšové příze */
  --edge-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='14' viewBox='0 0 120 14'%3E%3Cpath d='M0 14V10c0-9 14-9 14 0c0-11 16-11 16 0c0-8 13-8 13 0c0-10 15-10 15 0c0-11 17-11 17 0c0-8 12-8 12 0c0-10 16-10 16 0c0-9 17-9 17 0V14Z'/%3E%3C/svg%3E");
}

/* --- Základ ------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--chocolate);
  color: var(--chocolate);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  text-wrap: balance;
}

h2 {
  margin-bottom: 0.7em;
  font-size: clamp(2.375rem, 10vw, 3.75rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.375rem;
  line-height: 1.15;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--fg, currentColor);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--chocolate);
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* --- Pruhy -------------------------------------------------------------- */

.stripe {
  --bg: var(--cream);
  --fg: var(--chocolate);
  --edge-shift: 0px;
  position: relative;
  padding-block: clamp(64px, 15vw, 128px);
  background: var(--bg);
  color: var(--fg);
}

.stripe::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 1px);
  height: var(--edge);
  background: var(--bg);
  -webkit-mask: var(--edge-mask) var(--edge-shift) 100% / auto 100% repeat-x;
  mask: var(--edge-mask) var(--edge-shift) 100% / auto 100% repeat-x;
  pointer-events: none;
}

.stripe--chocolate {
  --bg: var(--chocolate);
  --fg: var(--cream);
}

.stripe--cream {
  --bg: var(--cream);
}

.stripe--lilac {
  --bg: var(--lilac);
  --edge-shift: -47px;
}

.stripe--hazel {
  --bg: var(--hazel);
  --fg: var(--cream);
  --edge-shift: -83px;
}

.stripe--snow {
  --bg: var(--snow);
  --edge-shift: -21px;
}

/* --- Tlačítka ----------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 30px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 700 1.0625rem/1.2 var(--font-text);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

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

.button--lilac {
  background: var(--lilac);
  color: var(--chocolate);
}

.button--chocolate {
  background: var(--chocolate);
  color: var(--cream);
}

.button--outline {
  background: transparent;
  color: var(--chocolate);
  border-color: rgb(59 42 34 / 0.35);
}

.button--outline-light {
  min-height: 46px;
  padding: 0 22px;
  background: transparent;
  color: var(--cream);
  border-color: rgb(241 232 214 / 0.4);
}

@media (hover: hover) {
  .button--lilac:hover {
    background: #dab5d4;
  }

  .button--chocolate:hover {
    background: #4b372d;
  }

  .button--outline:hover {
    border-color: var(--chocolate);
  }

  .button--outline-light:hover {
    border-color: var(--cream);
  }
}

/* --- Úvod --------------------------------------------------------------- */

.hero {
  padding-top: 0;
  padding-bottom: calc(var(--overlap) + clamp(40px, 10vw, 72px));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: 14px;
}

.mark {
  display: block;
  width: 46px;
  height: 46px;
  margin-left: -6px;
  color: var(--lilac);
}

.mark svg {
  width: 100%;
  height: 100%;
}

.menu,
.topbar-order {
  display: none;
}

.hero-text {
  padding-top: clamp(28px, 9vw, 80px);
}

.name {
  color: var(--cream);
  font-size: clamp(3.25rem, 15.4vw, 6.75rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.name span {
  display: block;
}

.lede {
  max-width: 30rem;
  margin-top: 22px;
  color: rgb(241 232 214 / 0.86);
  font-size: clamp(1.125rem, 4.8vw, 1.375rem);
  line-height: 1.45;
}

.hero-order {
  margin-top: 30px;
}

@media (max-width: 519px) {
  .hero-order {
    display: flex;
    width: 100%;
  }
}

/* --- Fotky -------------------------------------------------------------- */

/* flow-root: záporný okraj pásu fotek nesmí „prosáknout“ ven z pruhu */
.photos {
  display: flow-root;
  padding-top: 0;
}

.strip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  margin: calc(-1 * var(--overlap)) 0 0;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 24px max(var(--gutter), env(safe-area-inset-left));
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), env(safe-area-inset-left));
  scrollbar-width: none;
}

.strip::-webkit-scrollbar {
  display: none;
}

.strip > li {
  flex: 0 0 78%;
  max-width: 360px;
  scroll-snap-align: start;
}

.photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--hazel);
  box-shadow: 0 22px 30px -20px rgb(35 25 21 / 0.6);
  cursor: zoom-in;
}

.photo picture {
  display: contents;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% var(--y, 45%);
}

/* Malý kroužek s šipkami napovídá, že fotka jde zvětšit. */
.photo::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgb(251 248 242 / 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b2a22' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-6.5 6.5M4 20l6.5-6.5'/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: 0 2px 6px rgb(35 25 21 / 0.25);
}

.photo:focus-visible {
  outline: 3px solid var(--chocolate);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--lilac);
}

.caption {
  margin-top: 12px;
  padding-left: 4px;
  font-size: 1rem;
  font-weight: 700;
}

/* Jediný pohyb po načtení: fotky přijedou zprava a naznačí, že se dají posouvat. */
@media (prefers-reduced-motion: no-preference) and (max-width: 759px) {
  .strip > li {
    animation: arrive 0.9s cubic-bezier(0.2, 0.75, 0.25, 1) both;
  }

  .strip > li:nth-child(2) {
    animation-delay: 0.08s;
  }

  .strip > li:nth-child(3) {
    animation-delay: 0.16s;
  }

  .strip > li:nth-child(4) {
    animation-delay: 0.24s;
  }
}

@keyframes arrive {
  from {
    transform: translateX(64px);
  }
}

/* --- Co háčkuju --------------------------------------------------------- */

.things {
  display: grid;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thing {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
}

.thing-icon {
  width: 52px;
  height: 52px;
}

.thing h3 {
  margin: 4px 0 6px;
}

.thing p {
  max-width: 32rem;
}

/* --- Jak objednat ------------------------------------------------------- */

.steps {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-content: start;
  column-gap: 18px;
  padding-bottom: 34px;
}

.step:last-child {
  padding-bottom: 0;
}

/* Stehy mezi kroky */
.step::before {
  content: "";
  position: absolute;
  top: 60px;
  bottom: 8px;
  left: 25px;
  border-left: 2px dashed rgb(241 232 214 / 0.4);
}

.step:last-child::before {
  content: none;
}

.step-number {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--chocolate);
  font: 800 1.5rem/1 var(--font-display);
}

.step h3 {
  padding-top: 13px;
}

.step p {
  max-width: 30rem;
  margin-top: 6px;
  color: rgb(241 232 214 / 0.86);
}

/* --- Napište mi --------------------------------------------------------- */

.contact {
  display: grid;
  gap: 40px;
}

.contact-intro h2 {
  margin-bottom: 0.45em;
}

.contact-intro p {
  max-width: 32rem;
}

.composer {
  display: grid;
  gap: 24px;
}

.choice {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice legend,
.field label {
  display: block;
  width: fit-content;
  margin: 0 0 10px -6px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  position: relative;
  display: block;
}

.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip input:checked + span {
  border-color: var(--chocolate);
  background: var(--chocolate);
  color: var(--cream);
}

.chip input:focus-visible + span {
  outline: 3px solid var(--chocolate);
  outline-offset: 3px;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--chocolate);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--chocolate);
  box-shadow: 0 0 0 4px rgb(207 163 200 / 0.6);
}

.field ::placeholder {
  color: #8a796b;
  opacity: 1;
}

.optional {
  color: var(--ink-soft);
  font-weight: 400;
}

.hint {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.hint[hidden] {
  display: none;
}

/* Popisek pole krátce zabliká, když se změní podle vybrané věci. */
.field.is-changed label {
  animation: flash 0.7s ease;
}

@keyframes flash {
  from {
    background: var(--lilac);
  }
}

.preview {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--cream);
}

.preview-title {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 700;
}

.bubble {
  justify-self: end;
  max-width: 100%;
  padding: 14px 18px;
  border-radius: 22px 22px 6px 22px;
  background: var(--lilac);
  font-size: 1rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.send {
  display: grid;
  gap: 10px;
}

.send [hidden] {
  display: none;
}

.status {
  font-weight: 600;
}

.status:empty {
  display: none;
}

.direct h3 {
  margin-bottom: 14px;
}

.direct ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.direct-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 20px;
  border-radius: 18px;
  background: var(--cream);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.direct-link svg {
  flex: none;
  width: 24px;
  height: 24px;
}

@media (hover: hover) {
  .direct-link:hover {
    background: #eadfc9;
  }
}

/* --- Patička ------------------------------------------------------------ */

.footer {
  --edge-shift: -64px;
  padding-block: 56px calc(48px + env(safe-area-inset-bottom));
}

.footer-mark {
  width: 44px;
  height: 44px;
  margin-left: -4px;
}

.footer-name {
  margin-top: 14px;
  font: 800 1.5rem/1.15 var(--font-display);
}

.footer-name + p {
  margin-top: 4px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 24px;
  margin-top: 16px;
  font-size: 0.9375rem;
}

.footer-bottom a {
  display: inline-block;
  padding-block: 6px;
  font-weight: 600;
  text-underline-offset: 3px;
}

/* --- Plovoucí tlačítko (jen mobil) ------------------------------------- */

.dock {
  --fg: var(--chocolate);
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border-radius: 999px;
  background: var(--chocolate);
  color: var(--cream);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px rgb(241 232 214 / 0.16), 0 14px 30px -10px rgb(35 25 21 / 0.6);
  transform: translateY(calc(100% + 32px + env(safe-area-inset-bottom)));
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.35s;
}

.dock.is-visible {
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}

/* --- Prohlížeč fotek ---------------------------------------------------- */

.viewer {
  --fg: var(--cream);
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: rgb(35 25 21 / 0.96);
  color: var(--cream);
  overscroll-behavior: contain;
}

.viewer:focus {
  outline: none;
}

.viewer::backdrop {
  background: rgb(35 25 21 / 0.5);
}

.viewer-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.viewer-track::-webkit-scrollbar {
  display: none;
}

.viewer-slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
  padding: calc(72px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.viewer-slide picture {
  display: contents;
}

.viewer-slide img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 170px);
  max-height: calc(100dvh - 170px);
  border-radius: 18px;
}

.viewer-slide figcaption {
  font-weight: 700;
  text-align: center;
}

.viewer-count {
  position: absolute;
  top: calc(24px + env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.viewer-close,
.viewer-arrow {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(241 232 214 / 0.14);
  color: var(--cream);
  cursor: pointer;
}

.viewer-close svg,
.viewer-arrow svg {
  width: 24px;
  height: 24px;
}

.viewer-close {
  top: calc(12px + env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}

.viewer-arrow {
  top: 50%;
  display: none;
  translate: 0 -50%;
}

.viewer-arrow--prev {
  left: 16px;
}

.viewer-arrow--next {
  right: 16px;
}

.viewer-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .viewer-arrow {
    display: grid;
  }

  .viewer-close:hover,
  .viewer-arrow:not(:disabled):hover {
    background: rgb(241 232 214 / 0.24);
  }
}

/* --- Hravé prvky -------------------------------------------------------- */

/* Klubko na niti v úvodu (pohyb počítá js/main.js) */
.yarn-area {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

/* skryté, dokud ho skript nepověsí na správné místo */
.yarn-area:not(.is-ready) {
  visibility: hidden;
}

.yarn-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.yarn-thread {
  fill: none;
  stroke: var(--lilac);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.yarn-ball {
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  filter: drop-shadow(0 8px 10px rgb(0 0 0 / 0.35));
}

.yarn-ball:active {
  cursor: grabbing;
}

.yarn-ball svg {
  width: 100%;
  height: 100%;
}

.yarn-hint {
  position: absolute;
  top: 0;
  left: 0;
  color: rgb(241 232 214 / 0.75);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.4s ease;
}

.yarn-hint.is-hidden {
  opacity: 0;
}

/* Řetízek nahoře: roste s posouváním, na konci pracuje háček */
.chain {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 11;
  height: 12px;
  pointer-events: none;
}

.chain-row {
  position: relative;
  width: 0;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='12' viewBox='0 0 11 12'%3E%3Cellipse cx='5.5' cy='6' rx='4.6' ry='3.3' fill='%23cfa3c8' stroke='%233b2a22' stroke-width='1.4'/%3E%3C/svg%3E") left center / 11px 12px repeat-x;
}

.chain-hook {
  position: absolute;
  top: -5px;
  right: -19px;
  width: 26px;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cpath d='M3 23 18 8' stroke='%23f1e8d6' stroke-width='5.4'/%3E%3Cpath d='M18 8c1.6-1.7 4.3-.8 4 1.4-.2 1.4-1.8 2-2.9 1.3' stroke='%23f1e8d6' stroke-width='4.6'/%3E%3Cpath d='M3 23 18 8' stroke='%233b2a22' stroke-width='2.6'/%3E%3Cpath d='M18 8c1.6-1.7 4.3-.8 4 1.4-.2 1.4-1.8 2-2.9 1.3' stroke='%233b2a22' stroke-width='2.2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  transform-origin: 20% 80%;
  transition: opacity 0.2s ease;
}

.chain-row.is-empty .chain-hook {
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .chain-row.is-working .chain-hook {
    animation: crochet 0.28s ease-in-out infinite alternate;
  }
}

@keyframes crochet {
  from {
    transform: rotate(-16deg);
  }

  to {
    transform: rotate(12deg);
  }
}

/* Volná nitka z bílého pruhu, visí do patičky */
.loose-end-area {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.loose-end {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 0 rgb(59 42 34 / 0.3));
}

@media (prefers-reduced-motion: no-preference) {
  .loose-end:not(.is-pulled) {
    animation: sway 3.4s ease-in-out infinite;
  }
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-3deg);
  }

  50% {
    transform: rotate(4deg);
  }
}

.loose-end-thread {
  fill: none;
  stroke: var(--snow);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.loose-end-grip {
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}

.loose-end-bubble {
  position: absolute;
  top: 18px;
  max-width: min(240px, 60vw);
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--cream);
  color: var(--chocolate);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 8px 20px -10px rgb(35 25 21 / 0.5);
  opacity: 0;
  transform: scale(0.85);
  transform-origin: 100% 100%;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.loose-end-bubble.is-shown {
  opacity: 1;
  transform: none;
}

/* --- Větší displeje ----------------------------------------------------- */

@media (min-width: 760px) {
  :root {
    --edge: 20px;
    --overlap: 150px;
  }

  .menu {
    display: flex;
    gap: 28px;
    margin-left: auto;
  }

  .menu a {
    padding: 8px 0;
    color: rgb(241 232 214 / 0.86);
    font-weight: 600;
    text-decoration: none;
  }

  .menu a:hover {
    color: var(--cream);
  }

  .topbar-order {
    display: inline-flex;
  }

  .strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    max-width: calc(var(--max) + 2 * var(--gutter));
    margin-inline: auto;
    overflow: visible;
  }

  .strip > li {
    max-width: none;
  }

  .things {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px 64px;
  }

  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
  }

  .step {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 0;
  }

  .step::before {
    top: 25px;
    right: -24px;
    bottom: auto;
    left: 68px;
    border-top: 2px dashed rgb(241 232 214 / 0.4);
    border-left: 0;
  }

  .step-number {
    grid-row: auto;
    margin-bottom: 18px;
  }

  .step h3 {
    padding-top: 0;
  }

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

  .send .button:first-child {
    grid-column: 1 / -1;
  }

  .dock {
    display: none;
  }
}

@media (min-width: 1000px) {
  .hero-text {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    column-gap: 56px;
  }

  .name {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .lede {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  .hero-order {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-self: start;
  }

  .contact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "intro form"
      "direct form";
    align-items: start;
    column-gap: 80px;
  }

  .contact-intro {
    grid-area: intro;
  }

  .composer {
    grid-area: form;
  }

  .direct {
    grid-area: direct;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
