:root {
  --ink: #1d1c1a;
  --muted: #68645e;
  --paper: #f7f5f0;
  --paper-cool: #eef2ef;
  --surface: #fffdfa;
  --line: rgba(29, 28, 26, 0.14);
  --sage: #65705a;
  --wine: #793b4a;
  --blue: #7f94a0;
  --brass: #a88755;
  --shadow: 0 24px 70px rgba(29, 28, 26, 0.14);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
  line-height: 1.6;
}

body.drawer-open {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--surface);
  padding: 8px 12px;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 52px);
  color: var(--surface);
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.site-header[data-elevated="true"] {
  background: rgba(247, 245, 240, 0.92);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  width: fit-content;
  font-weight: 700;
}

.brand-mark span:first-child {
  font-size: 1.1rem;
}

.brand-mark span:last-child {
  color: currentColor;
  opacity: 0.72;
  font-size: 0.82rem;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 253, 250, 0.4);
  border-radius: var(--radius);
  padding: 4px;
  background: rgba(29, 28, 26, 0.2);
  backdrop-filter: blur(18px);
}

.site-header[data-elevated="true"] .main-nav {
  border-color: var(--line);
  background: rgba(255, 253, 250, 0.78);
}

.main-nav a {
  min-width: 58px;
  padding: 7px 10px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.92rem;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: rgba(255, 253, 250, 0.22);
}

.site-header[data-elevated="true"] .main-nav a:hover,
.site-header[data-elevated="true"] .main-nav a:focus-visible {
  background: rgba(29, 28, 26, 0.06);
}

.nav-action {
  justify-self: end;
  border: 1px solid rgba(255, 253, 250, 0.48);
  border-radius: var(--radius);
  background: rgba(29, 28, 26, 0.26);
  color: currentColor;
  padding: 9px 14px;
  cursor: pointer;
}

.site-header[data-elevated="true"] .nav-action {
  border-color: var(--line);
  background: var(--surface);
}

.hero {
  position: relative;
  min-height: 78svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}

.hero-tint {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(29, 28, 26, 0.66), rgba(29, 28, 26, 0.2) 46%, rgba(29, 28, 26, 0.06)),
    linear-gradient(0deg, rgba(29, 28, 26, 0.5), rgba(29, 28, 26, 0) 38%);
}

.hero-content {
  width: min(560px, calc(100% - 40px));
  margin-left: clamp(20px, 7vw, 92px);
  padding-top: 88px;
  color: var(--surface);
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.7rem, 6vw, 6.4rem);
  font-weight: 500;
  line-height: 0.95;
}

.hero-copy {
  max-width: 460px;
  margin: 24px 0 0;
  color: rgba(255, 253, 250, 0.88);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--surface);
}

.button.secondary {
  background: rgba(255, 253, 250, 0.08);
  color: inherit;
  border-color: rgba(255, 253, 250, 0.42);
}

.drawer .button.secondary,
.product-card .button.secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.drawer .button.primary {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.hero-note {
  position: absolute;
  left: clamp(20px, 7vw, 92px);
  right: clamp(20px, 7vw, 92px);
  bottom: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  color: var(--surface);
  border: 1px solid rgba(255, 253, 250, 0.26);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(29, 28, 26, 0.34);
  backdrop-filter: blur(18px);
}

.hero-note span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(255, 253, 250, 0.08);
  text-align: center;
  font-size: 0.88rem;
}

.story-band,
.collection-section,
.app-band {
  padding: clamp(54px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.story-band {
  background: var(--paper-cool);
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(300px, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: start;
  max-width: 1160px;
  margin: 0 auto;
}

.story-grid h2,
.section-heading h2,
.app-copy h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.08;
  font-size: clamp(2.2rem, 4vw, 4.3rem);
}

.story-copy {
  color: var(--muted);
  font-size: 1rem;
}

.story-copy p {
  margin: 0 0 18px;
}

.collection-section {
  background: var(--paper);
}

.section-heading {
  max-width: 1160px;
  margin: 0 auto 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading p {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
}

.filter-bar {
  max-width: 1160px;
  margin: 0 auto 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-bar button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 13px;
  cursor: pointer;
}

.filter-bar button[aria-selected="true"] {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.product-grid {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(29, 28, 26, 0.07);
}

.product-media {
  aspect-ratio: 4 / 5;
  background: #e8e6df;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 70% center);
  transform: scale(1.02);
}

.product-body {
  padding: 16px;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.product-card h3 {
  margin: 8px 0 7px;
  font-size: 1.12rem;
  line-height: 1.25;
}

.product-card p {
  min-height: 52px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.swatches {
  display: flex;
  gap: 6px;
  margin: 14px 0;
}

.swatches span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(29, 28, 26, 0.16);
  background: var(--swatch);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
}

.save-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
}

.save-button[data-active="true"] {
  background: var(--wine);
  color: var(--surface);
  border-color: var(--wine);
}

.app-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 480px);
  gap: clamp(28px, 7vw, 88px);
  align-items: center;
  background: var(--ink);
  color: var(--surface);
}

.app-copy p {
  max-width: 520px;
  color: rgba(255, 253, 250, 0.72);
}

.app-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.app-stats span {
  border: 1px solid rgba(255, 253, 250, 0.22);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.app-stats strong {
  margin-right: 4px;
  font-size: 1.4rem;
}

.app-shell {
  border: 1px solid rgba(255, 253, 250, 0.22);
  border-radius: var(--radius);
  background: #f7f5f0;
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.app-feature {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 18px;
  background:
    linear-gradient(0deg, rgba(29, 28, 26, 0.72), rgba(29, 28, 26, 0.06) 62%),
    url("atelier-hero.png") center / cover;
  color: var(--surface);
}

.app-feature p,
.app-feature h3 {
  margin: 0;
}

.app-feature h3 {
  margin-top: 6px;
  font-size: 1.6rem;
}

.app-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.app-list div {
  min-width: 0;
  padding: 16px;
}

.app-list div + div {
  border-left: 1px solid var(--line);
}

.app-list span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.app-list strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  width: min(520px, 100%);
  display: grid;
  grid-template-rows: auto 42vh 1fr;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateX(104%);
  transition: transform 220ms ease;
}

.drawer[aria-hidden="false"] {
  transform: translateX(0);
}

.drawer-close {
  justify-self: end;
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px 12px;
  cursor: pointer;
}

.drawer-media {
  overflow: hidden;
  background: #e8e6df;
}

.drawer-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--drawer-focus, 70% center);
}

.drawer-content {
  overflow-y: auto;
  padding: 24px;
}

.drawer-content h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.1;
}

.drawer-content p {
  color: var(--muted);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(29, 28, 26, 0.34);
  backdrop-filter: blur(4px);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 72px);
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer div {
  display: grid;
  gap: 2px;
}

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

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .main-nav a {
    flex: 1 1 0;
  }

  .nav-action {
    grid-column: 2;
  }

  .hero {
    min-height: 82svh;
    align-items: end;
  }

  .hero-image {
    object-position: 67% center;
  }

  .hero-tint {
    background:
      linear-gradient(0deg, rgba(29, 28, 26, 0.76), rgba(29, 28, 26, 0.12) 72%),
      linear-gradient(90deg, rgba(29, 28, 26, 0.38), rgba(29, 28, 26, 0.04));
  }

  .hero-content {
    width: calc(100% - 36px);
    margin: 0 18px 104px;
    padding-top: 132px;
  }

  .hero h1 {
    font-size: 3.6rem;
  }

  .hero-note {
    left: 18px;
    right: 18px;
    grid-template-columns: 1fr;
  }

  .hero-note span {
    min-height: 34px;
  }

  .story-grid,
  .section-heading,
  .app-band {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
  }

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

@media (max-width: 620px) {
  .site-header {
    gap: 10px;
    padding: 12px 14px;
  }

  .brand-mark span:first-child {
    font-size: 1rem;
  }

  .nav-action {
    padding: 8px 10px;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .hero-content {
    margin-bottom: 178px;
  }

  .hero-copy {
    font-size: 1rem;
  }

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

  .drawer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card p {
    min-height: auto;
  }

  .app-list {
    grid-template-columns: 1fr;
  }

  .app-list div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .drawer {
    grid-template-rows: auto 35vh 1fr;
  }

  .site-footer {
    display: grid;
  }
}
