/*
  Lady Jane Friday: a scrapbook of a sun-warmed Mediterranean life. Mobile first.
  Torn notes, tape, polaroids and a luggage tag, after Jane's moodboard.
  Every colour, font, size, space and tilt comes from tokens.css. The only literal
  values here are structural (0, 100%, fractions) and the two breakpoints,
  because custom properties cannot be used inside @media.
*/

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

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

body {
  margin: 0;
  overflow-x: hidden; /* tilted pieces may poke past the edge by a few pixels */
  background-color: var(--colour-bg);
  background-image: var(--texture-grain);
  color: var(--colour-text);
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; } /* keep hidden working on elements that set display, like the form */
h1, h2, h3, p, figure { margin: 0; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-gutter);
  top: calc(-1 * var(--space-2xl));
  z-index: 10;
  padding: var(--space-xs) var(--space-s);
  background: var(--colour-panel);
  color: var(--colour-on-panel);
  font-size: var(--text-sm);
}
.skip-link:focus { top: var(--space-s); }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

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

.eyebrow {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--colour-accent);
  text-wrap: balance;
}
.eyebrow--ink { color: var(--colour-text); }

.section-title {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--colour-heading);
}
.section-title--light { color: var(--colour-on-panel); }

.script {
  font-family: var(--font-script);
  font-weight: var(--weight-regular);
  font-size: var(--text-script);
  line-height: var(--leading-tight);
  color: var(--colour-accent);
}

/* ---------- Scrapbook pieces ---------- */

/* Torn note paper. The paper is a masked pseudo-element and the shadow is a
   filter on the piece, so the shadow follows the torn edge. */
.paper {
  --paper-colour: var(--colour-note);
  position: relative;
  isolation: isolate;
  padding: calc(var(--edge-size) + var(--space-m)) var(--space-m);
  filter: var(--shadow-scrap);
}
.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--paper-colour);
  background-image: var(--texture-grain);
  -webkit-mask:
    var(--edge-torn-top) top left / var(--edge-tile) var(--edge-size) repeat-x,
    var(--edge-torn-bottom) bottom left / var(--edge-tile) var(--edge-size) repeat-x,
    linear-gradient(black, black) center / 100% calc(100% - 2 * var(--edge-size) + 2px) no-repeat;
  mask:
    var(--edge-torn-top) top left / var(--edge-tile) var(--edge-size) repeat-x,
    var(--edge-torn-bottom) bottom left / var(--edge-tile) var(--edge-size) repeat-x,
    linear-gradient(black, black) center / 100% calc(100% - 2 * var(--edge-size) + 2px) no-repeat;
}
.paper--aged { --paper-colour: var(--colour-note-aged); }
.paper--sheet { padding: calc(var(--edge-size) + var(--space-xl)) var(--space-m) calc(var(--edge-size) + var(--space-l)); }

/* A strip of tape across the top */
.photo--taped::after {
  content: "";
  position: absolute;
  top: calc(-0.5 * var(--tape-height));
  left: 50%;
  width: var(--tape-width);
  height: var(--tape-height);
  translate: -50% 0;
  rotate: var(--tilt-a);
  background: var(--colour-tape);
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 45%);
}

/* Polaroid photo */
.photo {
  position: relative;
  padding: var(--space-xs) var(--space-xs) var(--space-m);
  background: var(--colour-photo-border);
  filter: var(--shadow-photo);
}
.photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.photo__caption {
  margin-top: var(--space-xs);
  font-family: var(--font-body);
  font-style: italic;
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  text-align: center;
  color: var(--colour-text);
  text-wrap: balance;
}

/* Handwritten scrap */
.scrap-note {
  width: fit-content;
  padding: calc(var(--edge-size) + var(--space-xs)) var(--space-m);
}

/* ---------- Button ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-target);
  padding: var(--space-xs) var(--space-m);
  border: var(--rule-hairline) solid var(--colour-button-bg);
  border-radius: var(--radius);
  background: var(--colour-button-bg);
  color: var(--colour-button-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-quick) var(--ease-out),
    border-color var(--duration-quick) var(--ease-out);
}
.button:hover { background: var(--colour-button-hover); border-color: var(--colour-button-hover); }
.button--full { width: 100%; padding-inline: var(--space-2xs); }
.button[disabled] { opacity: .7; cursor: progress; }

/* ---------- Monogram (Jane's artwork as a mask, coloured by token) ---------- */

.monogram {
  display: block;
  width: var(--space-2xl);
  aspect-ratio: 910 / 895; /* the artwork's own proportions */
  background-color: var(--colour-heading);
  -webkit-mask: url("img/monogram.svg") center / contain no-repeat;
  mask: url("img/monogram.svg") center / contain no-repeat;
}
.monogram--light { background-color: var(--colour-on-card); }

/* ---------- Jane's shell ---------- */
/* .shell is her full pen drawing, for 64px and up.
   .shell-line is the outline and spiral only, for small sizes. */

.shell,
.shell-line {
  display: block;
  flex: none;
  -webkit-mask: var(--shell-art) center / contain no-repeat;
  mask: var(--shell-art) center / contain no-repeat;
}
.shell {
  --shell-art: url("img/shell.webp");
  width: var(--space-2xl);
  height: var(--space-2xl);
  background-color: var(--colour-heading);
}
.shell-line {
  --shell-art: url("img/shell-line.svg");
  width: var(--space-l);
  height: var(--space-l);
  background-color: var(--colour-rule);
}

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

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-l) var(--space-gutter) var(--space-xl);
  display: grid;
}

.hero__collage {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: start;
}

.monogram-card {
  position: relative;
  z-index: 2;
  margin-top: var(--space-m);
  padding: var(--space-l) var(--space-s) var(--space-xl);
  display: grid;
  place-items: center;
  gap: var(--space-xs);
  background-color: var(--colour-panel);
  background-image: var(--texture-grain);
  rotate: var(--tilt-a);
  filter: var(--shadow-scrap);
}
.monogram-card .monogram { width: min(100%, calc(var(--space-3xl) * 1.25)); }

.photo--hero {
  margin-left: calc(-1 * var(--space-m));
  rotate: var(--tilt-d);
}

.hero__sheet {
  z-index: 3;
  margin-top: calc(-1 * var(--space-xl));
  display: grid;
  justify-items: center;
  gap: var(--space-s);
  padding-inline: var(--space-s);
  text-align: center;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--colour-text);
}
.wordmark span { display: block; }

.rule {
  display: block;
  width: var(--space-xl);
  height: var(--rule-strong);
  background: var(--colour-burnt-orange);
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--colour-heading);
  text-wrap: balance;
}
.hero__sub {
  font-style: italic;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--colour-text-muted);
  text-wrap: balance;
}
.hero .button { margin-top: var(--space-xs); padding-inline: var(--space-s); }

/* ---------- Intro ---------- */

.intro {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-gutter) var(--space-section);
}
.intro__note {
  padding-top: calc(var(--edge-size) + var(--space-xl));
}
.intro__text {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  text-align: center;
}
.scrap-note--friday {
  position: relative;
  z-index: 2;
  margin: calc(-1 * var(--space-s)) var(--space-s) 0 auto;
}

/* ---------- What I curate ---------- */

.curate {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-gutter) var(--space-section);
}
.curate__head {
  display: grid;
  justify-items: center;
  gap: var(--space-m);
  margin-bottom: var(--space-xl);
  text-align: center;
}
.scrap-note--curate {
  max-width: calc(var(--measure) * .6);
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  color: var(--colour-text);
}

.polaroids {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-l) var(--space-s);
}
.polaroids .photo { padding: var(--space-2xs) var(--space-2xs) var(--space-s); }
.polaroids .photo:nth-child(1) { rotate: var(--tilt-a); }
.polaroids .photo:nth-child(2) { rotate: var(--tilt-b); margin-top: var(--space-m); }
.polaroids .photo:nth-child(3) { rotate: var(--tilt-d); }
.polaroids .photo:nth-child(4) { rotate: var(--tilt-c); margin-top: var(--space-m); }

/* ---------- How it works ---------- */

.steps {
  background-color: var(--colour-panel);
  background-image: var(--texture-grain);
  color: var(--colour-on-panel);
  padding: var(--space-section) var(--space-gutter);
}
.steps__inner {
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
}
.steps__list {
  list-style: none;
  max-width: var(--measure);
  margin: var(--space-l) auto 0;
  padding: 0;
  display: grid;
  gap: var(--space-m);
}
.ticket {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  text-align: left;
}
.ticket__num {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  border: var(--rule-hairline) solid var(--colour-rule);
  border-radius: var(--radius-round);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--colour-accent);
}
.ticket__text {
  font-size: var(--text-lg);
  font-style: italic;
  line-height: var(--leading-snug);
  color: var(--colour-text);
}

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

.about {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-section) var(--space-gutter);
  display: grid;
  gap: var(--space-l);
}
.photo--portrait {
  width: 100%;
  max-width: calc(var(--measure) * .5);
  margin: 0 auto;
  rotate: var(--tilt-a);
}
.about__note {
  z-index: 2;
  margin-top: calc(-1 * var(--space-m));
  display: grid;
  gap: var(--space-s);
  text-align: center;
}
.placeholder { font-style: italic; color: var(--colour-text-muted); }

.shell-note {
  display: flex;
  align-items: center;
  gap: var(--space-s);
}
.shell-note .eyebrow { margin-bottom: var(--space-2xs); }
.shell-note p { font-style: italic; line-height: var(--leading-snug); }

/* ---------- Enquiry ---------- */

.enquire {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-s) var(--space-gutter) var(--space-section);
  scroll-margin-top: var(--space-s);
}
.enquire:focus { outline: none; }

/* Luggage tag, like the one in the moodboard */
.tag {
  position: relative;
  z-index: 3;
  isolation: isolate;
  width: calc(var(--space-3xl) * 1.55);
  margin: 0 var(--space-s) calc(-1 * var(--space-l)) auto;
  padding: var(--space-xl) var(--space-s) var(--space-m);
  display: grid;
  justify-items: center;
  gap: var(--space-2xs);
  text-align: center;
  rotate: var(--tilt-tag);
  filter: var(--shadow-scrap);
}
.tag::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--colour-note-aged);
  background-image: var(--texture-grain);
  clip-path: polygon(22% 0, 78% 0, 100% 14%, 100% 100%, 0 100%, 0 14%);
}
.tag::after {
  /* brass eyelet */
  content: "";
  position: absolute;
  top: var(--space-s);
  left: 50%;
  width: var(--space-s);
  height: var(--space-s);
  translate: -50% 0;
  border: var(--rule-strong) solid var(--colour-rule);
  border-radius: var(--radius-round);
  background: var(--colour-bg);
}
.tag .monogram { width: var(--space-xl); }
.tag__name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--colour-heading);
}
.tag__line {
  font-style: italic;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--colour-text-muted);
}

.enquire__card {
  padding-top: calc(var(--edge-size) + var(--space-2xl));
  text-align: center;
}
.script--title { margin-bottom: var(--space-xs); }
.enquire__sub { color: var(--colour-text-muted); margin-bottom: var(--space-l); }

.form { display: grid; gap: var(--space-m); text-align: left; }
.field { display: grid; gap: var(--space-2xs); }
.field label {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--colour-heading);
}
.optional {
  font-weight: var(--weight-regular);
  letter-spacing: 0;
  text-transform: none;
  color: var(--colour-text-muted);
}

.field input,
.field textarea {
  width: 100%;
  min-height: var(--tap-target);
  padding: var(--space-xs);
  border: var(--rule-hairline) solid var(--colour-field-border);
  border-radius: var(--radius);
  background: var(--colour-field-bg);
  color: var(--colour-text);
  font: inherit;
  font-size: var(--text-base); /* 18px minimum, so iOS never zooms on focus */
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color var(--duration-quick) var(--ease-out),
    box-shadow var(--duration-quick) var(--ease-out);
}
.field textarea { resize: vertical; min-height: calc(var(--tap-target) * 2.5); }
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--colour-heading);
  box-shadow: 0 0 0 var(--space-3xs) color-mix(in srgb, var(--colour-heading) 20%, transparent);
}
.field input[aria-invalid="true"] { border-color: var(--colour-error); }
.field__error { font-size: var(--text-sm); color: var(--colour-error); }
.field__error:empty { display: none; }

.consent {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--colour-text-muted);
}
.form__status {
  font-size: var(--text-sm);
  color: var(--colour-error);
  text-align: center;
}
.form__status:empty { display: none; }

/* Honeypot, off screen for people, still in the form for bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success { padding: var(--space-s) 0 var(--space-2xs); }
.form-success:focus { outline: none; }
.form-success__text {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--colour-heading);
}
.form-success .script { margin-top: var(--space-2xs); }

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

.footer {
  padding: var(--space-xl) var(--space-gutter) var(--space-l);
  border-top: var(--rule-hairline) solid color-mix(in srgb, var(--colour-rule) 50%, transparent);
  display: grid;
  justify-items: center;
  gap: var(--space-2xs);
  text-align: center;
}
.footer .shell-line { margin-bottom: var(--space-2xs); }
.footer__line {
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--colour-heading);
}
.footer__place,
.footer__copy {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--colour-text-muted);
}
.footer__place { letter-spacing: var(--tracking-caps); }
.footer__copy { margin-top: var(--space-xs); font-weight: var(--weight-medium); }

/* ---------- Scroll fade-ins (durations drop to 0 under reduced motion in tokens.css) ---------- */
/* Uses translate, so it never fights the rotate used for tilts */

.js .reveal {
  opacity: 0;
  translate: 0 var(--reveal-distance);
  transition:
    opacity var(--duration-reveal) var(--ease-out),
    translate var(--duration-reveal) var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; translate: none; }

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

/* ---------- Larger screens (40rem = 640px, 56rem = 896px) ---------- */

@media (min-width: 40rem) {
  .polaroids { grid-template-columns: repeat(4, 1fr); }
  .steps__list { max-width: var(--container); grid-template-columns: repeat(3, 1fr); }
  .paper--sheet { padding-inline: var(--space-xl); }
}

@media (min-width: 56rem) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    padding-block: var(--space-2xl) var(--space-section);
  }
  .hero__sheet { margin: 0 0 0 calc(-1 * var(--space-2xl)); }
  .monogram-card .monogram { width: calc(var(--space-3xl) * 1.6); }

  .about {
    grid-template-columns: 1fr 1.1fr;
    column-gap: var(--space-2xl);
    align-items: center;
  }
  .photo--portrait { grid-row: span 2; }
  .about__note { margin-top: 0; text-align: left; justify-items: start; }

  .enquire { max-width: var(--container); display: grid; grid-template-columns: auto 1fr; align-items: start; }
  .tag { margin: var(--space-2xl) calc(-1 * var(--space-m)) 0 0; }
  .enquire__card { max-width: var(--measure); }
}
