/* closd.org while the site is held back: one screen, the CLOSD ring as a lit object (soon.js), nothing else to read.
   Fonts and colours are the site's (assets/site.css, brand/tokens.css); this page loads no other stylesheet. */

@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/outfit-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: optional;
}
@font-face {
  font-family: "Outfit Fallback";
  src: local("Arial");
  size-adjust: 100.16%;
  ascent-override: 99.84%;
  descent-override: 25.96%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.48%;
  ascent-override: 90.14%;
  descent-override: 22.44%;
  line-gap-override: 0%;
}

:root {
  --ink: #0C1411;
  --emerald: #059669;
  --paper: #F5F4EE;
  --muted: #5B6460;
  --line: #E3E1D8;
  --brand: "Outfit", "Outfit Fallback", system-ui, sans-serif;
  --ui: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

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

html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* The canvas lies under the page and draws only the ring, its shadow on the paper and the seat's light. */
.ring-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease-out;
}
.is-3d .ring-canvas { opacity: 1; }

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding:
    max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}
@media (min-width: 48em) {
  .page { padding: 2rem 2.5rem; }
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mark { display: inline-flex; padding: 0.375rem 0; border-radius: 4px; }
.mark img { display: block; width: 6.5rem; height: auto; }

.bar a {
  color: var(--ink);
  text-decoration: none;
}
.mail,
.foot a {
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-radius: 4px;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 0.375rem) / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease-out);
}
.mail:hover,
.foot a:hover { background-size: 100% 1px; }

.foot { color: var(--muted); font-size: 0.875rem; flex-wrap: wrap; row-gap: 0.25rem; }
.foot nav { display: flex; gap: 1.5rem; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

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

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.75rem, 4vh, 3rem);
  padding-block: clamp(1rem, 4vh, 3rem);
  text-align: center;
}

/* The ring's place on the page: soon.js draws the ring so that its outer edge meets this circle.
   Without WebGL (or scripts) the flat symbol stands in it. */
.ring-slot {
  width: min(40vh, 70vw, 30rem); /* 40vh (was 52): the page stays one screen with the line on what CLOSD does */
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font: inherit;
  cursor: default;
}
.ring-slot:enabled { cursor: pointer; }
.ring-slot:focus-visible { outline-offset: 0.75rem; }
/* The flat ring waits a moment, so the 3D ring's entrance doesn't start from a ring already on screen. */
.ring-flat {
  display: block;
  width: 100%;
  height: auto;
  animation: appear 0.6s ease-out 1s both;
}
.is-3d .ring-flat { animation: none; opacity: 0; transition: opacity 0.4s ease-out; }

.copy h1 {
  margin: 0;
  font: 600 clamp(2.25rem, 1.5rem + 2.4vw, 3.5rem)/1.05 var(--brand);
  letter-spacing: -0.03em;
}
.copy p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  letter-spacing: -0.005em;
}
/* What CLOSD does, for a visitor and for Google's OAuth review (the homepage must describe the app). */
.copy .about {
  max-width: 36rem;
  margin: 1rem auto 0;
  font-size: 0.875rem;
  line-height: 1.55;
  letter-spacing: 0;
  text-wrap: pretty;
}
.about a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--emerald);
  text-underline-offset: 0.2em;
}

/* The words come in as the piece seats (about 1.5 s in, soon.js's timing); CSS alone, so they never wait on a script. */
.copy { animation: rise 1.1s var(--ease-out) 1.45s both; }

@keyframes appear { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(0.75rem); } }

@media (prefers-reduced-motion: reduce) {
  .copy, .ring-flat { animation: none; }
  .ring-canvas, .is-3d .ring-flat { transition: none; }
}

@media (max-height: 34em) and (orientation: landscape) {
  .stage { flex-direction: row; gap: 2.5rem; text-align: left; }
  .copy .about { margin-inline: 0; }
  .ring-slot { width: min(58vh, 40vw); }
}
