@import url("fonts.css");

:root {
  --paper: #e9e5df;
  --ink: #111716;
  --petrol: #173d40;
  color-scheme: light;
  font: 400 100%/1.45 var(--font-text);
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
.stage { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; }
.composition { position: relative; isolation: isolate; container-type: inline-size; width: min(100%, 177.77778svh); aspect-ratio: 16 / 9; }
.scene { position: relative; width: 100%; aspect-ratio: 16 / 9; object-position: center; }
.scene > :is(img, video) { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: inherit; }
.scene video { opacity: 0; pointer-events: none; }
.scene.is-playing video { opacity: 1; }
.access { position: absolute; inset: max(1.15rem, env(safe-area-inset-top)) clamp(1.2rem, 4.4vw, 6rem) auto auto; z-index: 1; }
.access a { display: inline-grid; place-items: center; min-height: 44px; padding-inline: .55rem; color: var(--ink); letter-spacing: .035em; font-size: .98rem; font-weight: 400; text-decoration: none; }
.access a:hover { text-decoration: underline; text-underline-offset: .28em; }
.identity, .motto { position: absolute; left: 5.55%; z-index: 1; margin: 0; white-space: nowrap; }
.identity { top: 24%; }
.identity h1 { margin: 0; font: 400 6.4cqw/1 var(--font-brand); font-synthesis: none; }
.identity p { margin: .65cqw 0 0; font: 400 1.69cqw/1.3 var(--font-text); letter-spacing: .39em; text-transform: uppercase; }
.motto { top: 55%; font-size: 2.9cqw; font-family: var(--font-heading); font-weight: 400; letter-spacing: .025em; line-height: 1.12; }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .preparing :is(.scene,.identity,.motto) { opacity: 0; }
  .revealing .scene { animation: reveal .85s ease-out both; }
  .revealing .identity { animation: reveal .8s .85s ease-out both; }
  .revealing .motto { animation: reveal .8s 1.65s ease-out both; }
  @keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
}
@media (max-width: 640px) {
  .stage { padding-block: 4.5rem 2rem; }
  .composition { width: 100%; aspect-ratio: auto; display: grid; gap: 4vw; }
  .identity, .motto { position: static; margin-inline: 7%; }
  .identity h1 { font-size: 11.5cqw; }
  .identity p { margin-top: 1.1cqw; font-size: 3.05cqw; }
  .scene { aspect-ratio: 6 / 5; object-position: right; mask-image: linear-gradient(to bottom, transparent, black 9%, black 89%, transparent); }
  .motto { font-size: 6.3cqw; }
}
dialog {
  position: fixed; inset: 0; margin: auto;
  width: min(24rem, calc(100% - 2rem)); max-width: none; height: fit-content;
  min-height: min(24rem, calc(100vw - 2rem), calc(100dvh - 1rem)); max-height: none;
  padding: clamp(1.25rem, 4vw, 1.75rem); overflow: visible;
  border: 1px solid #c6c9c0; border-radius: 2px; box-shadow: 0 12px 42px #0717152b;
  color: var(--ink); background: #f7f6f0;
}
dialog[open] { display: flex; flex-direction: column; justify-content: safe center; }
dialog::backdrop { background: rgb(13 24 23 / 62%); }
@media (prefers-reduced-motion: no-preference) {
  dialog:modal { animation: login-panel-in .34s ease-out both; }
  dialog:modal::backdrop { animation: login-shade-in .32s ease-out both; }
  @keyframes login-panel-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes login-shade-in { from { background-color: transparent; } to { background-color: rgb(13 24 23 / 62%); } }
}
body:has(dialog[open]) { overflow: hidden; }
body:has(dialog[open]:not(:modal))::before { content: ""; position: fixed; inset: 0; background: rgb(8 18 19 / 59%); z-index: 1; }
dialog[open]:not(:modal) { z-index: 2; }
.form-signature { font: 400 1.05rem/1 var(--font-brand); color: var(--petrol); }
dialog h2 { margin: 1.4rem 0 1.2rem; font-size: clamp(1.45rem, 4vw, 1.9rem); line-height: 1.12; font-family: var(--font-heading); letter-spacing: .035em; font-weight: 400; }
dialog form, dialog label { display: grid; }
dialog form { gap: .85rem; }
dialog label { gap: .12rem; font-size: .88rem; color: #3e514e; }
dialog input, dialog button { min-width: 0; width: 100%; border-radius: 0; font: inherit; }
dialog input { border: 0; border-bottom: 1px solid #86948e; padding: .38rem 0; background: transparent; color: var(--ink); font-size: 1rem; }
dialog input:focus { outline: none; box-shadow: 0 1px var(--petrol); border-color: var(--petrol); }
dialog button { min-height: 2.75rem; margin-top: .4rem; background: var(--petrol); color: white; border: none; cursor: pointer; font-weight: 500; }
dialog button:hover { background: #245456; }
.close { position: absolute; top: .3rem; right: .3rem; width: 2.75rem; height: 2.75rem; }
.close::before, .close::after { content: ""; position: absolute; top: 50%; left: 30%; width: 40%; height: 1.5px; background: currentColor; color: var(--ink); transform: rotate(45deg); }
.close::after { transform: rotate(-45deg); }
.error { color: #853726; font-size: .88rem; margin: 0; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.login-links a { color: var(--petrol); font-size: .88rem; text-decoration: none; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 3px; }
@media (max-height: 440px) {
  dialog { min-height: 0; padding-block: 1rem; }
  dialog h2 { margin: .6rem 0 .75rem; }
  dialog form { gap: .55rem; }
  .login-links { margin-top: .65rem; }
}
@media (max-height: 375px) {
  dialog { width: min(29rem, calc(100% - 1rem)); padding: .8rem 1rem; }
  .form-signature { display: none; }
  dialog h2 { margin: 0 2rem .65rem 0; font-size: 1.35rem; }
  dialog form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog form :is(.error,button) { grid-column: 1 / -1; }
  dialog button { margin: 0; min-height: 2.35rem; }
}
@media (max-height: 250px) {
  dialog { padding-block: .4rem; }
  dialog h2 { margin-bottom: .3rem; }
  dialog form { gap: .3rem .55rem; align-items: end; line-height: 1.2; }
  dialog input { padding-block: .18rem; }
  .login-links { margin-top: .3rem; }
}
