:root {
  --ink: #141414;
  --paper: #f7f7f5;
  --panel-bg: #ececea;
  --title: #ffffff;
  --focus: #2f6bff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Syne", "Segoe UI", sans-serif;
  --split-at: 900px;
  --bar-height: 5.25rem;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Mobile: stacked top / bottom */
.hub {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  flex: 1 1 auto;
  min-height: 0;
}

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  background: var(--panel-bg);
  min-height: 0;
}

.panel__web {
  position: relative;
  flex: 1 1 auto;
  display: block;
  min-height: 0;
  text-decoration: none;
  outline: none;
  cursor: pointer;
}

.panel__web:focus-visible {
  box-shadow: inset 0 0 0 3px var(--focus);
  z-index: 1;
}

.panel__media {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  transform: scale(1.02);
  transition: transform 520ms var(--ease), filter 520ms var(--ease);
}

.panel--codoku .panel__media {
  background-image: url("assets/codoku.png");
}

.panel--matchcolors .panel__media {
  background-image: url("assets/matchcolors.png");
  background-position: center center;
}

.panel__web::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.35) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
  transition: opacity 320ms var(--ease);
}

.panel__cta {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.panel__cta-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}

.panel__cta-label::before {
  content: "▶";
  font-size: 0.75rem;
  line-height: 1;
}

.panel:hover .panel__cta-label,
.panel__web:focus-visible .panel__cta-label {
  transform: scale(1.04);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
}

.panel__web::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(20, 20, 20, 0);
  pointer-events: none;
  transition: background 320ms var(--ease);
}

.panel:hover .panel__web::before,
.panel__web:focus-visible::before {
  background: rgba(20, 20, 20, 0.18);
}

.panel__bar {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem 1rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

.panel__title {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--title);
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
  transform: translateY(6px);
  opacity: 0;
  animation: title-in 700ms var(--ease) forwards;
}

.panel--matchcolors .panel__title {
  animation-delay: 120ms;
}

.panel__title:hover,
.panel__title:focus-visible {
  text-decoration: underline;
  outline: none;
}

.panel__store {
  flex-shrink: 0;
  display: block;
  line-height: 0;
  opacity: 0;
  transform: translateY(6px);
  animation: title-in 700ms var(--ease) 80ms forwards;
  transition: transform 220ms var(--ease), opacity 220ms var(--ease);
}

.panel--matchcolors .panel__store {
  animation-delay: 200ms;
}

.panel__store:hover,
.panel__store:focus-visible {
  transform: scale(1.04);
  outline: none;
}

.panel__store:focus-visible {
  box-shadow: 0 0 0 3px var(--focus);
  border-radius: 4px;
}

.panel__store-badge {
  display: block;
  width: auto;
  height: 36px;
}

.panel:hover .panel__media,
.panel__web:focus-visible .panel__media {
  transform: scale(1.04);
  filter: saturate(1.06) contrast(1.02);
}

@keyframes title-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-footer {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  padding: 0.85rem 1.25rem 1rem;
  text-align: center;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
}

.site-footer p {
  margin: 0;
}

.site-footer__contact {
  margin-top: 0.2rem;
}

.site-footer a {
  color: #ffffff;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .panel__media,
  .panel__title,
  .panel__store,
  .panel__cta-label,
  .panel__web::before {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }

  .panel:hover .panel__media,
  .panel__web:focus-visible .panel__media {
    transform: none;
    filter: none;
  }
}

/* Desktop with mouse: reveal overlay on hover / focus */
@media (hover: hover) and (min-width: 900px) {
  .panel__cta {
    opacity: 0;
    transition: opacity 320ms var(--ease);
  }

  .panel:hover .panel__cta,
  .panel__web:focus-visible .panel__cta {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) and (hover: hover) and (min-width: 900px) {
  .panel__cta {
    opacity: 1;
  }
}

/* Desktop: left / right vertical split */
@media (min-width: 900px) {
  .hub {
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: 1fr 1fr;
  }

  .panel--codoku {
    border-right: 1px solid rgba(20, 20, 20, 0.1);
  }

  .panel__media {
    background-size: contain;
    background-position: center center;
    transform: none;
  }

  .panel--codoku .panel__media {
    background-position: center top;
  }

  .panel__bar {
    padding: 1rem 1.75rem 1.15rem;
  }

  .panel__title {
    font-size: clamp(1.65rem, 2.2vw, 2.15rem);
  }

  .panel__store-badge {
    height: 40px;
  }

  .panel:hover .panel__media,
  .panel__web:focus-visible .panel__media {
    transform: scale(1.03);
  }

  .site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.9rem 1.75rem;
  }

  .site-footer__contact {
    margin-top: 0;
  }
}

@media (min-width: 1200px) {
  .panel__media {
    inset: 1.5rem 1.5rem 0;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 8px 32px rgba(20, 20, 20, 0.08);
  }
}
