:root {
  color-scheme: light;
  --background: #F5F7FB;
  --surface: #FFFFFF;
  --text: #14213A;
  --secondary: #52617A;
  --accent: #2454CF;
  --border: #DCE4F0;
  --radius: 12px;
  --content: 1120px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; min-width: 320px; background: var(--background); color: var(--text); line-height: 1.5; overflow-x: clip; }
a { color: inherit; text-underline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #93B4FF; outline-offset: 2px; }
.wrap { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }

.topbar { position: sticky; z-index: 10; top: 0; height: 56px; background: rgb(255 255 255 / 97%); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; height: 56px; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; flex: 0 1 auto; align-items: center; min-width: 0; text-decoration: none; }
.brand img { display: block; width: 148px; max-height: 48px; object-fit: contain; object-position: left center; }
.nav { display: flex; flex: 0 0 auto; align-items: center; gap: 22px; color: var(--secondary); font-size: 13px; }
.nav a { padding: 4px 0; font-weight: 600; text-decoration: none; transition: color 160ms ease; }
.nav [aria-current="page"] { color: var(--accent); }
.nav a:hover, .text-link:hover { color: var(--accent); text-decoration: underline; }

.hero {
  margin-top: 18px;
  padding: clamp(16px, 3vw, 29px);
  border: 1px solid #D7E3FA;
  border-radius: 16px;
  background: radial-gradient(ellipse at 100% 0%, #E2EBFF, transparent 65%), #F9FBFF;
}
.home-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.hero-copy { flex: 1 1 440px; max-width: 670px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1 { max-width: 600px; margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.14; letter-spacing: -.045em; font-weight: 680; }
.hero-description { max-width: 600px; margin: 9px 0 0; color: var(--secondary); font-size: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 650; text-decoration: none; transition: border-color 160ms ease, background 160ms ease, color 160ms ease; }
.button:hover { border-color: #A1A1AA; }
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button-primary:hover { border-color: #1D4ED8; background: #1D4ED8; color: #fff; }

.catalog { padding-block: 20px 30px; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.catalog-heading h2, .section-title { margin: 0; font-size: 20px; line-height: 1.25; letter-spacing: -.025em; font-weight: 650; }
.catalog-count { margin: 0; color: var(--secondary); font-size: 12px; }
.app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.app-card { display: flex; min-width: 0; min-height: 145px; flex-direction: column; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 2px 4px rgb(20 33 58 / 4%); transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.app-card:hover { transform: translateY(-2px); border-color: #C4C4CC; box-shadow: 0 3px 10px rgb(24 24 27 / 5%); }
.app-card[hidden] { display: none; }
.app-head { display: flex; min-width: 0; align-items: center; gap: 9px; }
.app-icon { display: block; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid rgb(24 24 27 / 5%); border-radius: 9px; object-fit: cover; background: #F4F4F5; }
.app-identity { min-width: 0; }
.app-card h3 { overflow-wrap: anywhere; margin: 0; font-size: 14px; line-height: 1.25; letter-spacing: -.015em; font-weight: 650; }
.app-category { display: block; margin-top: 3px; color: var(--secondary); font-size: 11px; line-height: 1.25; }
.app-card p { margin: 9px 0; color: var(--secondary); font-size: 13px; line-height: 1.4; }
.text-link { width: fit-content; margin-top: auto; color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; transition: color 160ms ease; }
.empty-state { margin: 14px 0; color: var(--secondary); font-size: 13px; }

.details { padding-block: 22px 27px; border-top: 1px solid var(--border); }
.details-intro { margin: 5px 0 10px; color: var(--secondary); font-size: 12px; }
.details-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; }
.app-detail { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); scroll-margin-top: 68px; }
.app-detail summary { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.app-detail summary::-webkit-details-marker { display: none; }
.app-detail summary::after { content: "+"; color: var(--accent); font-size: 17px; font-weight: 400; }
.app-detail[open] summary::after { content: "−"; }
.detail-body { padding: 0 12px 11px; color: var(--secondary); font-size: 13px; }
.detail-body p { margin: 0 0 6px; }
.detail-links { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-links a { color: var(--accent); font-size: 12px; font-weight: 600; }

.web-project { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 13px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.web-project p { margin: 0; color: var(--secondary); font-size: 12px; }
.web-project strong { color: var(--text); font-weight: 650; }
.about { display: flex; align-items: baseline; gap: 12px; padding-block: 18px; }
.about .section-title { flex: 0 0 auto; font-size: 15px; }
.about p { margin: 0; color: var(--secondary); font-size: 12px; }
.footer { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); color: var(--secondary); font-size: 11px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 15px; }
.footer a { text-decoration: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 900px) {
  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .wrap { width: min(calc(100% - 28px), var(--content)); }
  .topbar-inner { gap: 8px; }
  .brand img { width: 116px; max-height: 42px; }
  .nav { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; font-size: 11px; }
  .nav a { white-space: nowrap; }
  .hero { margin-top: 12px; }
  h1 { font-size: 29px; }
  .hero-description { font-size: 13px; }
  .catalog { padding-block: 17px 22px; }
  .catalog-heading h2 { font-size: 18px; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .app-card { min-height: 148px; padding: 11px; }
  .app-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .app-head { gap: 7px; }
  .app-card h3 { font-size: 13px; }
  .app-card p { font-size: 12px; }
  .details-list { grid-template-columns: minmax(0, 1fr); }
  .about { display: block; padding-block: 14px; }
  .about .section-title { margin-bottom: 4px; }
  .footer { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 10px; }
}
@media (max-width: 360px) {
  .wrap { width: calc(100% - 24px); }
  .brand img { width: 100px; }
  .nav { column-gap: 9px; font-size: 10px; }
  .app-card { padding: 9px; }
  .app-icon { width: 32px; height: 32px; flex-basis: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Studio homepage */
.home {
  --background: #f2f6f5;
  --text: #14262c;
  --secondary: #495e64;
  --accent: #006458;
  --border: #d8e4e1;
  --radius: 14px;
  --content: 1140px;
}

.home .home-hero {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid #254b50;
  border-radius: 22px;
  background: radial-gradient(ellipse at 100% 0%, #235953, transparent 72%), #12272e;
  color: #f7fcfb;
}

.home h1 {
  max-width: 580px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 720;
  line-height: 1.04;
  text-wrap: balance;
}

.home .hero-description { color: #c4d8d5; }
.home .button { min-height: 44px; border-radius: 10px; }
.home .button-primary { border-color: #a2ead8; background: #a2ead8; color: #12352e; }
.home .button-primary:hover { border-color: #c8f5e8; background: #c8f5e8; }

.home .catalog-heading { align-items: baseline; }
.home .catalog-heading h2 { font-size: clamp(22px, 3vw, 28px); }
.home .catalog-filters {
  display: grid;
  width: min(100%, 340px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.home .catalog-filter { position: relative; min-width: 0; }

.home .catalog-filter > span {
  position: absolute;
  top: 7px;
  inset-inline-start: 11px;
  color: var(--secondary);
  font-size: 10px;
  font-weight: 650;
  pointer-events: none;
}

.home .catalog-filter::after {
  position: absolute;
  top: 50%;
  inset-inline-end: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--secondary);
  border-bottom: 1.5px solid var(--secondary);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  content: "";
}

.home .catalog-filter select {
  display: block;
  appearance: none;
  width: 100%;
  min-height: 49px;
  padding: 20px 26px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.home .catalog-filter select:hover { border-color: #9cbab3; }

.home .catalog-filter select:has(option:checked:not([value="all"])) {
  border-color: #9fc8be;
  background: #e8f4f0;
}

.home .catalog-filter select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.home .app-card {
  min-height: 0;
  padding-block: 11px 4px;
  box-shadow: 0 1px 3px rgb(20 38 44 / 5%);
}
.home .app-card:hover, .home .app-card:focus-within { border-color: #94b6af; }
.home .app-head { align-items: flex-start; }
.home .app-icon { border-radius: 11px; }
.home .app-card h3 { font-weight: 700; }
.home .app-card p { margin-block: 8px 7px; }
.home .app-card .text-link, .home .store-link { display: inline-flex; min-height: 44px; align-items: center; gap: 4px; }
.home .app-detail-link { min-width: 44px; color: var(--accent); }
.home .app-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.home .app-actions .app-detail-link { justify-content: center; margin: 0; }
.home .app-actions .app-detail-link:only-child { justify-content: flex-start; }
.home .store-link {
  padding-inline: 7px;
  border: 1px solid #c9e1db;
  border-radius: 9px;
  background: #f4faf8;
  color: var(--accent);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.home .store-link:hover { background: #d3ece5; text-decoration: underline; }
.home .app-actions .store-link { border-color: transparent; background: transparent; }
.home .app-actions .store-link:hover { background: #e5f3ef; }

@media (max-width: 360px) {
  .home .app-actions .store-link { padding-inline: 4px; font-size: 11px; }
}

.home .details .section-title { margin-bottom: 10px; }
.home .details-list { align-items: start; }
.home .app-detail { border-radius: 11px; scroll-margin-top: 0; }
.home .app-detail summary { min-height: 44px; }
.home .app-detail:target { border-color: var(--accent); }
.home .detail-links a { display: inline-flex; min-height: 44px; align-items: center; }

.home .test-age { margin: 0 0 7px; color: var(--accent); }
