/* =====================================================================
   GoJonny home — the sunlit hub: two doors (Writing / Games) on a hex-tiled
   white-to-grey field. Navbar styles come from css/nav.css (shared).
   ===================================================================== */

/* ---------- Fonts (same files Minerva uses, so the browser caches one copy) ---------- */
@font-face {
  font-family: "Oxanium";
  src: url("../MinervaRising/fonts/static/Oxanium-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oxanium";
  src: url("../MinervaRising/fonts/static/Oxanium-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Oxanium";
  src: url("../MinervaRising/fonts/static/Oxanium-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --body-w: 1000px;              /* also sizes the navbar strip (nav.css reads --body-w) */
  --hub-w: 760px;                /* the two doors + the blurb share this width */
  --disc: 250px;                 /* circle diameter; media queries step it down */
  --hex-w: 290px;                /* hex tile size (290:166 image); media queries step it down */
  --hex-h: 166px;

  --ink: #0b1a24;
  --ink-soft: #4a5861;
  --ink-faint: #8a949b;

  /* the two tints: bright for the additive glow, deeper for text on white */
  --crimson:      #dc143c;  --crimson-rgb: 220, 20, 60;
  --crimson-text: #a60f2f;
  --teal:         #16b7b7;  --teal-rgb: 22, 183, 183;
  --teal-text:    #0b6f72;

  --font-display: "Oxanium", "Segoe UI", Arial, sans-serif;
  --font-body: "Oxanium", "Segoe UI", Arial, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  /* the field: white in the middle, clearly grey at the edges */
  background-color: #8f98a3;
  background-image: radial-gradient(ellipse farthest-corner at 50% 38%,
                      #ffffff 0%, #f3f4f6 32%, #e1e4e8 60%, #cfd4da 76%, #b3bac3 90%, #8f98a3 100%);
  background-attachment: fixed;
}
body {
  position: relative;
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
}
/* hex tiles on their own layer so they can sit at half strength over the gradient */
body::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  background: url("../img/TILED_Hexagon_Pattern_med_BKG.png") repeat 0 0 / var(--hex-w) var(--hex-h);
  opacity: 0.3;
  pointer-events: none;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; }

/* ---------- Page frame: nav at the top, hub centered, footer at the bottom ---------- */
.page {
  min-height: 100vh;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  padding: calc(var(--nav-h, 56px) + 40px) 16px 24px;
}
.hub {
  width: var(--hub-w);
  max-width: 100%;
  margin: auto 0;              /* vertically centers between nav and footer */
  padding: 24px 0 12px;
}

/* ---------- The question ---------- */
.hub__title {
  margin: 0 0 40px;
  text-align: center;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 12px 36px rgba(11,26,36,0.42);
}

/* ---------- The doors ---------- */
.choices {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start;
}
.choice {
  -webkit-box-flex: 1; -ms-flex: 1 1 50%; flex: 1 1 50%;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  text-decoration: none;
  color: var(--ink);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.choice--writing { --tint: var(--crimson); --tint-rgb: var(--crimson-rgb); --tint-text: var(--crimson-text); }
.choice--games   { --tint: var(--teal);    --tint-rgb: var(--teal-rgb);    --tint-text: var(--teal-text); }

.choice__disc {
  position: relative;
  display: block;
  width: var(--disc);
  height: var(--disc);
}
.choice__disc img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 28px rgba(11,26,36,0.28));
  -webkit-transform: scale(1); transform: scale(1);
  -webkit-transition: -webkit-transform .35s cubic-bezier(.22,.8,.3,1), filter .35s ease;
          transition: transform .35s cubic-bezier(.22,.8,.3,1), filter .35s ease;
  will-change: transform;
}
/* The light: a tinted halo behind the disc, fading colour to transparent. The alpha stops
   are sampled from an exponential decay (about e^-3r past the rim), so it drops off fast
   near the circle and trails out softly, instead of a straight linear ramp. */
.choice__glow {
  position: absolute;
  z-index: 0;
  top: -45%; right: -45%; bottom: -45%; left: -45%;
  border-radius: 50%;
  background: radial-gradient(circle closest-side,
    rgba(var(--tint-rgb), 0.95)  0%,
    rgba(var(--tint-rgb), 0.95) 26%,     /* hidden under the disc */
    rgba(var(--tint-rgb), 0.70) 34%,
    rgba(var(--tint-rgb), 0.46) 44%,
    rgba(var(--tint-rgb), 0.28) 55%,
    rgba(var(--tint-rgb), 0.16) 66%,
    rgba(var(--tint-rgb), 0.08) 78%,
    rgba(var(--tint-rgb), 0.03) 90%,
    rgba(var(--tint-rgb), 0.00) 100%);
  opacity: 0;
  -webkit-transform: scale(0.82); transform: scale(0.82);
  -webkit-transition: opacity .4s ease, -webkit-transform .45s cubic-bezier(.22,.8,.3,1);
          transition: opacity .4s ease, transform .45s cubic-bezier(.22,.8,.3,1);
  pointer-events: none;
}
.choice:hover .choice__disc img, .choice:focus-visible .choice__disc img {
  -webkit-transform: scale(1.09); transform: scale(1.09);
  filter: drop-shadow(0 22px 40px rgba(11,26,36,0.34));
}
.choice:hover .choice__glow, .choice:focus-visible .choice__glow {
  opacity: 1;
  -webkit-transform: scale(1); transform: scale(1);
}

.choice__label {
  margin-top: 24px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 10px 30px rgba(11,26,36,0.4);
  -webkit-transition: color .25s ease, letter-spacing .25s ease; transition: color .25s ease, letter-spacing .25s ease;
}
.choice:hover .choice__label, .choice:focus-visible .choice__label {
  color: var(--tint-text);
  letter-spacing: 0.25em;
}

/* ---------- The blurb: a tooltip-style card with an arrow on top ---------- */
.blurb {
  --arrow-x: 25%;                    /* arrow sits under the Writing door by default */
  --accent: var(--crimson-text);
  position: relative;
  margin-top: 44px;
  padding: 30px 36px 28px;
  border-radius: 14px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(11,26,36,0.12);
  box-shadow: 0 24px 60px rgba(11,26,36,0.12), 0 2px 6px rgba(11,26,36,0.06);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  text-align: center;
  /* hidden until a door is hovered (JS adds .is-open to .hub) */
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translateY(10px); transform: translateY(10px);
  -webkit-transition: opacity .32s ease, -webkit-transform .32s ease, visibility 0s linear .32s;
          transition: opacity .32s ease, transform .32s ease, visibility 0s linear .32s;
}
.hub.is-open .blurb, html:not(.js) .blurb {
  opacity: 1;
  visibility: visible;
  -webkit-transform: translateY(0); transform: translateY(0);
  -webkit-transition-delay: 0s; transition-delay: 0s;
}
.hub[data-active="games"] .blurb { --arrow-x: 75%; --accent: var(--teal-text); }

/* the triangle: ::after is the white fill, ::before the 1px border behind it */
.blurb::before, .blurb::after {
  content: "";
  position: absolute;
  left: var(--arrow-x);
  width: 0; height: 0;
  border-style: solid;
  border-color: transparent;
  -webkit-transform: translateX(-50%); transform: translateX(-50%);
  -webkit-transition: left .38s cubic-bezier(.22,.8,.3,1); transition: left .38s cubic-bezier(.22,.8,.3,1);
}
.blurb::before { top: -15px; border-width: 0 15px 15px 15px; border-bottom-color: rgba(11,26,36,0.14); }
.blurb::after  { top: -13px; border-width: 0 13px 13px 13px; border-bottom-color: #fff; }

/* both panes sit in the same grid cell so the card is as tall as the taller one; they cross-fade */
.blurb__stage { display: -ms-grid; display: grid; }
.blurb__pane {
  -ms-grid-row: 1; -ms-grid-column: 1; grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  -webkit-transition: opacity .38s ease; transition: opacity .38s ease;
}
.hub[data-active="writing"] .blurb__pane--writing,
.hub[data-active="games"]   .blurb__pane--games { opacity: 1; pointer-events: auto; }

.blurb__pane h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--accent);
  -webkit-transition: color .38s ease; transition: color .38s ease;
}
.blurb__pane h3 {
  margin: 0 0 14px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 400;
  line-height: 1.35;
  color: #37444c;              /* a step darker than --ink-soft: legible on dimmer screens */
}
.blurb__pane p {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #626d76;              /* a step darker than --ink-faint */
}

/* ---------- Footer: grey on the pale field, deliberately quiet ---------- */
.footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(11,26,36,0.38);
}
.footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) { :root { --body-w: 700px; } }
@media (max-width: 759px) {
  :root { --body-w: 92vw; --disc: 200px; --hex-w: 220px; --hex-h: 126px; }
  .page { padding-top: calc(var(--nav-h, 56px) + 28px); }
  .blurb { padding: 24px 22px 22px; margin-top: 36px; }
  .choice__label { font-size: 1.4rem; margin-top: 18px; }
  .hub__title { margin-bottom: 30px; }
}
/* phones: doors stack, the arrow points straight up at the stack */
@media (max-width: 559px) {
  :root { --disc: 170px; --hex-w: 174px; --hex-h: 100px; }
  .hub__title { margin-bottom: 26px; }
  .choices {
    -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  }
  .choice { -webkit-box-flex: 0; -ms-flex: 0 0 auto; flex: 0 0 auto; }
  .choice + .choice { margin-top: 28px; }
  .blurb { --arrow-x: 50%; margin-top: 30px; }
  .hub[data-active="games"] .blurb { --arrow-x: 50%; }
}
@media (max-width: 400px) {
  .nav__company { display: none; }   /* three chips do not fit beside the name on a narrow phone */
}

/* Users who prefer less motion get instant states */
@media (prefers-reduced-motion: reduce) {
  .choice__disc img, .choice__glow, .choice__label, .blurb, .blurb::before, .blurb::after, .blurb__pane, .blurb__pane h2 {
    -webkit-transition: none; transition: none;
  }
}
