/* Layout: a space-age corporate sheet. Huge extended caps beside the mark,
   two companies split down a heavy rule, a teal band for the form.
   EVERY COLOUR IS FROM THE TWO COMPANIES' LOGOS: Earth Libraries' cream,
   black, teal, yellow, green and pink, and AUTOPHOTO's red. Nothing new. */
:root {
  --paper: #fcfaf1;      /* EL cream */
  --ink: #000000;        /* EL outline */
  --muted: #5a5850;      /* the ink, thinned on the cream */
  --band: #148494;       /* EL teal */
  --on-band: #fcfaf1;
  --signal: #f7001c;     /* AUTOPHOTO red: the pupil, the full stops, errors */
  --yellow: #f8be00;     /* EL yellow: focus and hover */
  --green: #317f2a;      /* EL green */
  --headline: "Rammetto One", "Arial Black", sans-serif;   /* fat, warm, 1950s: the two headlines only */
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Karla", "Helvetica Neue", Arial, sans-serif;      /* reading text */
  --label: "Archivo", "Arial Narrow", Arial, sans-serif;     /* form, footer, small caps: set narrow, like the wordmark */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b0b0a; --ink: #fcfaf1; --muted: #a9a698; --band: #148494; --on-band: #fcfaf1; --signal: #ff2a3d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b0b0a; --ink: #fcfaf1; --muted: #a9a698; --band: #148494; --on-band: #fcfaf1; --signal: #ff2a3d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; position: relative; overflow-x: hidden; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
/* THE BACKGROUND. Quiet sparkles behind everything; then each section has
   its own moment as you reach it: a booth curtain sways across AUTOPHOTO,
   a record spins behind Earth Libraries, and gears turn in the contact
   band. All faint, none clickable. Positions here; motion in site.js. */
.top, main, .foot { position: relative; z-index: 1; }
.cosmos { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; color: var(--ink); }
.sparkle { position: absolute; width: 18px; height: 18px; fill: currentColor; will-change: transform; }
.sparkle path { transform-box: fill-box; transform-origin: center; animation: twinkle-bg 6s ease-in-out infinite; }
@keyframes twinkle-bg { 0%, 80%, 100% { opacity: 1; transform: scale(1); } 90% { opacity: .3; transform: scale(.6); } }

.co { position: relative; overflow: hidden; isolation: isolate; }
.co > :not(.curtain-bg):not(.record-bg) { position: relative; z-index: 1; }
/* AUTOPHOTO: the curtain draws in from the right when the card is reached. */
.curtain-bg { position: absolute; top: 0; right: 0; height: 100%; width: 42%; z-index: 0; color: var(--signal); opacity: .11;
  transform: scaleX(.12); transform-origin: right center; transition: transform 1.4s cubic-bezier(.3, .7, .2, 1); }
.curtain-bg .cloth { fill: currentColor; }
.curtain-bg .folds, .curtain-bg .rod { stroke: var(--ink); }
.co.in-view .curtain-bg { transform: none; }
/* EARTH LIBRARIES: the record slides in and plays at 33⅓, one turn every 1.8s. */
.record-bg { position: absolute; top: 50%; right: -24%; width: 72%; z-index: 0; color: var(--ink); opacity: 0;
  transform: translate(30%, -50%); transition: transform 1.2s cubic-bezier(.3, .7, .2, 1), opacity 1s; }
.co.in-view .record-bg { opacity: .07; transform: translate(0, -50%); }
.record-bg .disc { transform-box: fill-box; transform-origin: center; animation: play 1.8s linear infinite paused; }
.co.in-view .record-bg .disc { animation-play-state: running; }
@keyframes play { to { transform: rotate(360deg); } }
.record-bg .sheen { fill: currentColor; opacity: .5; }
.record-bg .label { fill: var(--signal); opacity: .9; }
.record-bg .label-text { fill: var(--paper); font: 700 11.5px/1 var(--label); font-stretch: 75%; letter-spacing: .14em; }
.record-bg .hole { fill: var(--paper); }
@media (max-width: 760px) { .record-bg { width: 86%; right: -38%; } .curtain-bg { width: 48%; } }
/* THE CONTACT BAND: gears, turned by the scroll. */
.contact { position: relative; overflow: hidden; }
.contact-in { position: relative; z-index: 1; }
.gears { position: absolute; left: -70px; bottom: -80px; width: 380px; height: auto; color: var(--on-band); opacity: .13; pointer-events: none; }
@media (max-width: 760px) { .gears { left: auto; right: -120px; bottom: -70px; width: 320px; } }
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
@media (max-width: 520px) { .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.mark { height: 44px; width: auto; color: var(--ink); flex: none; }
.pupil { fill: var(--signal); }
.glint { fill: var(--paper); }
:root .hero-mark .glint, :root .mark .glint { fill: #fcfaf1; }   /* a glint is light, in either theme */
.smile { transform-box: fill-box; transform-origin: center; transition: transform .25s ease-out; }
.wiggle .smile { transform: scale(1.35, 1.6); }
/* The wordmark is set narrow and tall, like AUTOPHOTO's, not wide like the headlines. */
.word { font: 700 19px/1 var(--display); font-stretch: 75%; letter-spacing: .07em; text-transform: uppercase; }
.toplink { font: 700 14px/1 var(--label); font-stretch: 75%; text-transform: uppercase; letter-spacing: .1em; text-decoration: none; padding: 10px 14px; border: 2px solid var(--ink); }
.toplink:hover { background: var(--ink); color: var(--paper); }

/* hero */
.hero {
  display: grid; grid-template-columns: 1fr minmax(180px, 290px); grid-template-areas: "h m" "l m";
  column-gap: 40px; row-gap: 22px; align-items: end;
  padding-block: 28px 40px; border-bottom: 3px solid var(--ink);
}
h1 { grid-area: h; margin: 0; font: 400 clamp(60px, 11vw, 136px)/.92 var(--headline); letter-spacing: -.01em; text-transform: uppercase; }
h1 span { display: block; }
h1 i { font-style: normal; color: var(--signal); }
.booth { grid-area: m; align-self: center; display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hero-mark { display: block; width: 100%; height: auto; overflow: visible; }
.lede { grid-area: l; margin: 0; max-width: 31em; font-size: clamp(18px, 2vw, 21px); color: var(--muted); }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "m" "h" "l"; padding-block: 8px 32px; }
  .booth { width: min(240px, 66%); }
}
/* THE HEAD'S MOODS. Each is a class the script puts on, so all of the motion
   lives here and all of it stops under reduced motion (bottom of the file). */
.eye { transform-box: fill-box; transform-origin: center; transition: transform .09s ease-in; }
.eye.shut { transform: scaleY(.08); }
.asleep .eye { transform: scaleY(.28); transition-duration: 1.2s; }
.asleep .eye.shut { transform: scaleY(.08); }
.pupil { transition: r .12s ease-out; }
.ear { transform-box: fill-box; }
.ear-r { transform-origin: 0% 100%; }   /* the antennas pivot where they meet the head */
.ear-l { transform-origin: 100% 100%; }
.ear.twitch { animation: twitch .22s ease-in-out; }
.wiggle .ear { animation: wiggle .5s ease-in-out 2; }
@keyframes twitch { 50% { transform: rotate(-9deg); } }
.ear-l.twitch { animation-name: twitch-l; }
@keyframes twitch-l { 50% { transform: rotate(9deg); } }
@keyframes wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } }
.waves path { opacity: 0; }
.listening .waves path { animation: wave 1.1s ease-out infinite; }
.listening .waves path + path { animation-delay: .25s; }
@keyframes wave { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.ink-fill { fill: currentColor; }
.tip { transform-box: fill-box; transform-origin: center; animation: beacon 7s ease-in-out infinite; }
.ear-r .tip { animation-delay: .35s; }
.booth:hover .tip, .booth:focus-visible .tip { animation: beacon-fast 1s ease-in-out infinite; }
@keyframes beacon { 0%, 88%, 100% { transform: none; } 94% { transform: scale(1.6); } }
@keyframes beacon-fast { 50% { transform: scale(1.6); } }
.zzz text { font: 800 20px/1 var(--label); opacity: 0; }
.asleep .zzz text { animation: zzz 2.4s ease-in infinite; }
.asleep .zzz text:nth-child(2) { animation-delay: .8s; }
.asleep .zzz text:nth-child(3) { animation-delay: 1.6s; }
@keyframes zzz { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 50; }
/* THE BOOTH. The curtain is AUTOPHOTO red, pleated with the ink. */
.booth { position: relative; }
.curtain {
  position: absolute; inset: -3% -3% -2%; z-index: 2; pointer-events: none;
  background-color: var(--signal);
  background-image: repeating-linear-gradient(90deg, transparent 0 20px, rgba(0, 0, 0, .24) 20px 25px, transparent 25px 33px);
  border-top: 8px solid var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.6, 0, .2, 1);
}
.booth.closed .curtain { transform: scaleX(1); }
.booth.lit .curtain { filter: brightness(1.7); }
/* The strip: four frames on photo paper, black and white like a booth's. */
.strip {
  position: absolute; left: 50%; top: calc(100% - 6px); z-index: 20; width: 96px;
  display: grid; gap: 7px; padding: 8px 8px 24px; background: #fcfaf1;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .15), 0 14px 30px rgba(0, 0, 0, .28);
  transform: translate(-50%, -40px) rotate(-4deg); opacity: 0;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.strip[hidden] { display: none; }
@media (max-width: 760px) {
  /* On a phone the head sits left, so the strip drops beside it, not over the headline. */
  .strip { left: calc(100% + 58px); top: 8%; }
}
.strip.out { transform: translate(-50%, 0) rotate(-4deg); opacity: 1; }
.frame { display: block; aspect-ratio: 1; background: #000; color: #fcfaf1; padding: 5px; }
.frame svg { display: block; width: 100%; height: 100%; filter: grayscale(1); animation: develop 1.8s ease-out both; }
.frame:nth-child(2) svg { animation-delay: .25s; } .frame:nth-child(3) svg { animation-delay: .5s; } .frame:nth-child(4) svg { animation-delay: .75s; }
@keyframes develop { from { opacity: 0; filter: grayscale(1) blur(3px); } to { opacity: 1; filter: grayscale(1); } }
.frame .tip, .frame .ear, .frame .eye, .frame .waves path { animation: none; transition: none; }
.pose-wink .eye-r { transform: scaleY(.08); }
.pose-ears .ear-r { transform: rotate(-16deg); }
.pose-ears .ear-l { transform: rotate(16deg); }
.pose-wow .tip { transform: scale(1.8); }

/* companies */
.companies { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 3px solid var(--ink); max-width: 1180px; margin: 0 auto; }
@media (max-width: 760px) { .companies { grid-template-columns: 1fr; } }
.co {
  display: grid; align-content: start; gap: 14px; min-width: 0;
  padding: 28px max(24px, env(safe-area-inset-left, 0px)) 32px; text-decoration: none;
}
.co + .co { border-left: 3px solid var(--ink); }
@media (max-width: 760px) { .co + .co { border-left: 0; border-top: 3px solid var(--ink); } .co { padding-inline: max(16px, env(safe-area-inset-left, 0px)); } }
.logo { display: flex; align-items: center; height: 120px; }
.logo img { height: 100%; width: auto; max-width: 100%; display: block; }
.desc { max-width: 26em; font-size: 18px; }
.spec { font: 600 14px/1 var(--label); font-stretch: 75%; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.go { justify-self: start; font: 700 14px/1 var(--label); font-stretch: 75%; text-transform: uppercase; letter-spacing: .1em; padding: 12px 16px; border: 2px solid var(--ink); }
.co:hover .go { background: var(--yellow); color: #000; border-color: #000; }

/* contact */
.contact { background: var(--band); color: var(--on-band); margin-top: 40px; }
.contact-in { display: grid; grid-template-columns: 1fr 1.5fr; gap: 48px; padding-block: 40px 48px; }
@media (max-width: 820px) { .contact-in { grid-template-columns: 1fr; gap: 28px; } }
.contact h2 { font: 400 clamp(34px, 4.4vw, 54px)/.98 var(--headline); letter-spacing: 0; text-transform: uppercase; margin: 0 0 18px; text-wrap: balance; }
.contact-intro p { margin: 0; max-width: 22em; opacity: .85; }
.form { display: grid; gap: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font: 700 13px/1 var(--label); font-stretch: 75%; text-transform: uppercase; letter-spacing: .12em; }
.field em { font-style: normal; font-weight: 400; opacity: .7; margin-left: 6px; }
input, textarea {
  width: 100%; font: inherit; color: var(--on-band); background: transparent;
  border: 0; border-bottom: 2px solid var(--on-band); border-radius: 0; padding: 10px 0;
}
textarea { resize: vertical; min-height: 104px; border: 2px solid var(--on-band); padding: 10px 12px; }
input:focus, textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 2px 0 var(--yellow); }
.field.bad input, .field.bad textarea { border-color: var(--yellow); }
.err { font: 600 14px/1.3 var(--label); font-stretch: 75%; letter-spacing: .02em; color: #000; background: var(--yellow); padding: 4px 6px; justify-self: start; }
.err:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form button {
  justify-self: start; font: 700 15px/1 var(--label); font-stretch: 75%; text-transform: uppercase; letter-spacing: .12em;
  padding: 18px 26px; border: 0; border-radius: 0; background: var(--on-band); color: var(--band); cursor: pointer;
}
.form button:hover { background: var(--yellow); color: #000; }
.form button:disabled { opacity: .6; cursor: progress; }
.status { padding: 14px 16px; background: var(--on-band); color: var(--band); font-weight: 600; }
.status.bad { background: var(--signal); color: var(--on-band); }

/* footer */
.foot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding-block: 18px 28px; font: 600 14px/1.4 var(--label); font-stretch: 75%; text-transform: uppercase; letter-spacing: .1em; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
