:root {
  --page-bg: #ffffff;
  --ink: #101743;
  --muted: #465075;
  --border: #dfe3ec;
  --shadow: 0 12px 28px rgba(24, 35, 68, 0.10), 0 2px 5px rgba(24, 35, 68, 0.06);
  --shadow-hover: 0 22px 44px rgba(24, 35, 68, 0.16), 0 6px 12px rgba(24, 35, 68, 0.08);
  --container: 1368px;
  --radius-card: 18px;
  --ease-bounce: cubic-bezier(.2, .8, .2, 1.2);
  --font-rounded: "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page-bg);
  font-family: var(--font-rounded);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  color: #fff;
  background: var(--ink);
  border-radius: 12px;
  transform: translateY(-180%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  min-height: 112px;
  background: #fff;
  border-bottom: 1px solid #eceef4;
  box-shadow: 0 6px 22px rgba(24, 35, 68, 0.08);
}

.site-header__inner {
  width: min(calc(100% - 64px), 1468px);
  min-height: 112px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: inline-flex;
  padding: 8px 4px;
  border-radius: 14px;
  transition: transform 220ms var(--ease-bounce);
}

.brand:hover {
  transform: translateY(-2px) scale(1.015);
}

.brand:focus-visible {
  outline: 4px solid #2f6fed;
  outline-offset: 4px;
}

.brand__logo {
  width: clamp(280px, 29vw, 428px);
  height: auto;
}

.directory {
  position: relative;
  isolation: isolate;
  min-height: 810px;
  overflow: hidden;
  padding: 58px 0 54px;
  background:
    radial-gradient(circle at 3% 44%, rgba(209, 225, 255, .82) 0 12px, transparent 13px),
    radial-gradient(circle at 97.5% 52%, rgba(255, 232, 145, .75) 0 12px, transparent 13px),
    #fff;
}

.container {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 96px), var(--container));
  margin: 0 auto;
}

.hero {
  margin: 0 auto 44px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 5.1vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.hero p {
  margin: 22px 0 0;
  color: var(--muted);
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  line-height: 1.35;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.link-card {
  --accent: #e31f2b;
  --accent-mid: #ef2936;
  --accent-dark: #a80b15;
  --rx: 0deg;
  --ry: 0deg;
  min-width: 0;
  min-height: 152px;
  padding: 18px 14px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(0);
  transform-style: preserve-3d;
  transition:
    transform 260ms var(--ease-bounce),
    border-color 220ms ease,
    box-shadow 260ms ease,
    background-color 220ms ease;
  will-change: transform;
}

.link-card:nth-child(3n + 1) {
  --idle-turn: -0.25deg;
}

.link-card:nth-child(3n + 2) {
  --idle-turn: 0.2deg;
}

.link-card:hover {
  z-index: 3;
  border-color: color-mix(in srgb, var(--accent) 35%, #dfe3ec);
  background: color-mix(in srgb, var(--accent) 3.5%, #ffffff);
  box-shadow: var(--shadow-hover);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-9px) scale(1.018);
}

.link-card:focus-visible {
  outline: 4px solid color-mix(in srgb, var(--accent) 68%, #ffffff);
  outline-offset: 4px;
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.letter-tile {
  position: relative;
  width: 104px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .32) 0 7%, transparent 8% 100%),
    linear-gradient(155deg, var(--accent-mid), var(--accent) 54%, var(--accent-dark));
  border: 2px solid color-mix(in srgb, var(--accent-dark) 60%, #ffffff);
  border-radius: 17px;
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, .48),
    inset 0 -7px 0 rgba(0, 0, 0, .16),
    0 9px 0 color-mix(in srgb, var(--accent-dark) 80%, #11182f),
    0 13px 17px rgba(15, 22, 53, .22);
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 4px 3px rgba(0, 0, 0, .2);
  transform: translateZ(20px);
  transition: transform 280ms var(--ease-bounce), filter 220ms ease;
}

.letter-tile::before {
  content: "";
  position: absolute;
  inset: 8px 10px auto 10px;
  height: 18px;
  background: linear-gradient(to bottom, rgba(255,255,255,.36), transparent);
  border-radius: 100%;
  pointer-events: none;
}

.link-card:hover .letter-tile {
  filter: saturate(1.08) brightness(1.04);
  transform: translateZ(34px) rotate(-3deg) scale(1.05);
}

.link-card__label {
  min-width: 0;
  overflow: visible;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: clamp(1.08rem, 1.3vw, 1.28rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.04em;
  white-space: nowrap;
  transform: translateZ(10px);
}

.link-card__label--medium {
  font-size: clamp(1.02rem, 1.18vw, 1.16rem);
}

.link-card__label--long {
  font-size: clamp(.9rem, 1.02vw, 1rem);
  letter-spacing: -0.05em;
}

.link-card__arrow {
  width: 40px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 2px solid currentColor;
  border-radius: 50%;
  transform: translateZ(14px);
  transition: color 220ms ease, background-color 220ms ease, transform 260ms var(--ease-bounce);
}

.link-card__arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-card:hover .link-card__arrow {
  color: #fff;
  background: var(--accent);
  transform: translateZ(28px) translateX(3px) rotate(-8deg);
}

.link-card--red {
  --accent: #ef2633;
  --accent-mid: #ff3c46;
  --accent-dark: #ab101a;
}

.link-card--blue {
  --accent: #1262e6;
  --accent-mid: #2b7af2;
  --accent-dark: #073da3;
}

.link-card--green {
  --accent: #39b527;
  --accent-mid: #55ca38;
  --accent-dark: #1d7514;
}

.link-card--purple {
  --accent: #7d25c9;
  --accent-mid: #9c38dc;
  --accent-dark: #4d128c;
}

.link-card--orange {
  --accent: #ff7600;
  --accent-mid: #ff9320;
  --accent-dark: #b54b00;
}

.link-card--yellow {
  --accent: #efa900;
  --accent-mid: #ffc525;
  --accent-dark: #a46800;
}

.link-card--cyan {
  --accent: #05aeb0;
  --accent-mid: #1cc8c5;
  --accent-dark: #087475;
}

.link-card--pink {
  --accent: #e52b76;
  --accent-mid: #f2428c;
  --accent-dark: #a4124f;
}

.decoration {
  position: absolute;
  z-index: 1;
  color: rgba(178, 205, 255, .45);
  font-size: 9rem;
  font-weight: 900;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.decoration--a {
  top: 50px;
  left: -20px;
  transform: rotate(9deg);
}

.decoration--b {
  top: 100px;
  right: 22px;
  color: rgba(255, 221, 97, .42);
  transform: rotate(-8deg);
}

.decoration--c {
  top: 300px;
  right: -28px;
  transform: rotate(9deg);
}

.decoration--k {
  right: -5px;
  bottom: 60px;
  color: rgba(255, 221, 97, .36);
  transform: rotate(14deg);
}

.site-footer {
  min-height: 100px;
  padding: 30px 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid #e8ebf1;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 1.05rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 14px 18px;
  color: #fff;
  background: var(--ink);
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(16, 23, 67, .24);
  opacity: 0;
  transform: translateY(14px) scale(.96);
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--ease-bounce);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 1200px) {
  .link-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .container {
    width: min(calc(100% - 64px), var(--container));
  }
}

@media (max-width: 900px) {
  .site-header,
  .site-header__inner {
    min-height: 96px;
  }

  .site-header__inner {
    justify-content: center;
  }

  .directory {
    padding-top: 46px;
  }

  .container {
    width: min(calc(100% - 40px), var(--container));
  }

  .hero {
    margin-bottom: 36px;
  }

  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .decoration {
    opacity: .65;
  }
}

@media (max-width: 590px) {
  .site-header,
  .site-header__inner {
    min-height: 82px;
  }

  .site-header__inner {
    width: calc(100% - 32px);
  }

  .brand__logo {
    width: min(76vw, 310px);
  }

  .directory {
    padding: 38px 0 40px;
  }

  .container {
    width: calc(100% - 28px);
  }

  .hero {
    margin-bottom: 30px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.35rem);
    letter-spacing: -0.06em;
  }

  .hero p {
    max-width: 320px;
    margin: 16px auto 0;
    font-size: 1.08rem;
  }

  .link-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .link-card {
    min-height: 108px;
    padding: 14px;
    grid-template-columns: 76px minmax(0, 1fr) 38px;
    gap: 14px;
    border-radius: 16px;
  }

  .letter-tile {
    width: 76px;
    border-radius: 13px;
    font-size: 3.25rem;
    box-shadow:
      inset 0 3px 4px rgba(255, 255, 255, .48),
      inset 0 -5px 0 rgba(0, 0, 0, .16),
      0 6px 0 color-mix(in srgb, var(--accent-dark) 80%, #11182f),
      0 10px 14px rgba(15, 22, 53, .20);
  }

  .link-card__label {
    font-size: 1.18rem;
  }

  .link-card__label--medium,
  .link-card__label--long {
    font-size: 1.08rem;
  }

  .link-card__arrow {
    width: 38px;
  }

  .decoration {
    font-size: 6.5rem;
  }

  .decoration--a {
    top: 20px;
    left: -42px;
  }

  .decoration--b {
    top: 160px;
    right: -35px;
  }

  .decoration--c,
  .decoration--k {
    display: none;
  }

  .site-footer {
    min-height: 88px;
    font-size: .98rem;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .link-card,
  .link-card:hover,
  .link-card:focus-visible,
  .link-card:hover .letter-tile,
  .link-card:hover .link-card__arrow {
    transform: none;
  }
}
