/* AEMOTA site styles. Plain CSS, no build step. */

@font-face {
  font-family: "Riviera Nights";
  src: url("../fonts/riviera/RivieraNights-Regular-WebS.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Riviera Nights";
  src: url("../fonts/riviera/RivieraNights-RegularItalic-WebS.woff") format("woff");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Riviera Nights";
  src: url("../fonts/riviera/RivieraNights-Light-WebS.woff") format("woff");
  font-weight: 300; font-style: normal; font-display: swap;
}

:root {
  --red: #A80000;
  --ink: #3a2a2a;
  --charcoal: #333;
  --ground: #E9DFDB;
  --lw: min(600px, 80vw);            /* logo video width; JS refines it */
}

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
/* no selecting, no callouts, no dragging; zoom stays available */
html { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img, video, canvas { -webkit-user-drag: none; user-drag: none; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Riviera Nights", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
}
p, ul { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--red); outline-offset: 6px; }

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

/* Pink textured ground, fixed behind everything (also under the iPhone bars). */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background: var(--ground) url("../img/BACKGROUND.jpg") center / cover no-repeat;
}

/* ---------- Logo: the 600x450 video, cropped to the visible mark (y 54..378) ---------- */
.logo {
  position: relative;
  width: var(--lw);
  height: calc(var(--lw) * 324 / 600);
  overflow: hidden;
  margin: 0 auto;
}
.logo > * {
  position: absolute; left: 0;
  top: calc(var(--lw) * -54 / 600);
  width: var(--lw); height: calc(var(--lw) * 450 / 600);
  display: block;
}
.logo video { opacity: 0; }
.logo video.on { opacity: 1; }
.logo-canvas { display: none; }
.logo.packed .logo-canvas { display: block; }
.logo.packed video {                    /* tiny but on screen: Safari pauses hidden videos */
  width: 2px; height: 2px; top: 0; opacity: 0.01;
}
.logo-still { opacity: 1; }
.js .logo-still { opacity: 0; transition: opacity 1.2s ease; }
.js .logo.still .logo-still { opacity: 1; }

/* ---------- Menu ---------- */
.menu ul { list-style: none; text-align: center; }
.menu li { margin: 0; }
.menu a {
  display: inline-block;
  padding: 0.5em 0.4em;
  font-size: var(--mfs, 16px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--red);
  margin-right: -0.32em;           /* optical centring of the tracked caps */
  transition: opacity .25s ease;
}
@media (hover: hover) { .menu a:hover { opacity: .6; } }

/* ---------- Footer ---------- */
.foot {
  text-align: center;
  color: var(--red);
  font-size: var(--ffs, 16px);     /* 16px as today on desktop; smaller on phones */
  line-height: normal;             /* as today */
}
.foot a { color: var(--red); }
@media (hover: hover) { .foot a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.zip { word-spacing: 0.15em; }       /* a little air before the ZIP; keeps one underline */

/* ---------- Scroll cue ---------- */
.cue {
  display: none;
  appearance: none; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.cue-line {
  position: absolute; left: 50%; top: 0;
  width: 2px; height: 2px; border-radius: 1px;
  margin-left: -1px;
  background: rgba(51, 51, 51, 0.25);
  overflow: hidden;
}
.cue.live .cue-line::after {
  content: ""; position: absolute; left: 0; top: -40%;
  width: 100%; height: 40%;
  background: var(--red);
  animation: cue-drop 2.6s cubic-bezier(.45, 0, .25, 1) infinite;
}
@keyframes cue-drop {
  0%   { top: -40%; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ---------- Without JavaScript: everything simply stacked ---------- */
html:not(.js) .stage {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 48px;
  padding: 48px 16px;
}

/* ---------- With JavaScript: one screen, two states (opening, menu) ---------- */
.js, .js body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.js .stage {
  position: relative;
  height: var(--vh, 100vh);
  overflow: hidden;
  touch-action: pinch-zoom;
}
.js .logo, .js .menu, .js .foot, .js .cue {
  position: absolute; left: 0; right: 0; top: 0;
}
.js .logo { will-change: transform; }
.js .logo { left: 50%; right: auto; margin: 0 0 0 calc(var(--lw) / -2); transform-origin: 50% 0; }
.js .foot { transform-origin: 50% 0; }
.js .foot p { opacity: 0; transition: opacity 1.25s cubic-bezier(.42, 0, .58, 1); }   /* as the wordmark */
.js .foot.in p { opacity: 1; }
.js .cue { display: block; width: 56px; margin: 0 auto; opacity: var(--cue-o, 0); }
.js .menu li { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .js .logo-still { transition: none; }
}

.phone .menu li { display: flex; justify-content: center; }
.phone .menu a { padding-top: 0.265em; padding-bottom: 0.265em; }

/* ---------- Windows too short, phones held sideways ---------- */
.notice { display: none; }
@media (max-height: 549px) and (pointer: fine),
       (max-width: 499px) and (pointer: fine),
       (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .js .stage, .js .panel { display: none; }
  .notice {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; padding: 24px;
    text-align: center; color: var(--red);
    font-size: 15px; letter-spacing: 0.32em; text-transform: uppercase;
  }
  .notice p { margin-right: -0.32em; }
  .notice .landscape { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .notice { font-size: 13px; }
  .notice .short { display: none; }
  .notice .landscape { display: inline; }
}

/* ---------- Inner pages: seal, title and footer stay; the text scrolls ---------- */
.page { animation: page-in 1.25s cubic-bezier(.42, 0, .58, 1) both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* One unit for the whole sheet, the same scale as the home page on desktop:
   1 px in a window 1000 px tall and 900 px wide or more, smaller below.
   The title equals the menu word (16 units); the rest follows it.
   G is the space between seal and title, title and text, text and footer.  */
.sheet {
  --u: min(1px, 0.1vh, 0.11111vw);
  --ts: calc(16 * var(--u));           /* title = menu word */
  --bs: calc(17 * var(--u));           /* text */
  --fs: calc(12 * var(--u));           /* footer, as with the menu open */
  --S: calc(116 * var(--u));           /* seal */
  --G: calc(40 * var(--u));
  --top: calc(48 * var(--u));
  --ta: calc(582 * var(--u));
  --gb: calc(2 * var(--G));            /* last line to footer */
  --gx: var(--G);                      /* side margins */
  --bot: calc(28 * var(--u));
  position: fixed; inset: 0;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(var(--top), env(safe-area-inset-top)) 0 max(var(--bot), env(safe-area-inset-bottom));
}
@media (max-width: 599px) and (pointer: coarse) {
  .sheet {
    /* text and seal keep their size; the spacing follows the visible
       height (in Safari it is far less than the screen), so the text keeps
       the share of the frame it has on desktop */
    --pv: min(1px, 100dvh / 874);
    --ts: 11px; --bs: 12.5px; --fs: 9px; --S: 92px;
    --G: calc(34 * var(--pv)); --gx: 34px;
    --top: calc(36 * var(--pv)); --bot: calc(28 * var(--pv)); --ta: 452px;
  }
}
.js .sheet { height: var(--vh, 100dvh); }
.sheet-seal { flex: none; width: var(--S); height: var(--S); }

.page-title, .page-nav {
  flex: none;
  /* seal ring to capitals = G (ring sits 3% inside the seal box; caps start 0.24 em into the line) */
  margin: calc(var(--G) - 0.24 * var(--ts) - 0.03 * var(--S)) -0.32em 0 0;
  text-align: center;
  font-weight: 400; font-size: var(--ts);
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--red);
}
/* the four sections in a row; the one you are on is solid */
.page-nav { display: flex; justify-content: center; gap: 1.7em; margin-right: 0; }
.page-nav a { margin-right: -0.32em; opacity: .3; transition: opacity .6s cubic-bezier(.42, 0, .58, 1); }
.page-nav a[aria-current] { opacity: 1; }
@media (hover: hover) { .page-nav a:not([aria-current]):hover, .js .panel.nav-on .page-nav a:not([aria-current]):hover { opacity: .65; } }
@media (max-width: 599px) and (pointer: coarse) { .page-nav { gap: 1.25em; } }

.sheet-scroll {
  flex: 0 1 auto; min-height: 0; width: 100%;
  height: var(--ta);                                 /* About's text height: the same frame on every page */
  max-width: calc(31 * var(--bs) + 2 * var(--gx));    /* the text column; outside it, scrolling changes section */
  /* title capitals to first line = G. The text fades only once it has
     scrolled (site.js sets --mt / --mb), so it never comes closer than G. */
  margin-top: calc(var(--G) - 0.28 * var(--ts) - 0.435 * var(--bs));
  padding: 0 var(--gx);
  overflow-y: auto;
  touch-action: pinch-zoom;
  outline: none;
  -webkit-mask-image: linear-gradient(transparent, #000 var(--mt, 0px), #000 calc(100% - var(--mb, 0px)), transparent);
          mask-image: linear-gradient(transparent, #000 var(--mt, 0px), #000 calc(100% - var(--mb, 0px)), transparent);
}

/* scroll indicator, drawn like the cue: a faint line, the red drop marks where you are */
.sheet-bar {
  position: absolute; z-index: 4;
  width: 21px; margin-left: -10px;                   /* wide enough to grab */
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
  touch-action: none; cursor: default;
}
.sheet-bar::before, .sheet-bar i {
  content: ""; position: absolute; left: 50%;
  width: var(--bw, 2px); margin-left: calc(var(--bw, 2px) / -2);
  border-radius: 1px;
}
.sheet-bar::before { top: 0; bottom: 0; background: rgba(51, 51, 51, 0.1); }
.sheet-bar i { top: 0; height: 24px; background: var(--red); }
.sheet-bar.on { opacity: 1; pointer-events: auto; transition: opacity 1s cubic-bezier(.42, 0, .58, 1) .5s; }
.js .panel:not(.in) .sheet-bar.on { opacity: 0; pointer-events: none; transition: opacity .35s ease; }
@media (max-width: 599px) and (pointer: coarse) {
  .sheet-bar { --bw: 1px; }
  .page-body { hyphens: auto; -webkit-hyphens: auto; }
}

.page-body {
  max-width: 31em; margin: 0 auto;
  font-size: var(--bs); line-height: 1.7;
  color: var(--ink);
  text-wrap: wrap;                                   /* each line filled to the end */
  position: relative;                                /* lines measure from here */
}
.page-body > * + * { margin-top: 1.1em; }

/* last line to footer capitals = G at least */
.sheet-foot {
  flex: none; font-size: var(--fs);
  margin-top: calc(var(--gb) - 0.475 * var(--bs) - 0.24 * var(--fs));
}

/* text rises in, block by block, as the menu does */
.page .page-body > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.page .page-body > :nth-child(1) { animation-delay: .35s; }
.page .page-body > :nth-child(2) { animation-delay: .44s; }
.page .page-body > :nth-child(3) { animation-delay: .53s; }
.page .page-body > :nth-child(4) { animation-delay: .62s; }
.page .page-body > :nth-child(5) { animation-delay: .71s; }
.page .page-body > :nth-child(6) { animation-delay: .80s; }
.page .page-body > :nth-child(n+7) { animation-delay: .89s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* on the home page the same sheet sits over the stage; the logo, the menu
   word and the footer travel into its empty slots */
.js .panel { z-index: 2; pointer-events: none; }
.js .panel[hidden] { display: none; }
.js .sheet-scroll { overflow: hidden; }            /* scrolled by site.js */
.js .panel .sheet-scroll { pointer-events: auto; }
.js .panel.closing * { pointer-events: none !important; }
.js .panel .sheet-foot { visibility: hidden; }
.js .panel .page-nav a { opacity: 0; transition: opacity .3s ease; }
.js .panel.nav-on .page-nav { pointer-events: auto; }
.js .panel.nav-on .page-nav a { opacity: .3; transition: opacity .8s cubic-bezier(.42, 0, .58, 1); }
.js .panel.nav-on .page-nav a[aria-current] { opacity: 1; }
.page .page-nav a { animation: word-in .8s cubic-bezier(.42, 0, .58, 1) both; }
.page .page-nav a:nth-child(1) { animation-delay: .25s; }
.page .page-nav a:nth-child(2) { animation-delay: .36s; }
.page .page-nav a:nth-child(3) { animation-delay: .47s; }
.page .page-nav a:nth-child(4) { animation-delay: .58s; }
@keyframes word-in { from { opacity: 0; } }
.js .panel .page-body > * {
  opacity: 0; transform: translateY(12px);
  transition: opacity .8s cubic-bezier(.42, 0, .58, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
}
.js .panel:not(.in):not(.out) .page-body > * {
  transition-duration: .25s; transition-delay: 0s !important;
}
.js .panel.out .page-body > * {                /* leaves in place, from the top down */
  opacity: 0; transform: none;
  transition: opacity .4s cubic-bezier(.42, 0, .58, 1);
}
.js .panel.in .page-body > * { opacity: 1; transform: none; }
.reading .foot, .reading .logo { z-index: 3; }
.reading .logo { pointer-events: none; }            /* its box covers the row of sections */
.js .panel .sheet-seal { pointer-events: auto; cursor: pointer; }

}

@media (prefers-reduced-motion: reduce) {
  .page, .page .page-body > * { animation-duration: .01s; animation-delay: 0s; }
}

.nw { white-space: nowrap; }

/* ---------- Seal on inner pages ---------- */
.page-seal {
  display: block; position: relative;
  width: var(--S, 116px); height: var(--S, 116px);
}
.page-seal > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.page-seal video, .page-seal canvas { opacity: 0; }
.page-seal.video video { opacity: 1; }
.page-seal.video img, .page-seal.packed img { opacity: 0; }
.page-seal.packed canvas { opacity: 1; }
.page-seal.packed video { width: 2px; height: 2px; opacity: .01; }

/* ---------- Legal text ---------- */
.legal h2 {
  margin: 2.6em 0 .9em;
  font-weight: 400; font-size: calc(var(--ts) * 0.8);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--red);
}
.legal em { font-style: normal; color: var(--red); }
.legal a { color: var(--red); }
.legal a:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal-date { font-size: .85em; opacity: .75; }

.js .sheet .sheet-foot { position: static; transform: none; }

/* ---------- Work and Contact ---------- */
.entries > * + * { margin-top: 2.2em; }
.entry-meta {
  font-size: calc(var(--ts) * 0.8);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--red);
}
.entry-title { margin: .5em 0 .25em; font-weight: 400; font-size: 1em; }
.contact {                                  /* centred in the frame, both ways */
  text-align: center;
  min-height: 100%;
  display: flex; flex-direction: column; justify-content: center;
}
.contact dt {
  font-size: calc(var(--ts) * 0.8);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--red);
}
.contact dd { margin: .45em 0 0; }
.contact dd + dt { margin-top: 2em; }
.contact a { color: var(--ink); }
@media (hover: hover) { .contact a:hover { color: var(--red); } }

/* a quiet heading inside About */
.about-h {
  margin: 2.4em 0 0; font-weight: 400;
  font-size: calc(var(--ts) * 0.8);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--red);
}
.about-h + p { margin-top: .9em; }
.page-body em { font-style: italic; }

.sheet-scroll.held { cursor: grabbing; }

/* one rendered line of text (site.js); it softens at the edges */
.ln {
  display: block; white-space: nowrap;
  -webkit-hyphens: manual; hyphens: manual;
  transform-origin: 0 0;
}
.ln.soft, .ln.soft * {                       /* Safari: softened by its own shadow */
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 var(--r, 0) currentColor;
}

/* cookie question (consent.js): only where it must be asked */
.consent {
  position: fixed; z-index: 40; right: 24px; bottom: 24px;
  width: 300px; padding: 16px 20px 14px;
  font-size: 12px; line-height: 1.6; color: var(--ink);
  background: rgba(238, 227, 227, 0.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(58, 42, 42, 0.06), 0 10px 32px rgba(58, 42, 42, 0.10);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .8s cubic-bezier(.42, 0, .58, 1), transform .8s cubic-bezier(.42, 0, .58, 1);
}
.consent.on { opacity: 1; transform: none; pointer-events: auto; }
.consent p { margin: 0; }
.consent-act { display: flex; align-items: baseline; gap: 1.6em; margin-top: 10px !important; }
.consent button, .legal button.link {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
}
.consent button {
  font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--red);
}
.consent a { margin-left: auto; font-size: 10.5px; letter-spacing: 0.28em; text-transform: uppercase; opacity: .5; }
@media (hover: hover) { .consent button:hover, .consent a:hover { opacity: .65; } }
.legal button.link { text-decoration: underline; text-underline-offset: 0.15em; }
@media (max-width: 599px) and (pointer: coarse) {
  .consent { left: 16px; right: 16px; width: auto; bottom: max(16px, env(safe-area-inset-bottom)); }
}
/* the Privacy line about changing the choice is for visitors in Europe */
.europe-only { display: none; }
.europe .europe-only { display: block; }

/* previews and test folders only (consent.js): try either visitor */
.visitor-test {
  position: fixed; z-index: 41; top: 12px; left: 14px; margin: 0;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); opacity: .55;
}
.visitor-test button { font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 0; cursor: pointer; opacity: .6; }
.visitor-test button.on { color: var(--red); opacity: 1; }

/* a section opened directly: the home page, already open on it; the seal
   fades in when its video can play, however late that is */
.js .landed { animation: page-in 1.25s cubic-bezier(.42, 0, .58, 1) both; }
.js .landed .logo { opacity: 0; transition: opacity 1.25s cubic-bezier(.42, 0, .58, 1); }
.js .landed .logo.ready { opacity: 1; }
html:not(.js) .landed .stage { display: none; }      /* without script: the plain page */
.sheet-seal img { display: block; width: 100%; height: auto; }
.js .panel .sheet-seal img { display: none; }
