:root {
  --color-bg: #ffffff;
  --color-fg: #1d1d1f;
  --color-secondary: #6e6e73;
  --color-tertiary: #86868b;
  --color-accent: #5856d6;
  --color-accent-bright: #6e6cff;
  --color-card: #f5f5f7;
  --color-card-border: rgba(0, 0, 0, 0.06);
  --color-divider: rgba(0, 0, 0, 0.08);
  --gradient-hero: radial-gradient(ellipse at top, rgba(88, 86, 214, 0.18) 0%, rgba(88, 86, 214, 0) 60%);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 4px 12px rgba(88, 86, 214, 0.18), 0 12px 36px rgba(88, 86, 214, 0.16);
  --radius-card: 20px;
  --radius-icon: 22px;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro JP", "Hiragino Sans", "Yu Gothic Medium", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000000;
    --color-fg: #f5f5f7;
    --color-secondary: #aeaeb2;
    --color-tertiary: #8e8e93;
    --color-accent: #8485ef;
    --color-accent-bright: #a4a3ff;
    --color-card: #1c1c1e;
    --color-card-border: rgba(255, 255, 255, 0.08);
    --color-divider: rgba(255, 255, 255, 0.1);
    --gradient-hero: radial-gradient(ellipse at top, rgba(132, 133, 239, 0.18) 0%, rgba(132, 133, 239, 0) 60%);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 4px 12px rgba(132, 133, 239, 0.3), 0 12px 36px rgba(132, 133, 239, 0.2);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-display);
  background: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.005em;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-accent-bright);
}

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

code {
  font-family: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--color-bg) 80%, transparent);
  border-bottom: 1px solid var(--color-divider);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  height: 36px;
}

.brand img {
  display: block;
  height: 100%;
  width: auto;
}

@media (prefers-color-scheme: dark) {
  .brand img {
    filter: invert(1) hue-rotate(180deg);
  }
}

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

.site-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-secondary);
}

.site-nav a:hover {
  color: var(--color-fg);
}

/* Hero */
.hero {
  position: relative;
  padding: 120px 0 80px;
  text-align: center;
  background: var(--gradient-hero);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  background: linear-gradient(135deg, var(--color-fg) 30%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  max-width: 640px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--color-secondary);
  line-height: 1.7;
}

/* Sections */
section.block {
  padding: 80px 0;
}

section.block.alt {
  background: color-mix(in srgb, var(--color-card) 60%, var(--color-bg));
}

.section-head {
  margin-bottom: 48px;
  text-align: left;
}

.section-head .kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}

.section-head .lead {
  color: var(--color-secondary);
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

section.block h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}

section.block .lead {
  color: var(--color-secondary);
  margin: 0 0 48px;
  font-size: 1.05rem;
}

/* App grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.app-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  color: inherit;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-card-border));
}

.app-card .icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-icon);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: linear-gradient(145deg, var(--color-accent), var(--color-accent-bright));
  color: white;
  box-shadow: 0 6px 16px rgba(88, 86, 214, 0.3);
  flex-shrink: 0;
}

.app-card .icon:has(img) {
  background: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  border-radius: 22.37%;
}

.app-card .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.app-card .card-head .icon {
  margin-bottom: 0;
}

.app-card .os-req {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-tertiary);
  white-space: nowrap;
}

.app-card.coming .icon {
  background: linear-gradient(145deg, var(--color-card-border), var(--color-divider));
  color: var(--color-tertiary);
  box-shadow: none;
}

.app-card h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-card .kind {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-accent);
}

.app-card.coming .kind {
  color: var(--color-tertiary);
}

.app-card .desc {
  font-size: 0.92rem;
  color: var(--color-secondary);
  line-height: 1.55;
  margin: 0 0 16px;
  flex: 1;
}

.app-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-accent);
  align-self: flex-start;
  letter-spacing: 0.02em;
}

.app-card.coming .badge {
  background: var(--color-divider);
  color: var(--color-tertiary);
}

/* App detail page */
.app-hero {
  text-align: center;
  padding: 80px 0 40px;
  background: var(--gradient-hero);
}

.app-hero .icon-large {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  border-radius: 28px;
  background: linear-gradient(145deg, var(--color-accent), var(--color-accent-bright));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: white;
  box-shadow: 0 12px 32px rgba(88, 86, 214, 0.36);
}

.app-hero .icon-large:has(img) {
  background: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  border-radius: 22.37%;
}

.app-hero .icon-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-hero .kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.app-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-hero .tagline {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--color-secondary);
  margin: 0 0 32px;
}

.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: white !important;
}

.btn-primary:hover {
  background: var(--color-accent-bright);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-card);
  color: var(--color-fg) !important;
  border: 1px solid var(--color-card-border);
}

.btn-secondary:hover {
  background: var(--color-divider);
}

.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}

.btn-text {
  align-self: center;
  font-size: 0.85rem;
  color: var(--color-fg);
  opacity: 0.65;
  text-decoration: underline;
  text-decoration-color: var(--color-card-border);
  text-underline-offset: 3px;
}

.btn-text:hover {
  opacity: 1;
}

/* Feature list */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.feature {
  padding: 24px;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 16px;
}

.feature .symbol {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--color-accent);
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.feature p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-secondary);
  line-height: 1.6;
}

/* Screenshots */
.shots {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 24px;
  margin: 0 -4px;
  scrollbar-width: thin;
}

.shots::-webkit-scrollbar {
  height: 8px;
}

.shots::-webkit-scrollbar-thumb {
  background: var(--color-card-border);
  border-radius: 4px;
}

.shot {
  flex: 0 0 240px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shot-frame {
  width: 240px;
  aspect-ratio: 9 / 19.5;
  border-radius: 36px;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.shot-frame.placeholder {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 14%, var(--color-card)) 0%, var(--color-card) 60%);
  color: var(--color-tertiary);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.shot-frame.placeholder::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: var(--color-bg);
  border-radius: 12px;
  opacity: 0.5;
}

/* Mac-style window frame */
.shot-frame.mac {
  aspect-ratio: 16 / 10;
  width: 360px;
  border-radius: 12px;
}

.shot-frame.mac.placeholder::before {
  content: "● ● ●";
  position: absolute;
  top: 8px;
  left: 12px;
  width: auto;
  height: auto;
  background: transparent;
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--color-tertiary);
  opacity: 0.6;
  border-radius: 0;
  transform: none;
}

.shot:has(.shot-frame.mac) {
  flex: 0 0 360px;
}

@media (max-width: 600px) {
  .shot-frame.mac { width: 280px; }
  .shot:has(.shot-frame.mac) { flex: 0 0 280px; }
}

.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot .caption {
  margin: 12px 4px 0;
  font-size: 0.88rem;
  color: var(--color-secondary);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .shot { flex: 0 0 200px; }
  .shot-frame { width: 200px; border-radius: 30px; }
}

/* Prose (privacy policy etc.) */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 0;
}

.prose h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prose .updated {
  color: var(--color-tertiary);
  font-size: 0.88rem;
  margin: 0 0 40px;
}

.prose h2 {
  font-size: 1.25rem;
  margin: 36px 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prose p,
.prose li {
  color: var(--color-fg);
  font-size: 0.97rem;
  line-height: 1.75;
}

.prose ul {
  padding-left: 22px;
}

.prose ul li {
  margin-bottom: 6px;
}

.prose .secondary {
  color: var(--color-secondary);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-divider);
  padding: 40px 0 56px;
  margin-top: 80px;
  color: var(--color-tertiary);
  font-size: 0.85rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer .links {
  display: flex;
  gap: 20px;
}

.site-footer a {
  color: var(--color-tertiary);
}

.site-footer a:hover {
  color: var(--color-fg);
}

.chart-figure {
  margin: 32px auto 0;
  color: var(--color-fg);
  max-width: 820px;
}

.chart-figure svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--color-fg);
}

.chart-figure svg text {
  fill: currentColor;
}

.chart-figure svg line {
  stroke: currentColor;
  fill: none;
}

.chart-figure .axis line {
  stroke-opacity: 0.7;
  stroke-width: 1.5;
}

.chart-figure .grid line {
  stroke-opacity: 0.2;
  stroke-width: 1;
}

.chart-figure .label {
  fill-opacity: 0.85;
  font-size: 13px;
}

.chart-figure .label-title {
  font-size: 15px;
  font-weight: 600;
}

.chart-figure .opus-dot {
  fill: var(--color-accent);
  stroke: var(--color-bg);
  stroke-width: 2;
}

.chart-figure .other-dot {
  fill: currentColor;
  fill-opacity: 0.55;
}

.chart-figure .dot-label {
  fill-opacity: 0.9;
  font-size: 12px;
}

.chart-figure .dot-label.opus {
  fill: var(--color-accent);
  fill-opacity: 1;
  font-weight: 600;
}

.chart-figure .better-hint {
  fill: var(--color-accent);
  font-size: 13.5px;
  font-weight: 600;
}

.chart-figure figcaption {
  margin-top: 16px;
  color: var(--color-secondary);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.55;
}

/* Listen & Compare table (OpusPlay) */
.listen-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 8px 0 24px;
}

.listen-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 16px;
  overflow: hidden;
}

.listen-table thead th {
  text-align: left;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-tertiary);
  padding: 14px 18px;
  background: color-mix(in srgb, var(--color-divider) 30%, transparent);
  border-bottom: 1px solid var(--color-divider);
}

.listen-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-divider);
  vertical-align: middle;
}

.listen-table tbody tr:last-child td {
  border-bottom: none;
}

.listen-table .s-name {
  font-weight: 600;
  color: var(--color-fg);
  font-size: 0.98rem;
  line-height: 1.35;
}

.listen-table .s-meta {
  font-size: 0.78rem;
  color: var(--color-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.listen-table .badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: 2px;
}

.listen-table .badge-muted {
  background: color-mix(in srgb, var(--color-secondary) 14%, transparent);
  color: var(--color-secondary);
}

.listen-table th.num,
.listen-table td.num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.listen-table .ratio {
  display: block;
  font-size: 0.74rem;
  color: var(--color-tertiary);
  font-weight: 400;
  margin-top: 2px;
}

.listen-table .pesq {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-fg);
}

.listen-table tr.row-highlight {
  background: color-mix(in srgb, var(--color-accent) 6%, transparent);
}

.listen-table tr.row-highlight .pesq {
  color: var(--color-accent);
}

.listen-table audio {
  width: 280px;
  height: 36px;
  max-width: 100%;
  display: block;
}

.listen-note {
  font-size: 0.85rem;
  color: var(--color-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Contact card (About) */
.contact-card {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}

.contact-line {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-line a {
  color: var(--color-accent);
}

.contact-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.contact-note {
  font-size: 0.9rem;
  color: var(--color-secondary);
  line-height: 1.7;
  margin: 0 0 12px;
}

.contact-note:last-child {
  margin-bottom: 0;
}

/* Changelog list (Privacy) */
.changelog {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-secondary);
}

.changelog li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-divider);
}

.changelog li:last-child {
  border-bottom: none;
}

.changelog strong {
  color: var(--color-fg);
  margin-right: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

@media (max-width: 600px) {
  .hero { padding: 80px 0 56px; }
  section.block { padding: 56px 0; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 0.86rem; }
  .chart-figure figcaption { font-size: 0.8rem; }
  .listen-table { min-width: 600px; }
  .listen-table thead th,
  .listen-table tbody td { padding: 12px 14px; }
  .listen-table audio { width: 240px; }
}
