/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V5
 * macrostructure: Product Stage · theme: studied-DNA (source: https://dena.com/jp/ + user screenshots)
 * F5 knobs: frame=screenshot-only, anchor=three-screen · nav: N9 · footer: Ft5 Statement · v1.4.0
 * contrast: pass (40–41) · slop: pass (42–45) · honest: pass (46) · chrome: pass (47)
 * tokens: pass (48) · responsive: pass (49) · icons: pass (30) · mobile: pass (34, 49, 50–57)
 */

.nav-pill {
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  max-width: none;
  min-height: var(--nav-height-stage);
  justify-content: flex-end;
  gap: var(--space-2xl);
  padding: var(--space-sm) var(--page-gutter);
  border: 0;
  border-block-end: 0;
  border-radius: 0;
  background: var(--color-ink);
  box-shadow: none;
  transform: none;
}

.wordmark {
  margin-inline-end: auto;
  font-size: var(--text-xl);
}

.wordmark--logo {
  min-height: 0;
  gap: var(--space-sm);
  line-height: 0;
}

.wordmark--logo img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
}

.wordmark--logo .wordmark__text {
  color: var(--color-paper-on-ink);
  font-size: var(--text-xl);
  line-height: 1;
}

.nav-pill__action {
  min-height: 3rem;
  padding-inline: var(--space-lg);
  color: var(--color-paper);
  background: var(--color-ink);
}

.showcase {
  padding-block: var(--space-xl) calc(var(--space-4xl) + var(--space-lg));
  padding-block-end: 0;
  background: var(--color-paper);
}

.showcase.showcase--without-feature {
  padding-block-start: 0;
}

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

.featured-heading {
  margin-block-end: var(--space-lg);
}

.featured-heading[hidden],
.mio-feature[hidden] {
  display: none;
}

.featured-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
}

.mio-feature {
  display: grid;
  width: min(calc(100% - (var(--page-gutter) * 2)), 64rem);
  max-width: 64rem;
  grid-template-columns: minmax(0, 1.7fr) minmax(15rem, 0.62fr);
  margin-block-end: 0;
  padding-inline: 0;
  overflow: hidden;
  color: var(--color-paper-on-ink);
  background: var(--color-ink);
}

.mio-feature__media,
.mio-feature__copy {
  min-width: 0;
}

.mio-feature__media {
  display: block;
  line-height: 0;
}

.mio-feature__media img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1024 / 500;
  object-fit: cover;
}

.mio-feature__copy {
  display: flex;
  padding: var(--space-xl);
  flex-direction: column;
  justify-content: center;
  gap: var(--space-md);
  line-height: 1.8;
}

.mio-feature__label {
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mio-feature__copy > span:not(.mio-feature__label):not(.mio-feature__link) {
  color: var(--color-paper-on-ink);
  font-size: var(--text-sm);
}

.mio-feature__link {
  width: fit-content;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  border-block-end: var(--rule-bold) solid currentColor;
  font-weight: 800;
  line-height: 1;
}

.app-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "stage" "pager";
  gap: var(--space-lg);
}

.app-stage {
  grid-area: stage;
  cursor: grab;
  touch-action: pan-y;
}

.app-stage:active { cursor: grabbing; }

.app-stage img {
  user-select: none;
  -webkit-user-drag: none;
}

.stage-panel {
  --panel-art: var(--color-stage-mio);
  display: grid;
  height: clamp(43rem, calc(100svh - 9rem), 56rem);
  min-height: 0;
  grid-template-columns: minmax(15rem, 0.34fr) minmax(0, 0.66fr);
  gap: var(--space-3xl);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.stage-panel--weight { --panel-art: var(--color-stage-weight); background: transparent; }
.stage-panel--memory { --panel-art: var(--color-stage-memory); background: transparent; }
.stage-panel--night { --panel-art: var(--color-stage-night); background: transparent; }
.stage-panel--travel { --panel-art: var(--color-stage-travel); background: transparent; }

.stage-panel.is-entering { animation: stage-enter var(--dur-long) var(--ease-out) both; }

.stage-panel__copy {
  justify-content: center;
  gap: var(--space-xl);
  padding: var(--space-2xl) 0;
}

.stage-panel__heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-md);
}

.stage-panel__heading img {
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 auto;
  border-radius: 25%;
  box-shadow: none;
}

.stage-panel h2 {
  max-width: none;
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 0.98;
  overflow-wrap: normal;
  white-space: nowrap;
}

.stage-panel__copy p {
  max-width: 45ch;
  margin: 0;
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.9;
}

.stage-panel__action {
  min-height: 3.5rem;
  margin-block-start: var(--space-md);
  padding-inline: var(--space-xl);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
}

.stage-panel__visual {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 43rem;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--panel-art);
  isolation: isolate;
}

.stage-panel__visual > .stage-panel__art {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  transform: none;
  box-shadow: none;
}

.app-tabs {
  grid-area: pager;
  display: flex;
  gap: clamp(var(--space-2xs), 1vw, var(--space-sm));
  width: clamp(16rem, 44vw, 34rem);
  margin-inline: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.app-tab {
  position: relative;
  display: block;
  width: auto;
  min-width: 2.75rem;
  min-height: 2.75rem;
  flex: 1 1 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: transparent;
  background: transparent;
  box-shadow: none;
  font-size: 0;
}

.app-tab::before,
.app-tab::after {
  position: absolute;
  inset-inline: 0;
  inset-block-start: 50%;
  height: 2px;
  content: "";
  background: var(--color-rule);
}

.app-tab::after {
  background: var(--color-ink);
  transform: scaleX(0);
  transform-origin: left;
}

.app-tab.is-selected {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-tab.is-selected::after { transform: scaleX(1); }

.app-tab:focus-visible {
  outline: 0;
}

.app-tab:focus-visible::before {
  height: 4px;
  background: var(--color-focus);
}

.app-tab img,
.app-tab span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.news-section,
.studio-note { background: var(--color-paper-2); }

.news-section { padding-block: var(--space-lg) var(--space-xl); }

.news-section header > p { color: var(--color-ink); }

.studio-note h2 {
  max-width: none;
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  overflow-wrap: normal;
  white-space: nowrap;
}

.showcase > .studio-note {
  margin-block-end: var(--space-2xl);
}

.app-shelf {
  padding-block: var(--space-xl);
  border-block: var(--rule-hair) solid var(--color-rule-strong);
  background: color-mix(in oklch, var(--color-purple-tint) 40%, var(--color-paper));
}

.app-shelf .shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "heading nav" "carousel carousel";
  align-items: end;
  gap: var(--space-lg) var(--space-xl);
}

.shelf-heading {
  grid-area: heading;
  display: flex;
  margin: 0;
  align-items: baseline;
  justify-content: flex-start;
  gap: var(--space-lg);
}

.news-section h2,
.shelf-heading h2 {
  flex: 0 0 auto;
  font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
  line-height: 1;
  letter-spacing: -0.045em;
}

.app-carousel {
  position: relative;
  grid-area: carousel;
  min-width: 0;
}

.app-grid {
  display: grid;
  grid-auto-columns: clamp(14rem, 21vw, 18rem);
  grid-auto-flow: column;
  grid-template-columns: none;
  gap: var(--space-lg);
  overflow-x: auto;
  padding-block-end: 0;
  overscroll-behavior-inline: contain;
  scroll-snap-type: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.app-grid::-webkit-scrollbar { display: none; }

.app-card,
.app-card:nth-child(2),
.app-card:nth-child(3),
.app-card:nth-child(4),
.app-card:nth-child(5) {
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  scroll-snap-align: none;
  transform: none;
}

.app-card > a {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "icon icon" "name arrow";
  align-items: center;
  gap: var(--space-sm);
  padding: 0 0 var(--space-sm);
}

.app-card > a > img {
  grid-area: icon;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 0;
  background: transparent;
  object-fit: cover;
}

.app-card > a > span:first-of-type {
  grid-area: name;
  gap: 0;
}

.app-card > a > span:last-child {
  grid-area: arrow;
  align-self: center;
}

.app-card strong {
  font-size: var(--text-md);
  line-height: 1.2;
  overflow-wrap: normal;
  white-space: nowrap;
}

.shelf-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-lg);
}

.shelf-more {
  min-height: 2.75rem;
  margin: 0;
  align-self: end;
}

.shelf-arrows {
  position: absolute;
  inset-block-start: 50%;
  inset-inline: calc(var(--space-lg) * -1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}

.shelf-arrows button {
  display: grid;
  width: 3.5rem;
  min-width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--color-paper);
  background: var(--color-ink-soft);
  font-size: var(--text-lg);
  cursor: pointer;
  pointer-events: auto;
  transition: color var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out);
}

.shelf-arrows button:active {
  color: var(--color-paper);
  background: var(--color-ink);
}

.shelf-arrows button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.shelf-arrows button:disabled {
  cursor: not-allowed;
  color: var(--color-paper);
  background: var(--color-ink-soft);
  opacity: 0;
}

.site-footer {
  padding-block: var(--space-xl) max(var(--space-xl), env(safe-area-inset-bottom));
}

.app-card > a[aria-busy="true"] {
  cursor: wait;
  opacity: 0.72;
}

.app-card > a[data-state="error"] { color: var(--color-accent-deep); }

.app-card > a[data-state="success"] { color: var(--color-mint-deep); }

.app-card > a:active { background: var(--color-paper-3); }

@media (hover: hover) and (pointer: fine) {
  .app-card:hover,
  .app-card:focus-within { transform: none; }
  .app-card > a:hover img { opacity: 0.88; }
  .shelf-arrows button:hover {
    color: var(--color-paper);
    background: var(--color-ink);
  }
}

@keyframes stage-enter {
  from { opacity: 0; transform: translateX(var(--space-md)); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 59.99rem) {
  .nav-pill { gap: var(--space-lg); }
  .stage-panel {
    height: 40rem;
    min-height: 40rem;
    grid-template-columns: minmax(0, 0.38fr) minmax(0, 0.62fr);
    gap: var(--space-xl);
  }
  .stage-panel__visual { min-height: 37rem; }
}

@media (max-width: 47.99rem) {
  .site-header,
  .nav-pill { min-height: var(--nav-height-stage-mobile); }
  .nav-pill { padding-block: var(--space-2xs); }
  .wordmark--logo { gap: var(--space-xs); }
  .wordmark--logo img { width: 1.75rem; height: 1.75rem; }
  .wordmark--logo .wordmark__text { font-size: var(--text-sm); }
  .showcase { padding-block: var(--space-lg) 0; }
  .mio-feature {
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
    margin-block: 0;
    padding-inline: 0;
    color: var(--color-ink);
    background: var(--color-paper);
  }
  .mio-feature__media { position: relative; z-index: 0; }
  .mio-feature__copy {
    position: relative;
    z-index: 1;
    margin-block-start: calc(var(--space-lg) * -1);
    padding: var(--space-xl) var(--page-gutter) var(--space-lg);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    background: color-mix(in oklch, var(--color-paper) 88%, var(--color-pink-tint));
  }
  .mio-feature__label { color: var(--color-accent-deep); }
  .mio-feature__copy > span:not(.mio-feature__label):not(.mio-feature__link) { color: var(--color-ink-soft); }
  .mio-feature__link { color: var(--color-ink); }
  .app-switcher { padding-inline: var(--page-gutter); }
  .stage-panel {
    height: calc(10rem + clamp(20rem, calc(100vw - (var(--page-gutter) * 2)), 26rem));
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 10rem clamp(20rem, calc(100vw - (var(--page-gutter) * 2)), 26rem);
    gap: 0;
  }
  .stage-panel__copy { gap: var(--space-md); padding: 0; }
  .stage-panel__heading { gap: var(--space-sm); }
  .stage-panel__heading img { width: 3rem; height: 3rem; }
  .stage-panel h2 { font-size: clamp(2.35rem, 10.5vw, 3.5rem); }
  .stage-panel__copy p { margin-block-start: var(--space-sm); font-size: var(--text-base); line-height: 1.75; }
  .stage-panel__action { width: fit-content; margin-block-start: var(--space-sm); }
  .stage-panel__visual { min-height: 0; }
  .stage-panel__visual > .stage-panel__art { height: 100%; }
  .app-tabs { width: min(100%, 22rem); }
  .app-shelf .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "heading" "nav" "carousel";
    gap: var(--space-md);
  }
  .app-grid {
    width: calc(100% + var(--page-gutter));
    grid-auto-columns: minmax(12rem, 68vw);
  }
  .shelf-nav { justify-content: space-between; }
  .shelf-arrows { inset-inline: 0 var(--page-gutter); }
}

@media (max-width: 39.99rem) {
  .studio-note h2 { font-size: clamp(1.5rem, 7vw, 2rem); }
}

@media (prefers-reduced-motion: reduce) {
  .stage-panel.is-entering { animation: none; }
  .app-tab.is-selected::after { transform: scaleX(1); }
}
