/* ============================================================
   THE PYRAMID — stylesheet
   ============================================================
   Sections, in order:
     1. Theme        - colours and sizes, change these first
     2. Base         - page background, grain, centring
     3. Header       - logo mark, name, tagline
     4. Links        - the buttons
     5. Footer
     6. Entrance     - the fade-up animation on load
     7. Responsive   - small screens
     8. Accessibility- reduced motion
   ============================================================ */


/* ------------------------------------------------------------
   1. THEME
   Change a value here and it updates everywhere on the page.
   ------------------------------------------------------------ */
:root {
  --ink:        #08080a;   /* page background */
  --ink-raised: #131317;   /* button background */
  --line:       #26262d;   /* button borders */
  --bone:       #f5f2ea;   /* main text */
  --bone-dim:   #8d8b85;   /* secondary text (handles, tagline) */
  --sand:       #c9a227;   /* accent: the glow + focus ring */

  --radius:     14px;      /* button corner rounding */
  --width:      412px;     /* how wide the column is */

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Helvetica, Arial, sans-serif;
}

/* --- Want a light theme instead? Swap the block above for this:
:root {
  --ink:        #faf8f4;
  --ink-raised: #ffffff;
  --line:       #e4e0d8;
  --bone:       #16151a;
  --bone-dim:   #78746c;
  --sand:       #b08d18;
}
--- */


/* ------------------------------------------------------------
   2. BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 22px calc(40px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The soft coloured glow behind the logo mark.
   Set opacity to 0 to remove it entirely. */
body::before {
  content: "";
  position: fixed;
  top: -30vmax;
  left: 50%;
  width: 80vmax;
  height: 80vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 50%,
    rgba(201, 162, 39, .13) 0%,
    rgba(201, 162, 39, .05) 34%,
    transparent 66%);
  pointer-events: none;
  z-index: 0;
  animation: drift 16s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translateX(-50%) scale(1);    opacity: .8; }
  to   { transform: translateX(-50%) scale(1.14); opacity: 1;  }
}

/* A very faint noise texture so the black doesn't look flat.
   Raise the opacity for more grain, or set it to 0 for none. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--width);
}


/* ------------------------------------------------------------
   3. HEADER
   ------------------------------------------------------------ */
header {
  text-align: center;
  margin-bottom: 38px;
}

/* The rounded tile holding the pyramid drawing. */
.mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, #16161b 0%, #0c0c0f 100%);
  box-shadow: 0 18px 44px -22px rgba(0, 0, 0, .95),
              inset 0 1px 0 rgba(255, 255, 255, .05);
}

.mark svg {
  width: 40px;
  height: 40px;
  display: block;
  overflow: visible;
}

/* The outline draws itself on load. */
.mark .edge {
  fill: none;
  stroke: var(--bone);
  stroke-width: 2.1;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 190;
  stroke-dashoffset: 190;
  animation: draw 1.5s cubic-bezier(.6, .02, .2, 1) .18s forwards;
}

/* The two gold courses across the pyramid, fading in after it. */
.mark .rung {
  stroke: var(--sand);
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0;
  animation: glint .6s ease forwards 1.25s;
}

@keyframes draw  { to { stroke-dashoffset: 0; } }
@keyframes glint { to { opacity: .85; } }

/* Use this instead of .mark if you swap in a photo. */
.avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  display: block;
  object-fit: cover;
  border-radius: 22px;   /* square tile, matches .mark's rounding — set to 50% for a circle */
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px -22px rgba(0, 0, 0, .95);
}

h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -.022em;
}

.tagline {
  margin: 11px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--bone-dim);
  letter-spacing: .015em;
}

/* The short hairline between the tagline and the buttons. */
.rule {
  width: 26px;
  height: 1px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}


/* ------------------------------------------------------------
   4. LINKS
   ------------------------------------------------------------ */
nav {
  display: flex;
  flex-direction: column;
  gap: 11px;              /* space between buttons */
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 19px;     /* button height comes from this */
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-raised);
  color: var(--bone);
  text-decoration: none;
  overflow: hidden;
  transition: transform .28s cubic-bezier(.2, .8, .3, 1),
              border-color .28s ease,
              background-color .28s ease;
}

/* A light sweeping across the button on hover. */
.link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 38%,
    rgba(255, 255, 255, .07) 50%,
    transparent 62%);
  transform: translateX(-110%);
  transition: transform .65s cubic-bezier(.3, .7, .3, 1);
  pointer-events: none;
}

.link:hover,
.link:focus-visible {
  transform: translateY(-2px);   /* the lift */
  border-color: #3b3b45;
  background: #17171c;
}

.link:hover::after,
.link:focus-visible::after { transform: translateX(110%); }

.link:focus-visible {
  outline: 2px solid var(--sand);
  outline-offset: 3px;
}

.link:active { transform: translateY(0); }

.icon {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  fill: currentColor;   /* icons follow the text colour */
  opacity: .92;
}

.label {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.label b {           /* the platform name */
  font-size: 14.5px;
  font-weight: 550;
  letter-spacing: -.005em;
}

.label span {        /* the handle underneath */
  font-size: 12px;
  color: var(--bone-dim);
  letter-spacing: .012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrow {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--bone-dim);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .28s cubic-bezier(.2, .8, .3, 1),
              stroke .28s ease;
}

.link:hover .arrow,
.link:focus-visible .arrow {
  transform: translate(2.5px, -2.5px);
  stroke: var(--bone);
}


/* ------------------------------------------------------------
   5. FOOTER
   ------------------------------------------------------------ */
footer {
  margin-top: 34px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #4e4d4a;
}


/* ------------------------------------------------------------
   6. ENTRANCE
   Everything with class "rise" fades up on load. The stagger
   comes from inline animation-delay values: the header sets
   its own in index.html, the buttons get theirs from app.js.
   ------------------------------------------------------------ */
.rise {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .72s cubic-bezier(.2, .8, .3, 1) forwards;
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}


/* ------------------------------------------------------------
   7. RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 380px) {
  h1 { font-size: 26px; }
  .link { padding: 15px 16px; gap: 13px; }
}


/* ------------------------------------------------------------
   8. ACCESSIBILITY
   Respects the "reduce motion" setting in the visitor's OS:
   everything lands in its final state immediately.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
  }

  .rise { opacity: 1; transform: none; }
  .mark .edge { stroke-dashoffset: 0; }
  .mark .rung { opacity: .85; }
}
