/* ============================================================
   Kintari Capital — heraldic luxury / refined minimalism
   Gold-on-void, extracted from the griffin emblem.
   ============================================================ */

:root {
  /* Palette extracted from logo.jpg */
  --void:        #050505;
  --ink:         #0c0b09;
  --gold-deep:   #8a6a2f;
  --gold:        #c9a45c;
  --gold-bright: #e6c989;
  --gold-pale:   #f0dcae;
  --parchment:   #cdbf9f;  /* muted body text */
  --parchment-dim: #8c826c;
  --ember:       #c4593c;  /* the griffin's red eye — used for errors */

  --maxw: 540px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body:    'Crimson Text', Georgia, serif;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* `safe` keeps the top reachable (no clipping) when content exceeds the viewport */
  justify-content: safe center;
  gap: clamp(2.5rem, 6vh, 4rem);
  padding: clamp(2rem, 6vw, 4rem) 1.5rem;
  background-color: var(--void);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Atmosphere ---------- */

/* Warm gold glow rising behind the emblem */
.glow {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(60% 45% at 50% 32%,
      rgba(201, 164, 92, 0.16) 0%,
      rgba(138, 106, 47, 0.07) 38%,
      transparent 70%);
  pointer-events: none;
}

/* Subtle film grain for richness */
.grain {
  position: fixed;
  inset: -50%;
  z-index: -2;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Edge vignette to deepen the void */
.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 120% at 50% 50%, transparent 55%, rgba(0,0,0,0.7) 100%);
}

/* ---------- Stage / layout ---------- */

.stage {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.5rem, 4vh, 2.25rem);
}

/* ---------- 1. Logo ---------- */

.logo {
  margin: 0;
  /* Matches the width of the KINTARI CAPITAL wordmark below it */
  width: clamp(280px, 80vw, 500px);
  filter: drop-shadow(0 0 40px rgba(201, 164, 92, 0.22));
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- 2. Heading ---------- */

.heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  /* indent compensates for trailing letter-spacing to keep optical centering */
  text-indent: 0.26em;
  background: linear-gradient(180deg, var(--gold-pale) 0%, var(--gold) 52%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Hairline rule ---------- */

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: min(280px, 70%);
  color: var(--gold-deep);
}

.rule__line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-deep));
}
.rule__line:last-child {
  background: linear-gradient(90deg, var(--gold-deep), transparent);
}

.rule__mark {
  font-size: 0.7rem;
  color: var(--gold);
  line-height: 1;
}

/* ---------- 3. Sub-heading ---------- */

.subheading {
  margin: 0;
  max-width: 42ch;
  font-size: clamp(1.05rem, 2.6vw, 1.28rem);
  line-height: 1.7;
  color: var(--parchment);
  font-weight: 400;
}

/* ---------- 4. Login form ---------- */

.login {
  margin-top: clamp(0.5rem, 2vh, 1rem);
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
}

.login__input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--gold-deep);
  color: var(--gold-pale);
  font-family: var(--font-body);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-align: center;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease),
              background-color 0.4s var(--ease);
}

.login__input::placeholder {
  color: var(--parchment-dim);
  letter-spacing: 0.25em;
}

.login__input:focus {
  outline: none;
  border-color: var(--gold-bright);
  background-color: rgba(201, 164, 92, 0.06);
  box-shadow: 0 0 0 1px var(--gold-bright), 0 10px 30px -18px var(--gold);
}

.login__button {
  align-self: center;
  margin-top: 0.25rem;
  padding: 0.6rem 2.4rem;
  background-color: var(--gold);
  border: 1px solid var(--gold);
  color: var(--void);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
              color 0.35s var(--ease);
}

.login__button:hover,
.login__button:focus-visible {
  outline: none;
  background-color: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--void);
}

.login__button:active {
  transform: translateY(1px);
}

/* The pseudo error message */
.login__message {
  margin: 0;
  min-height: 1.2em;       /* reserve space so layout doesn't jump */
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--ember);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.login__message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* nudge animation when an attempt is made */
.login.shake {
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-7px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(2px); }
}

/* ---------- 5. Footer ---------- */

.footer {
  /* padding (not margin) so the gap is part of the footer's box and
     counted in scroll height — flex containers clip end margin/padding */
  padding-bottom: clamp(1.5rem, 5vh, 3rem);
  max-width: var(--maxw);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--parchment-dim);
}

.footer__dot { color: var(--gold-deep); }

.footer__link {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.footer__link:hover,
.footer__link:focus-visible {
  outline: none;
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

/* ---------- Entrance choreography ---------- */

/* Resting state is VISIBLE. The hidden start lives in the keyframes and is
   applied during the delay via `both` (backwards) fill. This is deliberate:
   if the element's *visibility* depended on the animation's forwards fill,
   then anything that later overrides `animation` (e.g. .login.shake) would
   drop that fill and snap the element back to opacity:0 — which previously
   made the form disappear on submit on browsers with animations enabled. */
.reveal {
  animation: rise 1s var(--ease) both;
  animation-delay: var(--d, 0ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; }   /* base state is already visible */
  .login.shake { animation: none; }
  .login__input, .login__button, .login__message, .footer__link { transition: none; }
}
