:root {
  color-scheme: light;
  --paper: #faf8f3;
  --band: #eee8dc;
  --ink: #2c2823;
  --muted: #574f45;
  --accent: #70523d;
  --line: #cfc2b1;
  --serif: Georgia, "Noto Serif TC", "PMingLiU", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 78px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.75 "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
a { color: inherit; text-underline-offset: .24em; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #966247; outline-offset: 4px; }
img { display: block; width: 100%; }
.skip { position: fixed; top: -100px; left: 1rem; padding: .5rem 1rem; background: white; z-index: 5; }
.skip:focus { top: .5rem; }
.masthead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 66px; padding: .65rem clamp(1rem, 6vw, 6rem); border-bottom: 1px solid var(--line); background: var(--paper); }
.wordmark { font: 1rem var(--serif); letter-spacing: .16em; text-decoration: none; }
nav, .actions { display: flex; align-items: center; gap: clamp(.65rem, 2vw, 2rem); flex-wrap: wrap; }
nav a { font-size: .9rem; text-decoration: none; }
nav a:hover, footer a:hover { text-decoration: underline; }
.hero { position: relative; display: grid; align-items: center; min-height: clamp(32rem, 58vw, 48rem); isolation: isolate; }
.hero picture { position: absolute; inset: 0; z-index: -2; }
.hero img { height: 100%; object-fit: cover; object-position: 72% center; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #f7f3e7eb 0%, #f7f3e789 36%, transparent 65%); }
.hero-copy { padding: 4rem clamp(1.3rem, 8vw, 9rem); }
.eyebrow { margin: 0 0 .75rem; color: var(--accent); font-size: .875rem; font-weight: 700; letter-spacing: .13em; }
h1, h2 { font-family: var(--serif); font-weight: 500; margin: 0 0 1rem; line-height: 1.15; }
h1 { font-size: clamp(3.35rem, 7.5vw, 7.5rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.85rem, 4vw, 3.5rem); }
.subtitle { font-size: clamp(1.1rem, 2vw, 1.55rem); margin: 1rem 0 1.7rem; }
.button { display: inline-block; padding: .65rem 1.15rem; border: 1px solid var(--ink); color: var(--paper); background: var(--ink); text-decoration: none; }
.button:hover { background: var(--accent); border-color: var(--accent); }
.wrap { width: min(86rem, 88%); margin-inline: auto; }
.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 7vw, 7rem); padding-block: clamp(3rem, 8vw, 7rem); }
.split img { aspect-ratio: 5/4; object-fit: cover; object-position: center 56%; }
.reverse img { order: 2; }
.split p:not(.eyebrow), .brand p:not(.eyebrow) { max-width: 37rem; color: var(--muted); }
.band { background: var(--band); }
.brand { text-align: center; padding-block: clamp(3rem, 7vw, 6rem); }
.brand p { margin-inline: auto; }
.rice { padding-top: 0; }
.collection { padding-block: clamp(3rem, 7vw, 6rem); }
.category { margin-top: 2.25rem; }
.category h3 { margin: 0 0 .85rem; font-size: 1.15rem; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.7rem, 2vw, 1.65rem); }
.card { width: 100%; border: 0; background: transparent; padding: 0; text-align: left; }
.card-media { position: relative; display: block; aspect-ratio: 1.12; }
.card img { position: absolute; inset: 5% 0 7%; margin: auto; width: 62%; height: 82%; object-fit: contain; object-position: center bottom; transition: transform .35s ease; }
.card:hover img { transform: translateY(-4px); }
.card[data-product="cream"] img,
.card[data-product="mask"] img { width: 56%; }
.card strong { min-height: 1.75em; }
.card strong, .card small { display: block; padding-inline: .15rem; }
.card strong { margin-top: .65rem; }
.card small { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.contact { background: #e7ddcc; text-align: center; padding-block: 3.5rem; }
footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
dialog { width: min(880px, calc(100% - 2rem)); max-height: 90dvh; padding: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #241f1ac7; }
.detail { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2.5rem 2rem 2rem; }
.detail-copy { align-self: center; }
.detail-copy h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.close { position: absolute; top: .4rem; right: .55rem; width: 44px; height: 44px; background: var(--paper); border: 1px solid var(--line); font-size: 1.5rem; }
.detail-image > img { height: min(42vh, 23rem); object-fit: contain; }
.gallery { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.gallery button { border: 1px solid var(--line); padding: 2px; background: transparent; }
.gallery button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.gallery img { width: 44px; height: 44px; object-fit: contain; }
@media (max-width: 700px) {
  html { scroll-padding-top: 69px; }
  .masthead { min-height: 57px; }
  .wordmark { font-size: .82rem; letter-spacing: .12em; }
  .hero { display: block; min-height: 0; }
  .hero picture { display: block; position: static; }
  .hero img { height: auto; aspect-ratio: 1.42; object-position: right center; }
  .hero::after { display: none; }
  .hero-copy { padding: 2rem 6% 2.5rem; background: #eee7db; }
  .split, .detail { grid-template-columns: 1fr; gap: 1.25rem; }
  .reverse img { order: 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.3rem; }
  .detail { padding: 3.1rem 1rem 1rem; }
  .detail-image > img { height: min(34vh, 17rem); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card img { transition: none; }
}

/* Show the full portrait frames in both story sections. */
.story-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.story-split img { width: auto; max-width: 100%; height: auto; max-height: 34rem; aspect-ratio: auto; justify-self: center; }
.filia { background: #f3ece2; }
.filia-layout { display: grid; grid-template-columns: .7fr 1fr; gap: clamp(2rem, 8vw, 7rem); align-items: center; padding-block: clamp(3rem, 8vw, 7rem); }
.filia-mark img { width: min(65%, 12rem); height: auto; margin-inline: auto; }
.filia-layout p:not(.eyebrow) { max-width: 37rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: .65rem 1.4rem; }
.plan-page { padding-block: clamp(2.5rem, 7vw, 6rem); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin: 2rem 0; }
.plan-grid article { border: 1px solid var(--line); padding: 1.4rem; }
.plan-grid article:nth-child(2) { background: var(--band); }
.plan-grid h2 { font-size: 1.55rem; }

@media (max-width: 700px) {
  .story-split, .filia-layout, .plan-grid { grid-template-columns: 1fr; }
  .story-split img { width: auto; max-height: min(27rem, 110vw); }
  .filia-mark img { width: 6.5rem; }
  .masthead { align-items: flex-start; }
  nav { justify-content: flex-end; gap: .15rem .65rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero.section-entering .hero-copy > *,
  .section-entering > * {
    animation: section-enter 850ms cubic-bezier(.22, .72, .22, 1) both;
  }
  .section-entering.band > .split,
  .section-entering.band > .collection,
  .section-entering.filia > .filia-layout { animation: none; }
  .section-entering.band > .split > *,
  .section-entering .collection > *,
  .section-entering .filia-layout > * { animation: section-enter 850ms cubic-bezier(.22, .72, .22, 1) both; }
  .hero.section-entering .hero-copy > :nth-child(2),
  .section-entering > :nth-child(2),
  .section-entering.band > .split > :nth-child(2),
  .section-entering .collection > :nth-child(2),
  .section-entering .filia-layout > :nth-child(2) { animation-delay: 100ms; }
  .hero.section-entering .hero-copy > :nth-child(n+3),
  .section-entering > :nth-child(n+3),
  .section-entering .collection > :nth-child(n+3) { animation-delay: 190ms; }

  @keyframes section-enter {
    from { opacity: .14; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.masthead-overlay {
  --header-height: 72px;
  height: var(--header-height);
  min-height: 0;
  margin-bottom: calc(-1 * var(--header-height));
  background: transparent;
  border-color: transparent;
  transition: background-color .35s ease, border-color .35s ease;
}
.masthead-overlay.is-scrolled {
  background: var(--paper);
  border-color: var(--line);
}
.wordmark-logo {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}
.wordmark-logo img { width: auto; height: 42px; }
.wordmark-logo small { display: block; font-size: .69em; }
@media (max-width: 700px) {
  .masthead-overlay { --header-height: 66px; align-items: center; }
  .masthead-overlay nav { max-width: 13rem; }
  .wordmark-logo { gap: .35rem; }
  .wordmark-logo img { height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .masthead-overlay { transition: none; }
}

/* Keep bookmark destinations clear of the sticky header. */
html { scroll-padding-top: 72px; }
#top { scroll-margin-top: 0; }
#story { padding-block: clamp(1.1rem, 2.7vw, 2.6rem); }
#story img { max-height: 34rem; }
#story > div { align-self: center; }

.product-rail { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; padding-block: .3rem .6rem; }
.product-rail::-webkit-scrollbar { display: none; }
.train-track { position: relative; display: flex; gap: 1.5rem; }
.train-track .card { flex: 0 0 calc((100% - 4.5rem) / 4); }
.train-track .card:focus-visible { outline-offset: -3px; }
.card-category { display: block; color: var(--accent); font-size: .875rem; margin-bottom: .25rem; }
.contact { text-align: left; }
.shop-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; margin-top: 1.6rem; }
.shop-layout h3 { margin: 0 0 .65rem; }
.shop-brands { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.4rem; }
.shop-brands li { border: 1px solid var(--line); padding: .2rem .65rem; }
.shop-contact { display: flex; flex-direction: column; align-items: flex-start; }
@media (max-width: 700px) {
  html { scroll-padding-top: 66px; }
  .train-track { gap: .9rem; }
  .train-track .card { flex-basis: calc((100% - .9rem) / 2); }
  .shop-layout { grid-template-columns: 1fr; }
}
.train-track .card { display: flex; flex-direction: column; align-items: stretch; }

/* Frame the bookmark views directly beneath the fixed navigation. */
#story { padding-block: 13px; }
#story img { max-height: min(34rem, calc(100svh - 98px)); }
.collection { padding-top: 24px; }
.product-rail { margin-top: 1.35rem; }

.detail > form { position: absolute; inset: 0 0 auto auto; }
.detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 2rem; }
.detail-image { grid-column: 2; grid-row: 1; }
.detail-copy { grid-column: 1; grid-row: 1; align-self: start; padding-top: clamp(.75rem, 5vh, 2.5rem); }
.gallery { justify-content: center; }

@media (max-width: 700px) {
  #story img { max-height: min(27rem, 95vw, 55svh); }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail-image { grid-column: 1; grid-row: 2; }
  .detail-copy { grid-column: 1; grid-row: 1; padding-top: 0; }
}

.train-track .card { text-align: center; }
.train-track .card img { left: 50%; right: auto; bottom: 7%; top: auto; margin: 0; translate: -50% 0; }

@media (prefers-reduced-motion: no-preference) {
  .section-entering.hero > .hero-copy { animation: none; }
  .section-entering .card-media,
  .section-entering .card > :is(strong, small) {
    animation: section-enter 780ms cubic-bezier(.22, .72, .22, 1) both;
  }
  .section-entering .card-media { animation-delay: 175ms; }
  .section-entering .card > :is(strong, small) { animation-delay: 240ms; }
  .section-entering .card:nth-child(even) .card-media { animation-delay: 235ms; }
  .section-entering .card:nth-child(even) > :is(strong, small) { animation-delay: 300ms; }
}

.menu-toggle { display: none; }
@media (max-width: 700px) {
  .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    margin-left: auto;
    border: 0;
    background: transparent;
  }
  .menu-toggle span { display: block; width: 22px; height: 2px; background: currentColor; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { visibility: hidden; }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }
  .masthead-overlay nav {
    display: none;
    position: absolute;
    top: calc(100% - 1px);
    right: 1rem;
    width: max-content;
    max-width: calc(100vw - 2rem);
    padding: .35rem .75rem;
    border: 1px solid #70523d40;
    background: rgb(250 248 243 / 72%);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 26px #2c28231c;
  }
  .masthead-overlay .menu-toggle[aria-expanded="true"] + nav { display: grid; justify-content: stretch; gap: 0; }
  .masthead-overlay nav a { display: flex; align-items: center; min-height: 44px; padding-inline: .5rem; }
  .masthead-overlay nav a + a { border-top: 1px solid #70523d36; }
}

@media (max-width: 700px) {
  #collection {
    min-height: max(calc(100svh - 66px), calc(100vw * 16 / 9));
  }
  .train-track .card-media { aspect-ratio: 9 / 16; }
  .train-track .card img { bottom: 10%; width: 68%; height: 74%; }
  .train-track .card[data-product="cream"] img,
  .train-track .card[data-product="mask"] img { width: 65%; }
}

.hero-media { position: absolute; inset: 0; }
.hero-media picture, .hero-media video { z-index: auto; }
.hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% center; visibility: hidden; }
.hero-media.has-video video { visibility: visible; }
.hero-copy { position: relative; z-index: 1; pointer-events: none; }
.hero-copy a { pointer-events: auto; }
.hero::after { z-index: 0; pointer-events: none; }
@media (max-width: 700px) {
  .hero-media { position: relative; }
  .hero-media video { object-position: right center; }
}

@media (min-width: 701px) {
  .hero { aspect-ratio: 16 / 9; min-height: 0; }
  .hero h1 { font-size: clamp(2.65rem, 5.5vw, 5.4rem); }
}
@media (max-width: 700px) {
  .hero-media picture img { aspect-ratio: 16 / 9; }
}
