/* ================================================================
   ENTRY PAGE, used only by / (index.html)
   Loaded after style.css; reuses its tokens and fonts. Nothing here
   affects any other page.
   ================================================================ */

/* The two halves of each entrance always show BOTH themes, whatever the
   page itself is rendered in, so they read the literal theme colours.
   These mirror the --bg / --text-primary / --surface tokens in style.css
   (:root and [data-effective-theme="light"]); keep them in step. */
.welcome {
  --w-light-bg:    #f5f0e8;
  --w-light-hover: #ede8de;
  --w-light-fg:    #14100a;
  --w-dark-bg:     #0d0d0d;
  --w-dark-hover:  #1c1c1c;
  --w-dark-fg:     #f0ece4;
  --w-focus:       #C5A059;
}

.welcome-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2.25rem, 7vh, 4rem);
  padding: 2.5rem var(--pad-x);
  text-align: center;
}

/* ── Name: line 1 exactly like .nav-logo strong, line 2 in IBM Plex Mono ── */
.welcome-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  font-weight: 400;
  line-height: 1.15;
}
.welcome-name-main {
  font-family: var(--font-name);
  font-weight: 400;
  font-size: clamp(1.55rem, 6.4vw, 3.1rem);
  letter-spacing: 0.14em;
  text-transform: none;             /* mixed case on purpose: Cinzel swash glyphs */
  color: var(--text-primary);
  margin-right: -0.14em;            /* optical centring: cancel trailing letter-spacing */
}
.welcome-name-sub {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(0.7rem, 1.9vw, 0.86rem);
  letter-spacing: 0.42em;
  color: var(--text-secondary);
  margin-right: -0.42em;
}

.visually-hidden {                 /* read by screen readers instead of the mixed-case display text */
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Quotation ── */
.welcome-quote {
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.welcome-quote::before {            /* thin gold rule, same gradient language as the home tagline */
  content: '';
  display: block;
  width: 3.5rem;
  height: 1px;
  margin-bottom: 0.6rem;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.welcome-quote blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 3.4vw, 1.6rem);
  line-height: 1.45;
  color: var(--text-primary);
}
.welcome-quote figcaption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}
.welcome-quote cite { font-style: italic; }

/* ── Entrances: one pill per language, left half light, right half dark ── */
.welcome-doors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.25rem;
}
.door {
  position: relative;
  display: flex;
  width: clamp(8rem, 29vw, 9.75rem);
  height: 2.25rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--btn-border);
  box-shadow: 0 6px 18px -10px rgba(0,0,0,0.45);
}
.door-half {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  overflow: hidden;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  transition: background var(--ease);
}
.door-light { background: var(--w-light-bg); color: var(--w-light-fg); }
.door-dark  { background: var(--w-dark-bg);  color: var(--w-dark-fg); }
.door-light:hover { background: var(--w-light-hover); }
.door-dark:hover  { background: var(--w-dark-hover); }
.door-half:focus-visible {
  outline: 2px solid var(--w-focus);
  outline-offset: -4px;
  border-radius: inherit;
}
.door-light:focus-visible { border-radius: 999px 0 0 999px; }
.door-dark:focus-visible  { border-radius: 0 999px 999px 0; }

/* The word is laid out across the WHOLE pill inside each half and clipped by
   the half, so it reads as one word whose colours invert at the midline. */
.door-word {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding-left: 0.28em;             /* optical centring for the trailing letter-spacing */
  pointer-events: none;
}
.door-dark .door-word { left: -100%; }

.welcome-noscript { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.12em; }
.welcome-noscript a { color: var(--text-secondary); }

/* ── Motion: gentle staggered arrival, and a fade on leaving. Opacity on the
   content only — never a transform on body. Off for reduced motion. ── */
@media (prefers-reduced-motion: no-preference) {
  .welcome-name, .welcome-quote, .welcome-doors {
    opacity: 0;
    animation: welcomeIn 1.1s ease forwards;
  }
  .welcome-quote { animation-delay: 0.45s; }
  .welcome-doors { animation-delay: 0.9s; }
  .welcome-wrap { transition: opacity 0.38s ease; }
  .welcome-wrap.leaving { opacity: 0; }
}
@keyframes welcomeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Phone and tablet type: floors, matching style.css. */
@media screen and (max-width: 960px) {
  .welcome-name-sub,
  .welcome-quote figcaption { font-size: 0.75rem; }
}
