/* ==========================================================================
   tap5a.io — Tapio "Tap5a" Haaja's builder corner
   ========================================================================== */

/* Fonts ------------------------------------------------------------------ */

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url('fonts/raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url('fonts/raleway-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens ----------------------------------------------------------------- */

:root {
  --bg: #2b2b2b;
  --bg-soft: #313131;
  --bg-elev: #363636;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  --text: #ededed;
  --text-mid: #b8b8b8;
  --text-dim: #a3a3a3;

  --pink: #ed1968;
  --pink-link: #ff5c95;
  --pink-deep: #d6135c;
  --orange: #f27f1b;

  --wrap: 1040px;
  --radius: 12px;
  --radius-lg: 16px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Base ------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Raleway', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0.004em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--pink-link);
  text-decoration: none;
}

::selection {
  background: var(--pink);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--pink-link);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  transition: top 0.2s var(--ease);
}

.skip:focus {
  top: 16px;
}

/* Ambient glow ----------------------------------------------------------- */

.glow {
  position: absolute;
  top: -400px;
  left: 50%;
  z-index: 0;
  /* Capped at 100% so the glow can never widen the page. Using 118vw here
     overflowed both edges below ~915px and made <html> horizontally scrollable,
     which overflow-x on <body> does not prevent. */
  width: min(1080px, 100%);
  height: 880px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(
      46% 46% at 44% 56%,
      rgba(237, 25, 104, 0.17),
      rgba(237, 25, 104, 0.05) 52%,
      rgba(237, 25, 104, 0) 74%
    ),
    radial-gradient(
      34% 38% at 66% 52%,
      rgba(242, 127, 27, 0.1),
      rgba(242, 127, 27, 0.03) 54%,
      rgba(242, 127, 27, 0) 76%
    );
  filter: blur(46px);
}

/* Sticky nav ------------------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  background: rgba(38, 38, 38, 0.72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  transform: translateY(-101%);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}

.nav.is-visible {
  transform: none;
  opacity: 1;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 24px;
}

.nav__brand img {
  width: auto;
  height: 17px;
  opacity: 0.92;
  transition: opacity 0.2s var(--ease);
}

.nav__brand:hover img {
  opacity: 1;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav__links a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav__links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

/* Hero ------------------------------------------------------------------- */

.hero {
  position: relative;
  z-index: 1;
  padding: clamp(72px, 13vh, 132px) 0 clamp(56px, 8vh, 88px);
  text-align: center;
}

/* The SVG logo is cropped flush to its artwork, where the old PNG carried ~12%
   transparent padding top and bottom. Heights here are the old values x 0.766
   so the letterforms keep the same optical size. */
.hero__logo {
  width: auto;
  height: clamp(44px, 6.4vw, 67px);
  margin: 0 auto clamp(30px, 4.6vw, 46px);
}

.hero__name {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 250;
  letter-spacing: 0.012em;
}

/* Sections --------------------------------------------------------------- */

.section {
  position: relative;
  z-index: 1;
  padding: clamp(56px, 8vw, 92px) 0;
  scroll-margin-top: 74px;
}

.section--intro {
  padding-top: clamp(20px, 3vw, 34px);
}

/* Hairline divider between sections, aligned to the content column */
.section + .section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 48px, calc(var(--wrap) - 48px));
  height: 1px;
  background: var(--line);
}

.section__head {
  max-width: 720px;
  margin-bottom: clamp(34px, 4.6vw, 52px);
}

.section__title {
  /* Baseline alignment keeps the marker on the first line if a title wraps */
  display: flex;
  align-items: baseline;
  gap: 0.42em;
  font-size: clamp(25px, 3.1vw, 34px);
  font-weight: 500;
  letter-spacing: 0.006em;
}

/* Orange play-triangle, echoing the triangles in the Tap5a logotype.
   Sized in em so it tracks the responsive title size. */
.section__title::before {
  content: '';
  flex: none;
  width: 0.44em;
  height: 0.54em;
  background: var(--orange);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  /* Baseline puts the box bottom on the baseline; this lifts it so the
     triangle's centre lands on the cap-height centre (~0.36em up). */
  transform: translateY(-0.09em);
}

.section__lede {
  margin-top: 16px;
  color: var(--text-mid);
  font-size: 16.5px;
  font-weight: 300;
  line-height: 1.7;
}

/* Intro ------------------------------------------------------------------ */

.intro {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: clamp(28px, 4vw, 46px);
  align-items: start;
}

.intro__photo {
  width: 100%;
  /* aspect-ratio + cover keep it square even if a non-square
     portrait is dropped in later */
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.intro__text {
  display: grid;
  gap: 20px;
  max-width: 640px;
  color: var(--text-mid);
  font-weight: 300;
}

.intro__text a {
  color: var(--pink-link);
  border-bottom: 1px solid rgba(255, 92, 149, 0.32);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.intro__text a:hover {
  color: #ff85af;
  border-bottom-color: #ff85af;
}

/* Item rows -------------------------------------------------------------- */

.items {
  display: grid;
  gap: clamp(16px, 2vw, 22px);
}

.item {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(22px, 3vw, 34px);
  align-items: start;
  padding: clamp(18px, 2.2vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-soft), #2f2f2f);
  transition: border-color 0.28s var(--ease), transform 0.28s var(--ease),
    background-color 0.28s var(--ease);
}

.item:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.item__media {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: #262626;
  aspect-ratio: 16 / 9;
}

.item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.35s var(--ease);
}

.item:hover .item__media img {
  transform: scale(1.035);
  filter: brightness(1.06);
}

.item__body {
  min-width: 0;
}

.item__title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.004em;
}

.item__title a {
  color: var(--text);
  transition: color 0.18s var(--ease);
}

.item__title a:hover {
  color: var(--pink-link);
}

.tag {
  display: inline-block;
  margin-left: 4px;
  padding: 3px 9px;
  vertical-align: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.item__blurb {
  margin-top: 12px;
  color: var(--text-mid);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.65;
}

.item__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.014em;
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

.btn:hover {
  color: #fff;
  border-color: var(--pink-link);
  background: rgba(237, 25, 104, 0.14);
}

.btn--accent {
  border-color: rgba(237, 25, 104, 0.45);
  color: var(--pink-link);
}

.btn--accent:hover {
  border-color: var(--pink-link);
  background: rgba(237, 25, 104, 0.16);
  color: #fff;
}

.btn--primary {
  border-color: var(--pink-deep);
  background: var(--pink-deep);
  color: #fff;
}

.btn--primary:hover {
  border-color: var(--pink);
  background: var(--pink);
  color: #fff;
}

.btn__arrow {
  font-size: 15px;
  line-height: 1;
  transition: transform 0.25s var(--ease);
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

.btn:hover .btn__arrow--down {
  transform: translateY(2px);
}

/* 404 -------------------------------------------------------------------- */

.notfound {
  text-align: center;
}

.notfound__text {
  max-width: 520px;
  margin: 0 auto 32px;
  color: var(--text-mid);
  font-size: 16.5px;
  font-weight: 300;
  line-height: 1.7;
}

.notfound__action {
  display: flex;
  justify-content: center;
  margin: 0;
}

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

.footer {
  position: relative;
  z-index: 1;
  padding: clamp(52px, 7vw, 80px) 0 40px;
  border-top: 1px solid var(--line);
  background: #272727;
}

/* Contact column is sized to its content, so the five social pills keep the
   remaining width and stay on one line (they need 594px of the 992px column). */
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(34px, 5vw, 64px);
}

.footer__heading {
  margin-bottom: 18px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer__links--stack {
  flex-direction: column;
  align-items: flex-start;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(44px, 6vw, 64px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.footer__logo {
  width: auto;
  height: 15px;
  opacity: 0.5;
}

.footer__meta {
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* Reveal ----------------------------------------------------------------- */

/* Scoped to .js so the page is never blank if the script fails to run */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.62s var(--ease), transform 0.62s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 900px) {
  .item {
    grid-template-columns: 230px 1fr;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .intro__photo {
    width: 132px;
    border-radius: var(--radius);
  }

  .item {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .nav__links a {
    padding: 6px 9px;
    font-size: 13px;
  }

  .nav__inner {
    padding: 10px 18px;
  }

  .wrap {
    padding: 0 18px;
  }

  .section + .section::before {
    width: calc(100% - 36px);
  }

  .footer__top {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

@media (max-width: 400px) {
  .nav__brand img {
    height: 14px;
  }

  .btn {
    padding: 9px 15px;
    font-size: 14px;
  }
}

/* Accessibility ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .item:hover {
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --text-mid: #d8d8d8;
    --text-dim: #c4c4c4;
    --line: rgba(255, 255, 255, 0.2);
    --line-strong: rgba(255, 255, 255, 0.4);
  }
}
