/* Tough Wing — homepage
   Cloud-grey ground, slate ink, one block of brand yellow (the home screen). */

:root {
  --cloud: #edf0f2;
  --paper: #f7f8f9;
  --ink: #14202b;
  --steel: #5b6b78;
  --line: #cbd3da;
  --wing: #ffc800;
  --wing-deep: #e0a800;

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale: 1.25 ratio from 17px body */
  --step--1: 0.85rem;
  --step-0: 1.0625rem;
  --step-1: 1.33rem;
  --step-2: 1.66rem;
  --step-3: clamp(1.9rem, 1.2rem + 2.4vw, 2.6rem);
  --step-4: clamp(2.3rem, 1.2rem + 4.6vw, 4.2rem);

  --gutter: clamp(16px, 4vw, 40px);
  --measure: 62ch;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cloud) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav > a {
  text-decoration: none;
  font-weight: 500;
  color: var(--steel);
  padding-block: 6px;
}
.site-nav > a:hover {
  color: var(--ink);
}

.menu-toggle {
  display: none;
}

/* Language picker */
.lang {
  position: relative;
}

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 var(--step--1) / 1 var(--text);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-current::after {
  content: "";
  width: 6px;
  height: 6px;
  border-inline-end: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.lang-list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  min-width: 168px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20, 32, 43, 0.12);
}

.lang-list button {
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: 500 var(--step-0) / 1.2 var(--text);
  text-align: start;
  cursor: pointer;
}
.lang-list button:hover {
  background: var(--cloud);
}
.lang-list button[aria-current="true"] {
  font-weight: 600;
  background: var(--cloud);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.button-solid {
  background: var(--ink);
  color: var(--paper);
}
.button-solid:hover {
  background: #22344a;
}

.button-plain {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.button-plain:hover {
  background: var(--paper);
}

.button-store {
  min-height: 42px;
  padding: 0 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--step--1);
}
.button-store:hover {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  padding-block: clamp(40px, 8vw, 104px) clamp(56px, 9vw, 120px);
}

.hero-title {
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 13ch;
}

.hero-lede {
  margin-top: 24px;
  max-width: 44ch;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--steel);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* The one loud element: a yellow iPhone home screen */
.homescreen {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px) clamp(16px, 2.5vw, 28px);
  padding: clamp(28px, 4vw, 44px);
  background: var(--wing);
  border-radius: clamp(32px, 4vw, 48px);
  aspect-ratio: 1 / 1.08;
  align-content: center;
}

.hs-app {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.hs-app img {
  width: min(100%, 132px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 23%;
  box-shadow: 0 1px 0 rgba(20, 32, 43, 0.08), 0 10px 22px rgba(120, 80, 0, 0.22);
  transition: transform 0.18s ease;
}

.hs-app span {
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
}

.hs-app:hover img {
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: no-preference) {
  .hs-app {
    animation: settle 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  }
  .hs-app:nth-child(2) { animation-delay: 0.08s; }
  .hs-app:nth-child(3) { animation-delay: 0.16s; }
  .hs-app:nth-child(4) { animation-delay: 0.24s; }

  @keyframes settle {
    from {
      opacity: 0;
      transform: scale(0.82) translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

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

.section {
  padding-block: clamp(56px, 8vw, 104px);
  /* Hairline aligned to the content edge, not the gutter */
  background: linear-gradient(var(--line), var(--line)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head h2 {
  font-size: var(--step-3);
}

.section-head p {
  color: var(--steel);
}

/* App list */
.app-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 28px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}
.app-row:first-child {
  padding-top: 0;
}

.app-icon {
  width: 88px;
  height: 88px;
  border-radius: 23%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(20, 32, 43, 0.06);
}

.app-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.app-name-line h3 {
  font-size: var(--step-2);
}

.platform {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--steel);
}

.app-intro {
  margin-top: 6px;
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.4;
}

.app-more {
  margin-top: 12px;
  max-width: var(--measure);
}

.app-more summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--steel);
  list-style: none;
}
.app-more summary::-webkit-details-marker {
  display: none;
}
.app-more summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
  font-size: 15px;
  line-height: 1;
}
.app-more[open] summary::before {
  content: "−";
}
.app-more summary:hover {
  color: var(--ink);
}

.app-more p {
  margin-top: 12px;
  color: var(--steel);
}

.legal-links {
  display: flex;
  gap: 18px;
  font-size: var(--step--1);
}
.legal-links a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.app-row .button-store {
  align-self: center;
}

/* Unreleased projects stay blurred on purpose */
.bench {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px 48px;
  align-items: center;
  margin-top: clamp(48px, 6vw, 72px);
  padding: clamp(24px, 3vw, 36px);
  background: var(--paper);
  border-radius: 24px;
}

.bench-head h3 {
  font-size: var(--step-1);
}
.bench-head p {
  margin-top: 8px;
  color: var(--steel);
}

.bench-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bench-list li {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.bench-list img {
  width: min(100%, 120px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 23%;
  filter: blur(10px) saturate(0.8);
  transform: scale(0.92);
}

.bench-list span {
  font-weight: 600;
  font-size: var(--step--1);
  filter: blur(4px);
  user-select: none;
}

/* About */
.about-intro {
  max-width: 30ch;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.3;
}

.day-night {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(32px, 4vw, 48px);
  border-radius: 24px;
  overflow: hidden;
}

.day-night p {
  padding: clamp(24px, 3vw, 36px);
  font-size: var(--step-1);
  line-height: 1.45;
}

.day-night .day {
  background: var(--paper);
}

.day-night .night {
  background: var(--ink);
  color: var(--cloud);
}

.about-more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 48px;
  margin-top: clamp(28px, 4vw, 40px);
  color: var(--steel);
}

/* Contact */
.contact {
  padding-block: clamp(64px, 9vw, 120px);
  background: var(--ink);
  color: var(--cloud);
}

.contact h2 {
  font-size: var(--step-3);
}

.contact-lede {
  margin-top: 16px;
  max-width: 48ch;
  color: #a9b6c1;
  font-size: var(--step-1);
  line-height: 1.45;
}

.contact-mail {
  display: inline-block;
  margin-top: 32px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.25rem, 0.6rem + 3.4vw, 3rem);
  letter-spacing: -0.02em;
  color: var(--wing);
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 3px solid transparent;
}
.contact-mail:hover {
  border-bottom-color: var(--wing);
}
.contact :focus-visible {
  outline-color: var(--wing);
}

.contact-support {
  margin-top: 28px;
}
.contact-support a {
  color: var(--cloud);
  text-underline-offset: 4px;
}

/* Footer */
.site-footer {
  padding-block: 28px;
  background: var(--ink);
  color: #a9b6c1;
  border-top: 1px solid #2a3a49;
  font-size: var(--step--1);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links a {
  color: var(--cloud);
  text-decoration: none;
}
.footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer :focus-visible {
  outline-color: var(--wing);
}

/* RTL: Latin names and the wordmark keep their own direction */
[dir="rtl"] .wordmark,
[dir="rtl"] .app-name-line h3,
[dir="rtl"] .contact-mail {
  direction: ltr;
}

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .homescreen {
    max-width: 420px;
    aspect-ratio: auto;
  }
  .bench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
  }
  .menu-toggle-bar,
  .menu-toggle-bar::before,
  .menu-toggle-bar::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s ease, background 0.2s ease;
  }
  .menu-toggle-bar {
    position: relative;
  }
  .menu-toggle-bar::before,
  .menu-toggle-bar::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
  }
  .menu-toggle-bar::before { top: -6px; }
  .menu-toggle-bar::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bar { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

  .site-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--cloud);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open {
    display: flex;
  }
  .site-nav > a {
    padding-block: 14px;
    border-bottom: 1px solid var(--line);
    font-size: var(--step-1);
    color: var(--ink);
  }
  .lang {
    margin-top: 16px;
  }
  .lang-list {
    inset-inline-end: auto;
    inset-inline-start: 0;
  }

  .app-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 4px 16px;
  }
  .app-icon {
    width: 64px;
    height: 64px;
  }
  .app-row .button-store {
    grid-column: 2;
    justify-self: start;
    margin-top: 12px;
  }

  .about-intro {
    font-size: var(--step-1);
  }

  .day-night,
  .about-more {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .bench-list {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
