/*
 * Tipple — the welcome page at tipple.sg/
 *
 * Loads after styles.css and uses its tokens. THE TOKEN RULE STILL APPLIES:
 * every colour, size and space below the :root block is a var(). The :root
 * block holds only what this page needs and styles.css does not have. The
 * literals left below are the geometry of light and motion: shadow blurs,
 * a hairline width, how far a door lifts.
 *
 * WHY THE DOORS LOOK LIKE CARDS. styles.css says the site has no cards: a
 * website is built from type and rules, not app chrome. This page is the
 * exception on purpose. It is a choice of three, not a page to read, and three
 * arched doors lit from below is the whole idea. Nothing else on the site
 * should copy them.
 *
 * DARK ONLY, like the rest of tipple.sg.
 */

:root {
  /* palette.blue500, member blue. Members' door only. */
  --blue-500: #88ccf1;

  /* Light. Each is a brand colour at low alpha; none is a foreground. */
  --glow-amber: rgba(255, 167, 55, 0.32);
  --glow-amber-soft: rgba(255, 167, 55, 0.16);
  --glow-amber-faint: rgba(255, 167, 55, 0.06);
  --glow-amber-edge: rgba(255, 167, 55, 0.28);
  --glow-amber-sign: rgba(255, 167, 55, 0.55);
  --glow-amber-far: rgba(255, 167, 55, 0.35);
  --glow-cream: rgba(255, 209, 153, 0.9);
  --glow-pointer: rgba(255, 209, 153, 0.07);
  --glow-blue: rgba(136, 204, 241, 0.28);
  --glow-blue-faint: rgba(136, 204, 241, 0.07);
  --glow-white: rgba(239, 239, 239, 0.14);

  /* Hairlines on the dark */
  --line-faint: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.3);
  --door-floor: #18181c; /* between --void and --abyss: the bottom of a door */

  --serif: 'Instrument Serif', Georgia, serif;

  /* web only — this page's display sizes */
  --text-door: clamp(26px, 2.8vw, 34px);
  --text-door-phone: 26px;
  --text-numeral: clamp(56px, 6.5vw, 88px);
  --text-tagline: clamp(17px, 2.2vw, 21px);
  --logo-width: min(360px, 66vw);

  --door-height: 400px;
  --door-height-tall: 456px;
  --door-gap: clamp(14px, 2.4vw, 28px);
  --hero-top: clamp(24px, 5vh, 64px);
  --hero-bottom: clamp(28px, 5vh, 52px);
  --foot-top: clamp(28px, 6vh, 56px);
  --door-pad: clamp(20px, 2.4vw, 32px);
  --door-numeral-top: 44px;
  --door-inset: 10px;
  --door-inset-phone: 6px;
  --door-lift: -8px;
  --radius-arch: 999px 999px 22px 22px;
  --radius-door-phone: 22px;
  --radius-door-phone-inner: 17px;
  --dot: 7px;
  --pointer-light: 420px;
  --page-wide: 1180px;
  --grain-opacity: 0.09;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.welcome__haze,
.welcome__spot,
.welcome__grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.welcome__haze {
  background:
    radial-gradient(60% 45% at 50% 0%, var(--glow-amber-soft), transparent 70%),
    radial-gradient(40% 35% at 10% 100%, var(--glow-blue-faint), transparent 70%),
    radial-gradient(40% 35% at 90% 100%, var(--glow-amber-faint), transparent 70%);
}

.welcome__spot {
  background: radial-gradient(
    var(--pointer-light) circle at var(--pointer-x, 50%) var(--pointer-y, 30%),
    var(--glow-pointer),
    transparent 60%
  );
}

.welcome__grain {
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.welcome__page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: var(--page-wide);
  margin: 0 auto;
  padding: var(--space-xl) clamp(var(--space-base), 4vw, var(--space-xxxl));
}

.welcome a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------- */
/* Top bar                                                                */
/* --------------------------------------------------------------------- */

.welcome__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.welcome__live {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.welcome__dot {
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 0 var(--space-md) var(--amber-500);
  animation: welcome-pulse 2.4s ease-in-out infinite;
}

@keyframes welcome-pulse {
  50% {
    opacity: 0.35;
  }
}

/* --------------------------------------------------------------------- */
/* Hero: the sign switching on                                            */
/* --------------------------------------------------------------------- */

.welcome__hero {
  text-align: center;
  padding: var(--hero-top) 0 var(--hero-bottom);
}

.welcome__logo {
  display: inline-block;
  width: var(--logo-width);
  height: auto;
  filter: drop-shadow(0 0 2px var(--glow-cream)) drop-shadow(0 0 14px var(--glow-amber-sign))
    drop-shadow(0 0 42px var(--glow-amber-far));
  animation: welcome-neon 2.2s steps(1) both;
}

/* The sign stuttering on, then holding. */
@keyframes welcome-neon {
  0% {
    opacity: 0.08;
    filter: none;
  }
  8% {
    opacity: 1;
  }
  10% {
    opacity: 0.15;
    filter: none;
  }
  22% {
    opacity: 1;
  }
  24% {
    opacity: 0.3;
    filter: none;
  }
  28% {
    opacity: 1;
  }
  54% {
    opacity: 0.55;
  }
  56%,
  100% {
    opacity: 1;
  }
}

.welcome__tagline {
  margin-top: var(--space-xl);
  font-size: var(--text-tagline);
  color: var(--text-primary);
  animation: welcome-rise 0.8s 1.4s ease-out both;
}

.welcome__tagline em,
.door__title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.welcome__tagline em {
  font-size: 1.25em;
  line-height: 1;
  color: var(--amber-300);
}

.welcome__prompt {
  margin-top: var(--space-sm);
  font-size: var(--text-caption);
  color: var(--text-secondary);
  animation: welcome-rise 0.8s 1.6s ease-out both;
}

@keyframes welcome-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------- */
/* The three doors                                                        */
/* --------------------------------------------------------------------- */

.doors {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  align-items: end;
  gap: var(--door-gap);
}

.door {
  --accent: var(--text-hero);
  --glow: var(--glow-white);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: var(--door-height);
  padding: var(--space-xxl) var(--door-pad);
  border-radius: var(--radius-arch);
  background: linear-gradient(180deg, var(--abyss) 0%, var(--door-floor) 100%);
  border: 1px solid var(--line-faint);
  overflow: hidden;
  font-size: var(--text-body);
  animation: welcome-rise 0.9s ease-out both;
  transition:
    transform 0.5s var(--ease-out),
    border-color 0.4s,
    box-shadow 0.5s;
}

.door:nth-child(1) {
  animation-delay: 1.8s;
}

.door:nth-child(2) {
  animation-delay: 1.95s;
  min-height: var(--door-height-tall);
}

.door:nth-child(3) {
  animation-delay: 2.1s;
}

.door--members {
  --accent: var(--blue-500);
  --glow: var(--glow-blue);
}

.door--venues {
  --accent: var(--amber-500);
  --glow: var(--glow-amber);
  border-color: var(--glow-amber-edge);
}

/* A neon line traced just inside the arch. */
.door::before {
  content: '';
  position: absolute;
  inset: var(--door-inset);
  border-radius: inherit;
  border: 1px solid var(--accent);
  opacity: 0.18;
  z-index: -1;
  transition:
    opacity 0.4s,
    box-shadow 0.4s;
}

/* Light spilling up from under the door. */
.door__light {
  position: absolute;
  inset: auto 0 0 0;
  height: 75%;
  background: radial-gradient(90% 70% at 50% 100%, var(--glow), transparent 70%);
  opacity: 0.45;
  transform: translateY(18%);
  z-index: -1;
  transition:
    opacity 0.5s,
    transform 0.6s var(--ease-out);
}

.door--venues .door__light {
  opacity: 0.75;
}

.door:hover,
.door:focus-within {
  transform: translateY(var(--door-lift));
  border-color: var(--accent);
  box-shadow: 0 30px 80px -30px var(--glow);
}

.door:hover::before,
.door:focus-within::before {
  opacity: 0.9;
  box-shadow:
    0 0 18px var(--glow),
    inset 0 0 18px var(--glow);
}

.door:hover .door__light,
.door:focus-within .door__light {
  opacity: 1;
  transform: none;
}

.door__num {
  position: absolute;
  top: var(--door-numeral-top);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--text-numeral);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  transition: -webkit-text-stroke-color 0.4s;
}

.door:hover .door__num,
.door:focus-within .door__num {
  -webkit-text-stroke-color: var(--accent);
}

.door__kicker {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
}

.door__title {
  margin-top: var(--space-sm);
  font-size: var(--text-door);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--text-hero);
}

.door__title em {
  font-size: 1.12em;
}

.door__line {
  margin-top: var(--space-md);
  color: var(--text-secondary);
  max-width: 30ch;
}

/* The whole door is the link: the ::after stretches over it. */
.door__link {
  margin-top: var(--space-xl);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--touch-target);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-button);
  border: 1px solid var(--line);
  font-weight: 600;
  color: var(--text-hero);
  transition:
    background 0.3s,
    color 0.3s,
    border-color 0.3s;
}

.door__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-arch);
}

.door:hover .door__link,
.door__link:focus-visible,
.door--venues .door__link {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--void);
}

.door__arrow {
  transition: transform 0.35s var(--ease-out);
}

.door:hover .door__arrow {
  transform: translateX(4px);
}

.welcome .door__link:focus-visible {
  outline: 2px solid var(--amber-300);
  outline-offset: 4px;
}

/* Sits above the stretched link so it can be tapped on its own. */
.door__sub {
  position: relative;
  z-index: 1;
  margin-top: var(--space-md);
  font-size: var(--text-caption);
  color: var(--text-secondary);
}

.welcome .door__sub a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
}

.welcome .door__sub a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------- */
/* Footer                                                                 */
/* --------------------------------------------------------------------- */

.welcome__foot {
  margin-top: auto;
  padding-top: var(--foot-top);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-base);
  font-size: var(--text-caption);
  color: var(--text-secondary);
}

.welcome__legal {
  display: flex;
  gap: var(--space-xl);
}

.welcome__legal a:hover {
  color: var(--text-hero);
}

/* --------------------------------------------------------------------- */
/* Phones: the doors stack, venues first                                  */
/* --------------------------------------------------------------------- */

@media (max-width: 760px) {
  .doors {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .door,
  .door:nth-child(2) {
    min-height: 0;
    padding: var(--space-lg);
    border-radius: var(--radius-door-phone);
  }

  .door::before {
    inset: var(--door-inset-phone);
    border-radius: var(--radius-door-phone-inner);
  }

  .door__link::after {
    border-radius: var(--radius-door-phone);
  }

  .door__light {
    height: 100%;
    background: radial-gradient(80% 120% at 0% 50%, var(--glow), transparent 70%);
    transform: none;
  }

  /* Numbered 01 to 03 across, but venues move to the top here: the numbers
     would read out of order. */
  .door__num {
    display: none;
  }

  .door__title {
    font-size: var(--text-door-phone);
  }

  .door__link {
    margin-top: var(--space-base);
  }

  .door:hover,
  .door:focus-within {
    transform: none;
  }

  .door--venues {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome *,
  .welcome *::before,
  .welcome *::after {
    animation: none !important;
    transition: none !important;
  }
}
