/* Tbilisi Creators — site styles
   Palette comes from the city: painted stucco, saperavi wine, balcony teal.
   The yellow is the one sticky note on the hero photo. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 900;
  font-stretch: 62% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Caveat";
  src: url("/fonts/caveat-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --stucco: #F4D9CF;
  --stucco-deep: #E4B9A9;
  --paper: #FFF8F3;
  --wine: #3B0D24;
  --wine-soft: #6B3A4F;
  --balcony: #0B6E6E;
  --balcony-deep: #085454;
  --note: #FFD95A;
  --error: #A3122F;

  --gutter: 20px;
  --max: 1180px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
}

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

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

body {
  margin: 0;
  background: var(--stucco);
  color: var(--wine);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 0.18em; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--balcony); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */

.display {
  margin: 0;
  font-stretch: 62%;
  font-variation-settings: "wdth" 62;
  font-weight: 850;
  line-height: 0.9;
  letter-spacing: -0.005em;
}
/* Headline sizes are worked out from the space available, so the widest line always fits.
   --fit is that line's width in em, plus a little air. Re-measure it if the headline changes. */
.h1 { --fit: 3.78; font-size: clamp(3rem, calc((100vw - 2 * var(--gutter)) / var(--fit)), 8.4rem); }
.h2 { font-size: clamp(2.4rem, 11vw, 3.4rem); }
.h3 { font-size: 1.85rem; line-height: 1; font-weight: 800; }

.headline { margin: 0; }
.headline > span { display: block; }
.answer {
  --fit: 7.35;
  margin-top: 0.75rem;
  font-size: clamp(1.75rem, calc((100vw - 2 * var(--gutter)) / var(--fit)), 3.1rem);
  font-weight: 800; line-height: 0.98;
}

.fine { font-size: 0.92rem; line-height: 1.45; color: var(--wine-soft); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 1.9rem;
  border: 0; border-radius: 999px;
  background: var(--balcony); color: #fff;
  font: inherit; font-weight: 650; line-height: 1.1; text-align: center; text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--balcony-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn--block { display: flex; width: 100%; }
.btn--small { min-height: 44px; padding: 0 1.2rem; font-size: 0.98rem; }

/* ---------- Top bar ---------- */

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; padding-block: 8px 2px; }
.wordmark {
  font-stretch: 62%;
  font-variation-settings: "wdth" 62;
  font-weight: 800; font-size: 1.5rem; line-height: 1;
  letter-spacing: 0.03em; text-transform: uppercase; text-decoration: none;
}
.top-apply { display: none; }

/* ---------- Hero ---------- */

.hero { overflow-x: clip; padding: 1.1rem 0 clamp(2.75rem, 9vw, 3.75rem); }
.hero-grid { display: grid; gap: 2.4rem; }
.lede { margin-top: 1.2rem; max-width: 35ch; font-size: 1.18rem; line-height: 1.42; }
.cta-row { display: grid; gap: 0.7rem; margin-top: 1.5rem; }

/* One photo, pinned at a slight angle, with one note stuck to it. */
.shot { position: relative; margin: 0 auto; width: 100%; max-width: 30rem; }
.shot.is-empty { display: none; }
.shot img {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1.1; object-fit: cover; object-position: center top;
  border-radius: 18px; background: var(--wine);
  box-shadow: 0 22px 36px -20px rgba(59, 13, 36, 0.6);
  transform: rotate(1.4deg);
}
.note {
  --r: -4deg;
  position: absolute; left: -6px; bottom: 3rem; z-index: 2;
  width: max-content; max-width: 70%;
  margin: 0; padding: 0.6rem 0.9rem 0.75rem;
  background: var(--note); color: var(--wine);
  font-family: var(--font-hand); font-weight: 700; font-size: 1.65rem; line-height: 1.02;
  box-shadow: 0 10px 16px -9px rgba(59, 13, 36, 0.65);
  transform: rotate(var(--r));
}
.shot figcaption { margin-top: 1rem; font-size: 0.86rem; color: var(--wine-soft); text-align: right; }

/* The one bit of choreography: the note gets stuck on when the photo is first seen. */
@media (prefers-reduced-motion: no-preference) {
  .js .shot:not(.is-seen) .note { opacity: 0; }
  .js .shot.is-seen .note { animation: stick 0.42s cubic-bezier(0.2, 1.5, 0.4, 1) 0.25s both; }
}
@keyframes stick {
  from { opacity: 0; transform: translateY(-12px) rotate(var(--r)) scale(1.14); }
  to { opacity: 1; transform: rotate(var(--r)) scale(1); }
}

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

.band { padding: clamp(2.6rem, 9vw, 3.5rem) 0; }
.band--wine { background: var(--wine); color: var(--stucco); }
.band--wine :focus-visible { outline-color: var(--note); }

.steps { list-style: none; counter-reset: step; margin: 1.7rem 0 0; padding: 0; display: grid; gap: 1.5rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.9rem 1fr; column-gap: 0.5rem; align-items: start; align-content: start; }
.steps li::before {
  content: counter(step);
  font-stretch: 62%; font-variation-settings: "wdth" 62;
  font-weight: 850; font-size: 4.2rem; line-height: 0.8;
  color: var(--note);
}
.steps p { margin-top: 0.4rem; max-width: 36ch; color: #EFCFC4; }

.fit { display: grid; gap: 1.6rem; margin-top: 1.5rem; }
.fit-title { margin: 0; font-size: 1.1rem; font-weight: 700; }
.fit ul { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.fit li { position: relative; padding-left: 2.1rem; max-width: 34ch; text-wrap: pretty; }
.fit li::before {
  content: ""; position: absolute; left: 0; top: 0.2em; width: 1.3rem; height: 1.3rem;
  background: no-repeat center / contain;
}
.fit--yes li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B6E6E' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 13l5 5L20 6'/%3E%3C/svg%3E"); }
.fit--no li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3122F' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }

/* ---------- Application form ---------- */

.apply-layout { display: grid; gap: 2.3rem; }
.apply-card {
  padding: clamp(1.25rem, 5vw, 2.2rem);
  border-radius: 22px; background: var(--paper);
  box-shadow: 0 26px 44px -30px rgba(59, 13, 36, 0.55);
  scroll-margin-top: 14px;
}
.apply-intro { margin: 0.6rem 0 1.4rem; max-width: 44ch; }

.field { min-width: 0; margin: 0 0 1.25rem; padding: 0; border: 0; }
.form-end .field { margin-bottom: 0.6rem; }
.label { display: block; padding: 0; margin: 0 0 0.5rem; font-weight: 650; line-height: 1.3; }

.input {
  display: block; width: 100%; min-height: 54px;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid #B79AA6; border-radius: 10px;
  background: #fff; color: var(--wine);
  font: inherit; font-size: 1rem; line-height: 1.35;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #8E6C7B; opacity: 1; }
.input:focus-visible { outline-offset: 1px; border-color: var(--balcony); }

.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0.3rem 1rem;
  border: 1.5px solid #B79AA6; border-radius: 999px;
  background: #fff; font-size: 0.98rem; line-height: 1.2;
}
.choice input:checked + span { background: var(--wine); border-color: var(--wine); color: var(--paper); }
.choice input:focus-visible + span { outline: 3px solid var(--balcony); outline-offset: 2px; }
.contact-value { margin-top: 0.65rem; }

.check { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; font-size: 0.95rem; cursor: pointer; }
.check input { flex: none; width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--balcony); }

.error { margin-top: 0.45rem; color: var(--error); font-size: 0.93rem; font-weight: 600; }
.is-invalid .input, .is-invalid .choice span { border-color: var(--error); }

.form-status { margin-top: 0.9rem; color: var(--error); font-weight: 600; }
.form-status:empty { display: none; }
.apply-form .fine { margin-top: 1rem; }

.apply-done p { margin-top: 1rem; max-width: 30ch; font-size: 1.15rem; }

/* Bots fill this in; people never see it. */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer: email and privacy only ---------- */

.foot { padding: 1.5rem 0 1.7rem; background: var(--wine); color: #EFCFC4; font-size: 0.95rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; }
.foot :focus-visible { outline-color: var(--note); }

/* ---------- Sticky apply bar (phones only) ---------- */

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--stucco); border-top: 1px solid var(--stucco-deep);
  transform: translateY(110%); visibility: hidden;
  transition: transform 0.22s ease, visibility 0s linear 0.22s;
}
.sticky-cta.is-on { transform: none; visibility: visible; transition: transform 0.22s ease, visibility 0s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sticky-cta, .sticky-cta.is-on { transition: none; }
}

/* ---------- Plain pages (privacy, thanks, retry, 404) ---------- */

.page { padding-block: 2.2rem 4.5rem; }
.page .h1 { --fit: 6.2; }
.page .h2 { margin-bottom: 1.6rem; }
.prose { max-width: 62ch; }
.prose h2 { margin: 2.1rem 0 0.5rem; font-size: 1.2rem; line-height: 1.3; }
.prose p, .prose ul { margin: 0 0 0.9rem; }
.prose ul { padding-left: 1.2rem; }
.todo { background: var(--note); padding: 0.05em 0.3em; font-weight: 650; }
.foot .wordmark { color: var(--stucco); }
.foot-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.6rem; }

/* ---------- Wider screens ---------- */

@media (min-width: 700px) {
  :root { --gutter: 32px; }
  .top-apply { display: inline-flex; }
  .cta-row { grid-template-columns: auto 1fr; align-items: center; gap: 1.2rem; }
  .shot img { aspect-ratio: 4 / 5; }
  .note { font-size: 1.85rem; left: -18px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2.2rem; }
  .sticky-cta { display: none; }
}

@media (min-width: 960px) {
  .top { padding-top: 14px; }
  .hero { padding-block: 1.4rem 3rem; }
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 3.5rem; align-items: center; }
  .hero .h1 { font-size: 7.2rem; }
  .answer { margin-top: 0.9rem; font-size: 2.45rem; }
  .answer-br { display: none; }
  .shot { max-width: 23rem; }

  .steps-band { padding-block: 2.6rem 2.8rem; }
  .steps { margin-top: 1.4rem; }

  .apply-band { padding-block: 3rem; }
  .apply-layout { grid-template-columns: minmax(0, 0.58fr) minmax(0, 1.42fr); gap: 4rem; align-items: start; }
  .apply-intro { margin-bottom: 1.15rem; }
  .field { margin-bottom: 1.1rem; }
  .fit-col { position: sticky; top: 2rem; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.1rem; }
  .field--wide { grid-column: 1 / -1; }
  .form-end { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.1rem; align-items: center; }
  .form-end .field { margin-bottom: 0; }
}
