:root {
  color-scheme: light dark;
  --bg: #f7f7f2;
  --surface: #ffffff;
  --surface-soft: #eef2ef;
  --text: #17201b;
  --muted: #637067;
  --border: rgba(23, 32, 27, 0.12);
  --accent: #1f7a58;
  --accent-strong: #16533f;
  --accent-soft: rgba(31, 122, 88, 0.14);
  --shadow: 0 24px 70px rgba(27, 38, 32, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #191e23;
    --surface-soft: #20272b;
    --text: #eef3ed;
    --muted: #aab5ad;
    --border: rgba(238, 243, 237, 0.13);
    --accent: #65c79b;
    --accent-strong: #8fe0b8;
    --accent-soft: rgba(101, 199, 155, 0.16);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  }
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f2;
  --surface: #ffffff;
  --surface-soft: #eef2ef;
  --text: #17201b;
  --muted: #637067;
  --border: rgba(23, 32, 27, 0.12);
  --accent: #1f7a58;
  --accent-strong: #16533f;
  --accent-soft: rgba(31, 122, 88, 0.14);
  --shadow: 0 24px 70px rgba(27, 38, 32, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111418;
  --surface: #191e23;
  --surface-soft: #20272b;
  --text: #eef3ed;
  --muted: #aab5ad;
  --border: rgba(238, 243, 237, 0.13);
  --accent: #65c79b;
  --accent-strong: #8fe0b8;
  --accent-soft: rgba(101, 199, 155, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 42%, transparent) 0 1px, transparent 1px 28px),
    radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 34rem),
    linear-gradient(180deg, var(--bg) 0%, var(--surface-soft) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  animation: page-in 420ms ease both;
  -webkit-user-select: none; /* Safari */
  -webkit-touch-callout: none;
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+/Edge */
  user-select: none; /* Standard */
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

code {
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 2px 5px;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
  animation: header-in 520ms ease both;
}

.brand img {
  width: clamp(120px, 18vw, 164px);
  height: auto;
}

.desktop-nav,
.header-actions,
.carousel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-nav {
  justify-content: center;
  flex-wrap: wrap;
}

.nav-link {
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  outline: none;
}

.icon-button:active {
  transform: translateY(1px);
}

.menu-button {
  display: none;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.menu-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent-soft);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.menu-button:hover::before,
.menu-button:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}

.menu-button span {
  position: relative;
  z-index: 1;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 220ms ease;
}

.menu-button.is-active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-button.is-active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.menu-button.is-active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.mobile-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-panel {
  position: fixed;
  inset: 73px 12px auto;
  z-index: 25;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px) scale(0.96) rotateX(-6deg);
  transform-origin: top right;
  transition: opacity 220ms ease, transform 340ms cubic-bezier(0.2, 0.9, 0.2, 1.1);
}

.mobile-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1) rotateX(0deg);
}

.mobile-panel nav {
  display: grid;
  gap: 4px;
}

.mobile-panel .nav-link {
  display: block;
  padding: 13px 14px;
  opacity: 0;
  transform: translateX(-18px) translateY(-4px);
  transition: opacity 260ms ease, transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1), background-color 160ms ease, color 160ms ease;
  border-radius: calc(var(--radius) - 2px);
  position: relative;
}

.mobile-panel .nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  transform: translateY(-50%);
  transition: height 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-panel .nav-link:hover::before,
.mobile-panel .nav-link:focus-visible::before {
  height: 60%;
}

.mobile-panel.is-open .nav-link {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

.mobile-panel.is-open .nav-link:nth-child(1) { transition-delay: 40ms; }
.mobile-panel.is-open .nav-link:nth-child(2) { transition-delay: 80ms; }
.mobile-panel.is-open .nav-link:nth-child(3) { transition-delay: 120ms; }
.mobile-panel.is-open .nav-link:nth-child(4) { transition-delay: 160ms; }
.mobile-panel.is-open .nav-link:nth-child(5) { transition-delay: 200ms; }
.mobile-panel.is-open .nav-link:nth-child(6) { transition-delay: 240ms; }
.mobile-panel.is-open .nav-link:nth-child(7) { transition-delay: 280ms; }
.mobile-panel.is-open .nav-link:nth-child(8) { transition-delay: 320ms; }

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: center;
  /* gap: clamp(28px, 6vw, 72px); */
  min-height: calc(100svh - 72px);
  padding: clamp(32px, 7vw, 86px) 0 52px;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero::before {
  inset: 10% auto auto 44%;
  width: min(460px, 48vw);
  height: min(460px, 48vw);
  border: 1px solid var(--border);
  border-radius: 8px;
  transform: rotate(16deg);
  animation: hero-frame-in 900ms 80ms ease both, hero-frame-drift 8s ease-in-out infinite;
}

.hero::after {
  right: 4%;
  bottom: 12%;
  width: min(220px, 28vw);
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
  animation: hero-line-scan 2.8s 360ms ease-in-out infinite;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  animation: rise-in 620ms 80ms ease both;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  /* max-width: 11ch; */
  font-size: clamp(50px, 5vw, 60px);
  line-height: 0.98;
  font-family: Comic Sans MS,
    Tahoma,
    Courier New,
    SimHei,
    PingFang SC,
    Microsoft YaHei,
    sans-serif;
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.06;
}

.daily-line {
  min-height: 60px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  animation: rise-in 640ms 260ms ease both;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--text);
  color: var(--bg);
  font-weight: 760;
  transition: transform 160ms ease, opacity 160ms ease;
}

.button-link.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-link:hover,
.button-link:focus-visible {
  transform: translateY(-1px);
  opacity: 0.9;
  outline: none;
}

.hero-visual {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(100%, 500px);
  aspect-ratio: 1 / 1;
  animation: float-in 760ms 120ms ease both;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 11%;
  border-radius: 30% 70% 48% 52% / 42% 36% 64% 58%;
  background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--surface) 70%, transparent));
  border: 1px solid var(--border);
  animation: blob-shift 7s ease-in-out infinite;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 22% 5% auto auto;
  width: 36%;
  height: 1px;
  background: color-mix(in srgb, var(--accent) 60%, transparent);
  transform: rotate(-18deg);
  animation: accent-sweep 3.6s ease-in-out infinite;
}

.hero-visual img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 28px 34px rgba(0, 0, 0, 0.16));
}

.quick-section,
.gallery-section {
  padding: 44px 0;
}

.section-heading {
  display: flex;
  align-items: start;
  flex-direction: column;
  justify-content: space-between;
  /* gap: 16px; */
  margin-bottom: 22px;
  animation: rise-in 520ms ease both;
}

.section-heading.gallery-heading {
  animation-delay: 120ms;
  flex-direction: row;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 90px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms ease var(--reveal-delay, 0ms), transform 520ms ease var(--reveal-delay, 0ms);
}

.quick-card:hover,
.quick-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  background: var(--surface);
  outline: none;
}

.quick-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
}

.quick-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.gallery-track {
  position: relative;
  height: clamp(360px, 48vw, 520px);
  overflow: hidden;
  padding: 6px 0 22px;
  outline: none;
  perspective: 1200px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  animation: rise-in 560ms 160ms ease both;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-card {
  position: absolute;
  top: 6px;
  left: 50%;
  width: min(270px, 58vw);
  margin: 0;
  opacity: max(0, calc(1 - (var(--abs-offset) * 0.26)));
  pointer-events: auto;
  transform:
    translateX(calc(-50% + (var(--offset) * min(210px, 22vw))))
    translateY(calc(var(--abs-offset) * 18px))
    scale(calc(1 - (var(--abs-offset) * 0.08)))
    rotateY(calc(var(--offset) * -7deg));
  transition: transform 620ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 360ms ease, filter 360ms ease;
  filter: saturate(calc(1 - (var(--abs-offset) * 0.08)));
}

.gallery-card .card-inner {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.08);
  transform: translateX(var(--drag-x, 0px));
  transition: none;
}

.gallery-card.is-active .card-inner {
  box-shadow: var(--shadow);
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface-soft);
}

.gallery-card figcaption {
  padding: 14px 14px 16px;
}

.gallery-card strong,
.gallery-card span {
  display: block;
}

.gallery-card strong {
  font-size: 16px;
  line-height: 1.3;
}

.gallery-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 6px auto 0;
  padding: 6px 0 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

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

@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes header-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes soft-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes hero-frame-in {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(8deg) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(16deg) scale(1);
  }
}

@keyframes hero-frame-drift {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 10px -12px;
  }
}

@keyframes hero-line-scan {
  0%,
  100% {
    transform: translateX(-28px) scaleX(0.72);
    opacity: 0.2;
  }
  45% {
    transform: translateX(18px) scaleX(1);
    opacity: 0.58;
  }
}

@keyframes blob-shift {
  0%,
  100% {
    border-radius: 30% 70% 48% 52% / 42% 36% 64% 58%;
  }
  50% {
    border-radius: 58% 42% 36% 64% / 48% 60% 40% 52%;
  }
}

@keyframes accent-sweep {
  0%,
  100% {
    opacity: 0.18;
    transform: translateX(-18px) rotate(-18deg);
  }
  50% {
    opacity: 0.62;
    transform: translateX(12px) rotate(-18deg);
  }
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  body,
  .site-header,
  .hero-copy,
  .hero-visual,
  .hero-visual img,
  .hero::before,
  .hero::after,
  .section-heading,
  .gallery-track,
  .quick-card,
  .gallery-card,
  .site-footer,
  .hero-actions {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .desktop-nav {
    display: none;
  }

  .menu-button {
    display: inline-grid;
  }

  .site-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 42px;
  }

  .hero-copy {
    max-width: none;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
    margin-top: 10px;
  }

  /* h1 {
    max-width: 12ch;
  } */

  .hero-visual {
    width: min(84vw, 420px);
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-track {
    height: clamp(340px, 66vw, 480px);
  }

  .gallery-card {
    width: min(260px, 62vw);
    transform:
      translateX(calc(-50% + (var(--offset) * min(172px, 31vw))))
      translateY(calc(var(--abs-offset) * 16px))
      scale(calc(1 - (var(--abs-offset) * 0.08)))
      rotateY(calc(var(--offset) * -5deg));
  }
}

@media (max-width: 640px) {
  main,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 64px;
    padding: 10px 12px;
  }

  .brand img {
    width: 118px;
  }

  .mobile-panel {
    inset: 65px 8px auto;
  }

  .hero {
    gap: 20px;
    padding: 34px 0 28px;
  }

  .hero::before {
    inset: 16% auto auto 30%;
    width: 70vw;
    height: 70vw;
  }

  .hero::after {
    right: 10%;
    bottom: 42%;
    width: 36vw;
  }

  h1 {
    font-size: clamp(30px, 9vw, 50px);
  }

  .daily-line {
    min-height: 0;
    margin-top: 18px;
  }

  .quick-section,
  .gallery-section {
    padding: 30px 0;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .section-heading.gallery-heading {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }

  .section-heading.gallery-heading h2 {
    white-space: nowrap;
  }

  .carousel-controls {
    flex-shrink: 0;
    gap: 4px;
  }

  .carousel-controls .icon-button {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  /* .quick-grid {
    grid-template-columns: 1fr;
  } */

  .gallery-track {
    height: 410px;
  }

  .gallery-card {
    width: min(245px, 78vw);
    transform:
      translateX(calc(-50% + (var(--offset) * 36vw)))
      translateY(calc(var(--abs-offset) * 14px))
      scale(calc(1 - (var(--abs-offset) * 0.1)));
  }

  .site-footer {
    align-items: flex-start;
  }
}
