/* ==========================================================================
   Atin — landing page styles (doodle-sticker rebuild from the reference)
   Cream paper, ink outlines, hard offset shadows, yellow highlight,
   sky-blue pills. All brand values live in :root — swap them there.
   ========================================================================== */

:root {
  /* --- Colour (exact values from the brief / SVG assets) --------------- */
  --bg: #F7F1E9;                 /* page background */
  --text: #1A1A1A;               /* text + outlines */
  --text-soft: rgba(26, 26, 26, 0.65);  /* helper text, placeholders */
  --highlight: #FCCD40;          /* yellow: highlight, button, stars */
  --sky: #BAE6FD;                /* "Atin" / "help" pills */
  --field: #F7F1E9;              /* input fill (matches page, per SVG rects) */
  --error: #8f3e2c;

  /* --- Type ------------------------------------------------------------ */
  --font-display: "Albert Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Albert Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "DM Mono", "SF Mono", Menlo, Consolas, monospace;

  /* --- Shape ----------------------------------------------------------- */
  --radius: 5px;                 /* fields, button (Name/Request rects rx 5) */
  --radius-pill: 8px;            /* sky pills */
  --radius-card: 27px;           /* photo card (rx 23 on 422w scaled up) */
  --border: 2px solid var(--text);
  --shadow: 3px 3px 0 var(--text);   /* hard offset "sticker" shadow */

  /* --- Layout ---------------------------------------------------------- */
  --shell: 80rem;                /* ≈1136px: left col + gap + 356px form */
  --form-w: 356px;               /* Request rectangle width */
}

/* ==========================================================================
   Base
   ========================================================================== */

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

/* Author rules must not beat the UA [hidden] rule. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.skip-link {
  position: absolute; left: 1rem; top: 1rem;
  z-index: 100; padding: .5rem 1rem;
  background: var(--highlight); color: var(--text);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

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

/* Decorative doodles never intercept clicks. */
.doodle { pointer-events: none; user-select: none; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header { position: relative; padding-block: clamp(1.5rem, 3vw, 2.25rem); }
.site-header .shell { position: relative; display: flex; align-items: center; }

/* Logo + tagline: the reference SVG assets, sized to match (logo 144×13 native). */
/* Logo position: base = hero art's left edge. Nudge it with --logo-shift only:
   0 = aligned with hero art, positive = right, negative = left. Scales nowhere —
   it's a fixed nudge, so the alignment holds proportionally at every size. */
:root { --logo-shift: 60px; }
.logo {
  position: absolute;
  left: calc(clamp(1.25rem, 4vw, 3rem) + var(--logo-shift));
  top: 50%;
  transform: translateY(-50%);
}
.logo img { width: clamp(108px, 12vw, 144px); height: auto; }

/* Tagline asset centred horizontally over the form column. */
.site-header__right {
  position: absolute;
  right: calc(var(--form-w) / 1.8 + clamp(1.25rem, 4vw, 3rem));
  top: 50%;
  transform: translate(50%, -50%);
  width: clamp(180px, 24vw, 299px);
  height: auto;
}

.doodle--topstar {
  position: absolute;
  right: clamp(0.75rem, 1.5vw, 1.5rem);
  top: clamp(1.25rem, 3vw, 2rem);
  width: clamp(22px, 2.4vw, 32px);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(var(--form-w), 100%);
  gap: clamp(2rem, 6vw, 7.5rem);
  align-items: start;
  padding-block: clamp(1rem, 3vw, 2.5rem) clamp(4rem, 8vw, 6rem);
}

/* ==========================================================================
   Hero (left column) — one artwork supplied by Atin (image of left side.svg)
   ========================================================================== */

.hero__art {
  display: block;
  width: 100%;        /* no max — tune with the tweaks panel, then we bake the value in */
  height: auto;
}

/* Desktop: hero rides in sync with the scroll (pinned in view). Mobile: static. */
@media (min-width: 50rem) {
  .hero {
    position: sticky;
    top: clamp(1rem, 4vh, 3rem);
  }
  /* keep the art just short enough to stay fully pinned while scrolling */
  .hero__art { max-height: calc(vh - clamp(3rem, 10vh, 7rem)); width: auto; margin-inline: 0; }
}

/* ==========================================================================
   Form column
   ========================================================================== */

.form-col { position: relative; }

.form-title {
  margin: 0 0 .35rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.2vw, 1.8rem);
  line-height: 1.15;
}
.form-sub { margin: 0 0 1.9rem; color: var(--text-soft); font-size: .95rem; }

.question { margin: 0 0 1.65rem; }

.question__label {
  display: block;
  margin: 0 0 .55rem;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
}

/* Fields: cream fill, 2px ink border, 5px radius, hard shadow (Name rect). */
.field {
  width: 100%;
  min-height: 48px;
  padding: .65rem .95rem;
  font: inherit;
  font-size: 1rem;                 /* 16px — no iOS zoom on focus */
  color: var(--text);
  background: var(--field);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  appearance: none;
  transition: translate 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.field::placeholder { color: var(--text-soft); opacity: 1; }
.field:hover { background: #fdf9f2; }
.field:focus {
  outline: 3px solid var(--highlight);
  outline-offset: 2px;
  translate: 1px 1px;
  box-shadow: 2px 2px 0 var(--text);
}
.field[aria-invalid="true"] { border-color: var(--error); }

.field--area { resize: vertical; min-height: 5.75rem; line-height: 1.55; }

.field--select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231A1A1A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.field__help { margin: .5rem 0 0; font-size: .85rem; color: var(--text-soft); }
.field__error { margin: .5rem 0 0; font-size: .85rem; color: var(--error); font-weight: 500; }

/* ---- Upload dropzone ----------------------------------------------------- */

.dropzone {
  position: relative;
  background: var(--field);
  border: 2px dashed var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.1rem;
  transition: background-color 150ms ease;
}
.dropzone:hover { background: #fdf9f2; }
.dropzone.is-dragging { background: #fef3d0; }
.dropzone:focus-within { outline: 3px solid var(--highlight); outline-offset: 2px; }

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

.dropzone__empty {
  display: flex; flex-direction: column; align-items: center;
  gap: .65rem; text-align: center; cursor: pointer;
}
.dropzone__icon { width: 34px; height: 34px; }
.dropzone__meta { margin: 0; font-size: .85rem; color: var(--text-soft); }

.dropzone__file { display: flex; align-items: center; gap: 1rem; }
.dropzone__preview {
  flex: 0 0 auto;
  width: 56px; height: 56px;
  object-fit: cover; border-radius: 4px;
  border: 1.5px solid var(--text); background: #fff;
}
.dropzone__info { min-width: 0; }
.dropzone__name { margin: 0 0 .15rem; font-weight: 500; word-break: break-word; }
.dropzone__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .45rem; }

/* ---- Checkbox ------------------------------------------------------------- */

.checkbox-row { display: flex; align-items: center; gap: .65rem; margin-top: 1rem; }
.checkbox-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.4rem; height: 1.4rem; margin: 0;
  accent-color: var(--highlight);
  cursor: pointer;
}
.checkbox-row label { cursor: pointer; }

/* Honeypot: off-screen, but not display:none (bots still fill it). */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ==========================================================================
   Buttons (Request rectangle: yellow, ink border, hard shadow)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .55rem 1.15rem;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--field);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: translate 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.btn:hover { translate: 1px 1px; box-shadow: 2px 2px 0 var(--text); }
.btn:active { translate: 3px 3px; box-shadow: 0 0 0 var(--text); }

.btn--primary {
  width: 100%;
  background: var(--highlight);
  font-size: 1.1rem;
  font-weight: 600;
  padding: .85rem 1.5rem;
}
.btn--primary:disabled { opacity: .55; cursor: wait; translate: none; box-shadow: var(--shadow); }

.btn--ghost { background: transparent; }
.btn--quiet {
  background: transparent; border-color: transparent; box-shadow: none;
  text-decoration: underline; text-underline-offset: 3px; min-height: 0;
}
.btn--quiet:hover { translate: none; box-shadow: none; background: rgba(26,26,26,.06); }
.btn--sm { min-height: 36px; padding: .3rem .8rem; font-size: .85rem; box-shadow: 2px 2px 0 var(--text); }

/* ==========================================================================
   Submit, status, jet doodle, success
   ========================================================================== */

.submit { margin-top: 2.1rem; }
.submit__note { margin: .85rem 0 0; font-size: .85rem; color: var(--text-soft); text-align: center; }
.form-status { margin: 1rem 0 0; font-size: .9rem; color: var(--error); }
.form-status:empty { display: none; }

/* Paper plane doodle anchored to the form column, right edge. */
.form-col__jet {
  position: absolute;
  right: clamp(-4.6rem, -3.4vw, -3rem);
  top: 30%;
  width: clamp(44px, 4.5vw, 64px);
}
@media (max-width: 75rem) {
  .form-col__jet { right: -1.5rem; }  /* keep the plane inside on narrower desktops/tablets */
}

.success { max-width: var(--form-w); padding: .5rem 0 1rem; }
.success__star { width: 46px; margin-bottom: .6rem; }
.success__title { margin: 0 0 .5rem; font-family: var(--font-body); font-size: 1.6rem; }
.success__text { margin: 0 0 1.1rem; color: var(--text-soft); }
.success__note {
  margin: 0 0 1.4rem;
  padding: .85rem 1rem;
  font-size: .85rem; color: var(--text-soft);
  background: #fdf9f2;
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.success__note strong { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Motion (subtle, reference-implied only)
   ========================================================================== */

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -6px; }
}
@keyframes twinkle {
  0%, 100% { opacity: 1; scale: 1; }
  50%      { opacity: .55; scale: .88; }
}
@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;
  }
}

/* ==========================================================================
   Responsive — tablet stacks with the form first, mobile trims
   ========================================================================== */

@media (max-width: 48rem) {  /* stack below 768px: small tablets + phones only */
  .layout { grid-template-columns: 1fr; gap: clamp(2.5rem, 6vw, 4rem); }
  /* Mobile order: hero artwork first, then the form — natural DOM order. */
  .form-col__jet { display: none; }
  .hero__art { max-width: 520px; margin-inline: auto; translate: none !important; }  /* ignore stale saved tweaks */
}

@media (max-width: 35rem) {
  /* Header stacks: logo on its own row, tagline centred below — no overlap. */
  .site-header .shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .8rem;
  }
  .logo { position: static; transform: none; }
  .site-header__right {
    position: static;
    transform: none;
    width: min(240px, 80vw);
  }
  .hero__art { translate: none !important; }  /* ignore stale saved tweaks on mobile */
  .question { margin-bottom: 1.35rem; }
  .question__label { font-size: 1rem; }
  .dropzone__file { flex-wrap: wrap; }
  .btn--primary { padding: 1rem 1.25rem; }
}

/* Footer email: bottom center, Albert Sans, 70% opacity */
.site-footer {
  padding: 1.5rem 0 2rem;
  text-align: center;
}
.site-footer a {
  font-family: "Albert Sans", sans-serif;
  color: var(--text);
  opacity: 0.7;
  text-decoration: none;
}

/* Sending state: label swaps to "Sending…" + bouncing dots */
.btn--primary .btn__dots { display: none; }
.btn--primary.is-sending .btn__label { visibility: hidden; }
.btn--primary.is-sending { pointer-events: none; }
.btn--primary.is-sending::after {
  content: "Sending…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn--primary { position: relative; }
.btn--primary.is-sending .btn__dots {
  display: inline-flex;
  gap: 4px;
  position: absolute;
  bottom: 22%;
  left: 50%;
  translate: -50% 0;
}
.btn--primary.is-sending .btn__dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: btn-bounce 1s infinite ease-in-out;
}
.btn--primary.is-sending .btn__dots i:nth-child(2) { animation-delay: 0.15s; }
.btn--primary.is-sending .btn__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes btn-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .5; }
  40% { transform: translateY(-4px); opacity: 1; }
}
