/* Phiceti — brand foundation v1.0
   Palette, type and layout rules per §06 Visual direction. */

/* Archivo — a technical neo-grotesque with weight and width axes (§06).
   Self-hosted: the CSP allows no external hosts, and the page makes no
   network requests beyond its own origin. Licence in Archivo-OFL.txt. */
@font-face {
  font-family: Archivo;
  src: url("/assets/Archivo-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --night:   #141A2B;
  --ink:     #232B3D;
  --slate:   #6C7590;
  --gold:    #C08A2E;
  --surface: #F2F3F7;

  /* A tint of SLATE, not a sixth brand colour. SLATE itself reaches only
     3.8:1 on NIGHT, so it stays on rules and marks; secondary text uses this. */
  --slate-text: #98A0B8;

  /* Technical neo-grotesque for headlines, monospace for labels and data. */
  --sans: Archivo, "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;

  --measure: 34rem;
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--night);
  color: var(--surface);
  font-family: var(--sans);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-text);
}

/* ---------------------------------------------------------------- landing */

.landing {
  display: grid;
  /* No overflow clipping: the name disclosure can push the stage past the
     fold on a short viewport, and it has to stay scrollable when it does. */
  grid-template-rows: 1fr;
}

/* Ambient point field. Sits behind everything, never competes. */
.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2400ms ease-out;
}
.field.lit { opacity: 1; }

/* A soft depth gradient so the wordmark always sits on quiet ground. */
.landing::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Kept shallow on purpose: a wide, high-contrast gradient bands visibly
     against a dark ground, and the banding reads as an artefact. */
  background:
    radial-gradient(76% 62% at 50% 42%, rgba(35, 43, 61, 0.3) 0%, rgba(20, 26, 43, 0) 72%),
    radial-gradient(130% 100% at 50% 48%, rgba(20, 26, 43, 0) 50%, rgba(20, 26, 43, 0.55) 100%);
}

.stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 3rem 1.5rem calc(3rem + env(safe-area-inset-bottom));
  text-align: center;
}

/* The mark is the distinctive asset, so it carries the page.
   Its width is 1/φ of the wordmark's, which makes wordmark:mark exactly
   1.618:1 at every size — the constant the company is named for used as the
   measure of its own lockup, rather than drawn as a diagram (§06). */
.mark-slot {
  width: 0;
  min-width: 61.8%;
  justify-self: center;
  aspect-ratio: 1;
  margin-bottom: clamp(2.25rem, 5.5vmin, 3.5rem);
}

.mark { display: block; width: 100%; height: 100%; }

/* Set quiet: light weight, generous tracking, held small. An operating
   holding company built on patience should not open by shouting, and the
   mark above is already doing the distinguishing. The trailing text-indent
   compensates for the space letter-spacing adds after the final letter,
   which would otherwise push the word off-centre. */
.wordmark {
  margin: 0;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--surface);
}

/* The wordmark sizes the column; the rule and everything beneath it inherit
   that width, so the mark reads as one lockup rather than stacked parts.
   `width: 0; min-width: 100%` keeps a child from widening the column it fills. */
.lockup {
  display: grid;
  grid-template-columns: max-content;
  justify-content: center;
  max-width: 100%;
}

.lockup > .rule,
.lockup > .tagline,
.lockup > .name {
  width: 0;
  min-width: 100%;
}

/* The gold rule is the light. One device, whole system. (§07) */
.rule {
  width: 100%;
  height: 2px;
  margin: clamp(1.5rem, 3.5vmin, 2.25rem) 0 0;
  border: 0;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  animation: draw 1100ms cubic-bezier(0.22, 1, 0.36, 1) 700ms forwards;
}

@keyframes draw { to { transform: scaleX(1); } }

.tagline {
  margin: clamp(1.25rem, 3vmin, 1.75rem) 0 0;
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--slate-text);
  opacity: 0;
  animation: rise 1200ms ease-out 1200ms forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(0.5rem); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- the name */

.name {
  margin-top: clamp(1.75rem, 4vmin, 2.5rem);
  opacity: 0;
  animation: rise 1200ms ease-out 1500ms forwards;
}

/* Not uppercased: the capitals in FY-set-ee are carrying the stress. */
.say {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  color: var(--slate-text);
}

.roots > summary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--ink);
  list-style: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-text);
  transition: color 200ms ease, border-color 200ms ease;
}

.roots > summary::-webkit-details-marker { display: none; }

.roots > summary::after {
  content: "+";
  color: var(--gold);
}
.roots[open] > summary::after { content: "−"; }

.roots > summary:hover {
  color: var(--surface);
  border-bottom-color: var(--gold);
}

.roots-body {
  margin: 1.75rem 0 0;
  text-align: left;
  animation: rise 500ms ease-out both;
}

/* Content on hairlines rather than inside boxes. (§06) */
.root {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0 1.5rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--ink);
}
.root:last-child { border-bottom: 1px solid var(--ink); }

.root dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--surface);
}

.root dd {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--slate-text);
}

@media (max-width: 34rem) {
  .root { grid-template-columns: 1fr; gap: 0.375rem; }
}

/* ------------------------------------------------------------------ gate */

.gate {
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
}

.gate-card {
  position: relative;
  z-index: 2;
  width: min(26rem, 100%);
  text-align: left;
}

.gate-mark {
  width: 4rem;
  height: 4rem;
  margin-bottom: 2.25rem;
  display: block;
}

.gate h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--surface);
}

.gate .rule {
  width: 100%;
  margin-top: 1rem;
  animation: none;
  transform: none;
}

.gate p {
  margin: 1.25rem 0 2rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--slate-text);
}

.gate form { display: flex; flex-direction: column; gap: 0.875rem; }

.gate label { display: block; margin-bottom: 0.625rem; }

/* Content on hairlines rather than inside boxes. (§06) */
.gate input[type="password"] {
  width: 100%;
  padding: 0.75rem 0 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--surface);
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.05em;
  transition: border-color 200ms ease;
}
.gate input[type="password"]:focus {
  outline: none;
  border-bottom-color: var(--gold);
}
.gate input[type="password"]::placeholder { color: var(--slate); }

.gate button {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease;
}
.gate button:hover:not(:disabled) { background: var(--gold); color: var(--night); }
.gate button:disabled { opacity: 0.4; cursor: default; }

.gate-status {
  min-height: 1.25rem;
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.gate-foot { margin-top: 2.5rem; }
.gate-foot a { color: var(--slate-text); text-decoration: none; border-bottom: 1px solid var(--ink); }
.gate-foot a:hover { color: var(--surface); }

/* -------------------------------------------------------------- a11y */

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

@media (prefers-reduced-motion: reduce) {
  .rule, .tagline, .name, .roots-body {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .field { transition: none; }
}
