/* =========================================================
   THE DISPENSARY & HERMITAGE PORTAL — v4
   ========================================================= */

@font-face {
  font-family: "Bahnschrift Portal";
  src:
    url("../fonts/bahnschrift-semibold-condensed.woff") format("woff"),
    url("../fonts/BAHNSCHRIFT.TTF") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-stretch: 75%;
  font-display: swap;
}

:root {
  --orange: #f4a216;
  --orange-border: #d88610;
  --orange-light: #ffc97d;
  --black: #000;
  --white: #fff;

  --heading-font:
    "Bahnschrift Portal",
    "Bahnschrift Condensed",
    "Bahnschrift SemiCondensed",
    "Bahnschrift",
    "Barlow Condensed",
    "Arial Narrow",
    sans-serif;

  --body-font:
    "Space Grotesk",
    Arial,
    sans-serif;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

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

body {
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--black);
  font-family: var(--body-font);
  color: var(--white);
}


/* =========================================================
   16:9 STAGE
   ========================================================= */

.portal-frame {
  width: min(100vw, calc(100svh * 16 / 9));
  height: min(100svh, calc(100vw * 9 / 16));
  aspect-ratio: 16 / 9;

  position: relative;
  overflow: hidden;
  container-type: size;
  isolation: isolate;

  background: url("../images/bg.jpg") center center / cover no-repeat;
}

.portal-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../images/bg.jpg") center center / cover no-repeat;
  filter: saturate(0.35);   /* 1 = original, 0 = fully greyscale */
}

/* Symmetrical edge vignette — no directional/offset shadow. */
.portal-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  box-shadow:
    inset 0 0 6.5cqw rgba(0, 0, 0, 0.28),
    inset 0 0 2.5cqw rgba(0, 0, 0, 0.12);
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.portal-content {
  position: absolute;
  inset: 0;
  z-index: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding:
    clamp(16px, 3cqh, 34px)
    clamp(18px, 4cqw, 72px);

  text-align: center;
}

/*
  Broad soft shadow behind the ENTIRE heading/button/logo group,
  based on the darkened central area in PREVIEW.jpg.

  This also waits for the one-second intro pause so the background
  can initially be seen on its own.
*/
.portal-content::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;

  width: min(78cqw, 1420px);
  height: min(72cqh, 650px);

  transform: translate(-50%, -50%);

  background:
    radial-gradient(
      ellipse at center,
      rgba(0, 0, 0, 0.66) 0%,
      rgba(0, 0, 0, 0.58) 30%,
      rgba(0, 0, 0, 0.46) 48%,
      rgba(0, 0, 0, 0.24) 64%,
      rgba(0, 0, 0, 0.00) 80%
    );

  filter: blur(clamp(5px, 0.55cqw, 11px));
  pointer-events: none;

  opacity: 0;
  animation: portal-fade-in 900ms ease 1s forwards;
}

.portal-content > * {
  position: relative;
  z-index: 1;
}


/* =========================================================
   INTRO FADE
   ========================================================= */

/*
  For the first second only the background is visible.
  Then the heading, buttons and logo area fade in together.
*/
.portal-heading,
.portal-buttons,
.logo-strip {
  opacity: 0;
  animation: portal-fade-in 200ms ease 1s forwards;
}

@keyframes portal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* =========================================================
   HEADING
   ========================================================= */

.portal-heading {
  width: min(72cqw, 1000px);
}

.portal-heading h1 {
  margin: 0;
  color: var(--orange);

  font-family: var(--heading-font);
  font-size: clamp(30px, 4.2cqw, 92px);
  font-weight: 600;
  font-stretch: condensed;
  font-variation-settings: "wght" 600, "wdth" 75;
  line-height: 0.88;
  letter-spacing: 0.015em;
  text-transform: uppercase;

  /*
    Shadow the completed heading as one composited block. This avoids one
    line's shadow darkening the neighbouring line.
  */
  text-shadow: none;
  filter:
    drop-shadow(0 0 2px rgba(0, 0, 0, 1))
    drop-shadow(0 0 5px rgba(0, 0, 0, 1))
    drop-shadow(0 0 10px rgba(0, 0, 0, 0.98))
    drop-shadow(0 0 18px rgba(0, 0, 0, 0.78));
}

.portal-heading h1 span {
  display: block;
}

.portal-heading p {
  margin:
    clamp(9px, 2.3cqh, 24px)
    0
    0;

  font-size: clamp(12px, 1.55cqw, 27px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.005em;

  text-shadow: none;
  filter:
    drop-shadow(0 0 2px rgba(0, 0, 0, 1))
    drop-shadow(0 0 5px rgba(0, 0, 0, 0.95))
    drop-shadow(0 0 10px rgba(0, 0, 0, 0.78));
}


/* =========================================================
   BUTTON GRID
   ========================================================= */

.portal-buttons {
  width: min(65.5cqw, 1180px);
  margin-top: clamp(12px, 3.3cqh, 34px);

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 0.72cqw, 16px);
}

.portal-button {
  position: relative;
  display: block;
  overflow: hidden;

  aspect-ratio: 1 / 1;

  border:
    clamp(3px, 0.28cqw, 6px)
    solid
    var(--orange-border);

  border-radius: clamp(5px, 0.45cqw, 9px);

  background: #17100b;
  color: var(--orange);
  text-decoration: none;

  /*
    Symmetrical button shadow: x=0, y=0 throughout.
    Slightly heavier than v1 to match PREVIEW.jpg.
  */
  box-shadow:
    0 0 clamp(5px, 0.45cqw, 9px) rgba(0, 0, 0, 0.98),
    0 0 clamp(11px, 0.9cqw, 18px) rgba(0, 0, 0, 0.90),
    0 0 clamp(18px, 1.35cqw, 28px) rgba(0, 0, 0, 0.52);

  transform: translateZ(0);
  transition:
    transform 180ms ease,
    filter 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.portal-button img {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  display: block;

  object-fit: cover;
  object-position: center;
}

/* Dark lower wash behind the text, again centred rather than offset. */
.portal-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background:
    radial-gradient(
      ellipse at 50% 82%,
      rgba(0, 0, 0, 0.64) 0%,
      rgba(0, 0, 0, 0.44) 28%,
      rgba(0, 0, 0, 0.08) 58%,
      rgba(0, 0, 0, 0.00) 76%
    );
}

.portal-button-label {
  position: absolute;
  z-index: 2;

  left: 4%;
  right: 4%;
  bottom: 8%;

  font-family: var(--heading-font);
  font-size: clamp(12px, 1.52cqw, 27px);
  font-weight: 600;
  font-stretch: condensed;
  font-variation-settings: "wght" 600, "wdth" 75;
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;

  color: var(--orange);

  /*
    Shadow the completed multi-line label as one composited shape.
    This prevents lower words casting blur over the words above.
  */
  text-shadow: none;
  filter:
    drop-shadow(0 0 2px rgba(0, 0, 0, 1))
    drop-shadow(0 0 5px rgba(0, 0, 0, 1))
    drop-shadow(0 0 10px rgba(0, 0, 0, 0.95))
    drop-shadow(0 0 16px rgba(0, 0, 0, 0.76));
}

/* The selective pale-orange wording shown in PREVIEW.jpg. */
.label-light {
  color: var(--orange-light);
}


/* =========================================================
   INTERACTION
   ========================================================= */

@media (hover: hover) {
  .portal-button:hover {
    transform: scale(1.012);
    filter: brightness(1.08) saturate(1.04);
    border-color: var(--orange);

    box-shadow:
      0 0 clamp(7px, 0.55cqw, 11px) rgba(0, 0, 0, 1),
      0 0 clamp(13px, 1cqw, 20px) rgba(0, 0, 0, 0.92),
      0 0 clamp(20px, 1.5cqw, 31px) rgba(0, 0, 0, 0.58),
      0 0 clamp(7px, 0.55cqw, 11px) rgba(244, 162, 22, 0.16);
  }
}

.portal-button:focus-visible {
  outline: max(2px, 0.18cqw) solid #fff;
  outline-offset: max(2px, 0.18cqw);
}


/* =========================================================
   LOGO AREA
   ========================================================= */

.logo-strip {
  width: min(52cqw, 900px);
  min-height: clamp(18px, 6.2cqh, 65px);
  margin-top: clamp(7px, 1.8cqh, 18px);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.5cqw, 28px);
}

.logo-strip img {
  display: block;
  width: auto;
  max-width: 10cqw;
  max-height: clamp(20px, 4.6cqh, 46px);
  object-fit: contain;
}

.logo-strip {
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.95))
          drop-shadow(0 0 20px rgba(0,0,0,0.75));
}


/* =========================================================
   SMALL / PORTRAIT DEVICES
   ========================================================= */

@media (max-width: 700px), (max-aspect-ratio: 4 / 5) {

  body {
    overflow: auto;
    display: block;
  }

  .portal-frame {
    width: 100%;
    height: auto;
    min-height: 100svh;
    aspect-ratio: auto;
    overflow: visible;
    container-type: inline-size;

    background-position: center center;
    background-size: cover;
  }

  .portal-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.16);
  }

  .portal-content {
    position: relative;
    min-height: 100svh;

    /*
      Remains centred when everything fits.
      On shorter phones the content naturally grows beyond 100svh and
      the page becomes scrollable rather than clipping the stacked buttons.
    */
    justify-content: center;

    padding:
      max(34px, env(safe-area-inset-top))
      20px
      max(30px, env(safe-area-inset-bottom));
  }

  .portal-content::before {
    width: 118cqw;
    height: 90%;
    background:
      radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.62) 0%,
        rgba(0, 0, 0, 0.48) 44%,
        rgba(0, 0, 0, 0.18) 70%,
        rgba(0, 0, 0, 0) 88%
      );
  }

  .portal-heading {
    width: 100%;
  }

  .portal-heading h1 {
    font-size: clamp(42px, 13cqw, 72px);
    line-height: 0.88;
  }

  .portal-heading p {
    margin-top: 16px;
    font-size: clamp(15px, 4.6cqw, 21px);
  }

  .portal-buttons {
    width: min(78cqw, 330px);
    margin-top: 28px;

    grid-template-columns: 1fr;
    gap: 15px;
  }

  .portal-button {
    border-width: 4px;
    border-radius: 8px;

    box-shadow:
      0 0 7px rgba(0, 0, 0, 1),
      0 0 15px rgba(0, 0, 0, 0.92),
      0 0 25px rgba(0, 0, 0, 0.55);
  }

  .portal-button-label {
    bottom: 8%;
    font-size: clamp(21px, 7cqw, 30px);
  }

  .logo-strip {
    width: 100%;
    min-height: 58px;
    margin-top: 18px;
    flex-wrap: wrap;
    gap: 14px 20px;
  }

  .logo-strip img {
    max-width: 26cqw;
    max-height: 42px;
  }
}


/* Slightly tighter sizing for short landscape screens. */
@media (min-width: 701px) and (max-height: 620px) and (orientation: landscape) {

  .portal-buttons {
    width: min(61cqw, 1040px);
    margin-top: 2.2cqh;
  }

  .logo-strip {
    min-height: 4.5cqh;
    margin-top: 1cqh;
  }
}


/*
  Users who request reduced motion get the content immediately,
  avoiding an enforced animated delay.
*/
@media (prefers-reduced-motion: reduce) {
  .portal-heading,
  .portal-buttons,
  .logo-strip,
  .portal-content::before {
    opacity: 1;
    animation: none;
  }

  .portal-button {
    transition: none;
  }
}
