/* F7less platform shell — Swiss Technical.
 *
 * Base styling, typography, colors, and layout tokens are provided by /swiss.css.
 * This stylesheet contains shell-specific layout and component rules.
 */

/* Shell heading sizing */
h1 {
  font-size: var(--step-4);
  letter-spacing: -0.032em;
  line-height: 0.98;
}

h2 {
  font-size: var(--step-2);
  letter-spacing: -0.02em;
}

.title--compact {
  font-size: var(--step-3);
  letter-spacing: -0.026em;
}

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

main {
  flex: 1 0 auto;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 10vw, 8rem);
}

.section:not([hidden]) + .section {
  margin-top: clamp(3rem, 7vw, 5rem);
}

.section__head {
  max-width: var(--measure);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section__head > :last-child {
  margin-bottom: 0;
}

/* ---------- Module index ---------- *
 *
 * A launcher is a table of contents, so it is set as one: an indexed list of
 * cells on a shared grid, each carrying its ordinal, its name, and the
 * hostname it answers on. The ordinal and the hostname are technical values
 * and are set in mono; the name is the only thing in the cell set in sans, so
 * the eye has one obvious place to land.
 */

.index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.module {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.5rem;
  padding: 1.35rem 1.4rem 1.25rem;
  border: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  background-color: var(--paper);
  transition: background-color 0.12s linear, color 0.12s linear;
}

.module:hover {
  background-color: var(--tint);
  color: var(--ink);
}

.module__index {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--accent);
}

.module__name {
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.module__blurb {
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
}

.module__host {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  transition: color 0.12s linear;
}

.module:hover .module__host {
  color: var(--accent);
}

/* ---------- Sign-in ---------- */

.signin {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.75rem;
}

.signin .section__head {
  margin-bottom: 0;
}

.signin .note {
  margin-top: 0;
}

.signin__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--rule);
  background-color: var(--tint);
  border-radius: 0;
  line-height: 1;
}

.preview-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  flex-shrink: 0;
}

/* The signed-out page describes the modules on the launcher's own grid, but
 * as plain cells: nothing here is a link until someone signs in. */
.features {
  align-self: stretch;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.features h2 {
  margin-bottom: 1.25rem;
}

.features .module:hover {
  background-color: var(--paper);
}

.features__note {
  margin-top: 1.5rem;
  font-size: var(--step--1);
  color: var(--ink-muted);
  line-height: 1.5;
  max-width: var(--measure);
}

.features__note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.features__note a:hover {
  color: var(--ink);
}

/* A call to action inside a module cell. It sits at the foot of the cell, and
 * is the one accent-colored thing on the card so it reads as the way in. */
.chip {
  justify-self: start;
  align-self: end;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--accent);
  border: 1px solid currentColor;
  background-color: transparent;
  transition: background-color 0.12s linear, color 0.12s linear;
}

.chip:hover {
  color: var(--paper);
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Wordmark Transformation (frictionless -> f7less) ---------- */

.wordmark-wrap {
  margin-bottom: 1.5rem;
  user-select: none;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-sans);
  font-size: clamp(2.4rem, 1.8rem + 3.2vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  outline: none;
}

.wordmark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.wordmark__f,
.wordmark__less {
  display: inline-block;
  color: var(--ink);
  position: relative;
  z-index: 2;
}

.wordmark__stage {
  display: inline-flex;
  align-items: baseline;
  position: relative;
  vertical-align: baseline;
  overflow: visible;
  transition: width 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.wordmark__riction {
  display: inline-flex;
  align-items: baseline;
  position: relative;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

/* Individual characters of "riction" */
.melt-char {
  display: inline-block;
  transform-origin: top center;
  transition: color 0.3s ease, transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
}

/* Melt phase on characters */
.wordmark.is-melting .melt-char {
  animation: meltAway 0.58s cubic-bezier(0.35, 0, 0.25, 1) forwards;
  animation-delay: calc(var(--ci) * 20ms);
}

@keyframes meltAway {
  0% {
    transform: translateY(0) scale(1);
    filter: blur(0) drop-shadow(0 0 0 rgba(34, 211, 238, 0));
    color: var(--ink);
    opacity: 1;
  }
  25% {
    transform: translateY(2px) scaleY(1.15) scaleX(0.95);
    filter: blur(0.5px) drop-shadow(0 0 8px rgba(34, 211, 238, 0.9));
    color: #22d3ee;
    opacity: 0.95;
  }
  60% {
    transform: translateY(16px) scaleY(1.8) scaleX(0.7) skewX(-6deg);
    filter: blur(4px) drop-shadow(0 4px 14px rgba(14, 116, 144, 0.8));
    color: #0e7490;
    opacity: 0.5;
  }
  100% {
    transform: translateY(32px) scaleY(2.4) scaleX(0.3) skewX(-12deg);
    filter: blur(8px) drop-shadow(0 8px 20px rgba(14, 116, 144, 0));
    color: #0e7490;
    opacity: 0;
  }
}

/* Melting drips */
.melt-drips {
  position: absolute;
  top: 60%;
  left: 0;
  width: 100%;
  height: 40px;
  pointer-events: none;
  overflow: visible;
}

.melt-drip {
  position: absolute;
  top: 0;
  width: 3px;
  height: 8px;
  background: linear-gradient(180deg, #22d3ee, #0e7490);
  opacity: 0;
}

.wordmark.is-melting .melt-drip {
  animation: dripFall 0.65s ease-in forwards;
  animation-delay: calc(var(--di) * 40ms + 0.1s);
}

@keyframes dripFall {
  0% {
    opacity: 0;
    transform: translateY(0) scaleY(0.5);
  }
  30% {
    opacity: 0.9;
    transform: translateY(8px) scaleY(1.5);
  }
  75% {
    opacity: 0.7;
    transform: translateY(24px) scaleY(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(38px) scaleY(0.4);
  }
}

/* The stylized "7" taking cues from the logo */
.wordmark__seven {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, 0) scale(0.4);
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
}

.seven-glyph {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 800;
  background: linear-gradient(135deg, #0e7490 0%, #22d3ee 55%, #a5f3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.55));
  transform: skewX(-6deg);
  line-height: 1;
  position: relative;
}

.seven-sheen {
  position: absolute;
  top: -2px;
  left: -20%;
  width: 140%;
  height: 45%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.1) 50%, transparent 80%);
  pointer-events: none;
  opacity: 0;
  transform: skewX(-14deg);
}

.wordmark.is-transformed .wordmark__seven {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

.wordmark.is-transformed .seven-sheen {
  animation: sheenFlash 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.1s;
}

@keyframes sheenFlash {
  0% {
    opacity: 0;
    transform: skewX(-14deg) translateX(-60%);
  }
  40% {
    opacity: 0.85;
  }
  100% {
    opacity: 0.15;
    transform: skewX(-14deg) translateX(40%);
  }
}

.wordmark.is-transformed .wordmark__riction {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.wordmark.is-transformed .melt-char {
  opacity: 0 !important;
  visibility: hidden !important;
}

.wordmark.is-transformed .melt-drips {
  opacity: 0 !important;
  visibility: hidden !important;
}

.wordmark.is-returning .wordmark__seven {
  opacity: 0;
  transform: translate(-50%, 0) scale(0.6);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.wordmark.is-returning .wordmark__riction {
  opacity: 1;
  visibility: visible;
}

.wordmark.is-returning .melt-char {
  visibility: visible;
  animation: unMelt 0.4s ease forwards;
}

@keyframes unMelt {
  0% {
    transform: translateY(-8px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.footer {
  border-top: 1px solid var(--rule);
  padding-block: 2rem;
  margin-top: auto;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer__copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.footer__copy a {
  color: var(--ink);
  border-bottom-color: var(--rule);
}

.footer__copy a:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
}

.footer__links {
  display: flex;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

.footer__links a {
  color: var(--ink-muted);
  border-bottom-color: var(--rule);
}

.footer__links a:hover,
.footer__links a[aria-current="page"] {
  color: var(--ink);
}

/* ---------- Legal pages ---------- *
 *
 * The privacy policy and terms are prose to be read, so they are set to the
 * reading measure rather than the launcher's grid.
 */

.legal {
  max-width: var(--measure);
}

.legal__date {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--ink-muted);
}

.legal h2 {
  margin-top: 2.5rem;
}

.legal h3 {
  margin-top: 1.75rem;
}

.legal li + li {
  margin-top: 0.5rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .wordmark.is-melting .melt-char,
  .wordmark.is-melting .melt-drip,
  .wordmark.is-transformed .seven-sheen,
  .wordmark.is-returning .melt-char {
    animation: none !important;
  }

  .wordmark__stage,
  .wordmark__seven,
  .wordmark__riction {
    transition: none !important;
  }
}
