/* Home page, layered over styles.css (the 404 page still uses that file on its own).
   One typeface throughout: Inter. No italics, no serif. */

.home {
  --serif: var(--sans);
}

.home .page {
  height: auto;
  min-height: 100svh;
  overflow: visible;
}

.home main {
  justify-content: center;
  gap: clamp(2.25rem, 6vh, 4rem);
  padding: clamp(1.5rem, 4vh, 2.5rem) 0;
}

.glow-ctmri {
  top: 30vh;
  right: -28vmax;
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle at center, rgba(70, 120, 230, 0.5) 0%, rgba(110, 163, 230, 0.2) 38%, transparent 70%);
  animation: breathe-b 26s ease-in-out infinite reverse;
}

body[data-lean="ctmri"] .glow-ctmri { opacity: 0.55; transform: scale(1.08); }
body[data-lean="ctmri"] .glow-sono,
body[data-lean="ctmri"] .glow-dicom { opacity: 0.16; }
body[data-lean="sono"] .glow-ctmri,
body[data-lean="dicom"] .glow-ctmri { opacity: 0.16; }

/* ---------- Masthead ---------- */

.masthead {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand {
  margin: 0;
  width: 100%;
  font-family: var(--sans);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(2.6rem, 14.2vw, 19rem);
  line-height: 1;
  letter-spacing: -0.05em;
  padding-bottom: 0.08em;
}

.brand span {
  display: inline-block;
  /* Descender room: gradient text is clipped to its box */
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
  background: linear-gradient(120deg, #00e5b0 0%, #00d4ff 28%, #5aa9ff 50%, #00d4ff 72%, #00e5b0 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: brand-shift 9s ease-in-out infinite;
  filter: drop-shadow(0 0 0.28em rgba(0, 229, 176, 0.22));
}

@keyframes brand-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.lede {
  margin: clamp(0.5rem, 1.6vh, 1.1rem) 0 0;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--text);
}

.sublede {
  margin: 0.6rem 0 0;
  max-width: 34rem;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.6;
  color: var(--text-soft);
  text-wrap: balance;
}

/* ---------- Cards ---------- */

.tiles {
  width: 100%;
  max-width: 68rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.tiles > li {
  display: flex;
}

.tile {
  --glow: 255, 255, 255;
  position: relative;
  isolation: isolate;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.1rem, 2vw, 1.5rem);
  padding: clamp(1.5rem, 2.6vw, 2.1rem) clamp(1.1rem, 2vw, 1.75rem) clamp(1.3rem, 2.2vw, 1.75rem);
  border-radius: 28px;
  text-decoration: none;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--hairline);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 30px 60px -32px rgba(0, 0, 0, 0.7);
  transition: transform 0.8s var(--ease), border-color 0.6s ease, box-shadow 0.8s var(--ease);
}

.tile.dicom { --glow: 0, 229, 176; }
.tile.sono { --glow: 127, 195, 185; }
.tile.ctmri { --glow: 90, 150, 255; }

/* A pool of the app's own colour behind the badge */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(70% 55% at 50% 28%, rgba(var(--glow), 0.2), transparent 72%);
  opacity: 0.55;
  transition: opacity 0.9s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-6px);
  outline: none;
  border-color: rgba(var(--glow), 0.42);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 40px 80px -32px rgba(var(--glow), 0.45);
}

.tile:hover::before,
.tile:focus-visible::before {
  opacity: 1;
}

/* The badge: every logo is cropped to the same circle so the three read as a set */
.tile-media {
  position: relative;
  display: block;
  width: min(100%, 15rem);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #0b1424;
  box-shadow:
    0 0 0 1px rgba(var(--glow), 0.35),
    0 0 0 7px rgba(var(--glow), 0.08),
    0 24px 48px -16px rgba(var(--glow), 0.5);
  transition: transform 1s var(--ease), box-shadow 0.8s var(--ease);
}

.tile-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sono's artwork has a thin white margin around its disc; trim it */
.tile.sono .tile-media img {
  transform: scale(1.06);
}

.tile:hover .tile-media,
.tile:focus-visible .tile-media {
  transform: scale(1.03);
  box-shadow:
    0 0 0 1px rgba(var(--glow), 0.6),
    0 0 0 9px rgba(var(--glow), 0.14),
    0 30px 56px -16px rgba(var(--glow), 0.65);
}

.tile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
}

.tile-name {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 650;
  font-size: clamp(1.5rem, 2.3vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text);
}

.tile-tag {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  line-height: 1.5;
  color: var(--text-soft);
}

.tile-go {
  margin-top: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  transition: background-color 0.6s ease, border-color 0.6s ease, gap 0.6s var(--ease);
}

.tile-go svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.6s var(--ease);
}

.tile:hover .tile-go,
.tile:focus-visible .tile-go {
  gap: 0.75rem;
  background: rgba(var(--glow), 0.16);
  border-color: rgba(var(--glow), 0.45);
}

.tile:hover .tile-go svg,
.tile:focus-visible .tile-go svg {
  transform: translateX(3px);
}

/* ---------- Footer ---------- */

.home footer {
  margin-top: clamp(1rem, 3vh, 2rem);
}

.home .dedication {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  color: var(--text-soft);
}

.home footer nav {
  font-size: 0.9rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 819px) {
  .tiles {
    grid-template-columns: 1fr;
    max-width: 24rem;
  }

  .tile-media {
    width: min(100%, 13rem);
  }
}

/* ---------- 404 ---------- */

.lost-code {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

.brand.lost-title {
  font-size: clamp(2.6rem, 11vw, 10rem);
}

.lost-go {
  margin-top: 2.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  transition: background-color 0.6s ease, border-color 0.6s ease, gap 0.6s var(--ease);
}

.lost-go svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lost-go:hover,
.lost-go:focus-visible {
  gap: 0.9rem;
  background: rgba(0, 229, 176, 0.14);
  border-color: rgba(0, 229, 176, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .brand span {
    animation: none;
  }
}
