/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --cream:      #f5f1ea;
  --cream-2:    #ede7dc;
  --cream-3:    #e3dbcc;
  --ink:        #1a1612;
  --ink-2:      #3d342a;
  --ink-3:      #8a7a6a;
  --ink-4:      #b8a994;
  --rule:       rgba(60,45,30,.12);
  --card:       #ffffff;
  --card-hover: #faf6ee;
  --accent:     oklch(0.58 0.07 245);
  --accent-soft:oklch(0.58 0.07 245 / 0.1);
  --sh-sm:      0 1px 2px rgba(60,45,30,.04), 0 1px 3px rgba(60,45,30,.03);
  --sh-md:      0 4px 12px rgba(60,45,30,.06), 0 2px 4px rgba(60,45,30,.04);
  --sh-lg:      0 12px 32px rgba(60,45,30,.08), 0 4px 12px rgba(60,45,30,.05);
  --radius:     14px;
  --radius-lg:  20px;
  color-scheme: light;
}

html[data-theme='dark'] {
  --cream:      #14110e;
  --cream-2:    #1c1814;
  --cream-3:    #26211b;
  --ink:        #f5f1ea;
  --ink-2:      #d8cfc1;
  --ink-3:      #9a8a78;
  --ink-4:      #5e5346;
  --rule:       rgba(245,241,234,.10);
  --card:       #1f1b16;
  --card-hover: #262119;
  --accent:     oklch(0.76 0.06 245);
  --accent-soft:oklch(0.76 0.06 245 / 0.14);
  --sh-sm:      0 1px 2px rgba(0,0,0,.30);
  --sh-md:      0 4px 12px rgba(0,0,0,.35);
  --sh-lg:      0 12px 32px rgba(0,0,0,.40);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.005em;
  transition: background .4s ease, color .4s ease;
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────────────────── */
.piy-root {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.piy-main {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  z-index: 2;
}

/* ── Animated puzzle BG ─────────────────────────────────────────────── */
.piy-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.piy-bg__piece {
  position: absolute;
  will-change: transform;
}
@keyframes drift-a {
  0%   { transform: translate(0,0) rotate(0deg); }
  33%  { transform: translate(30px,-20px) rotate(45deg); }
  66%  { transform: translate(-20px,25px) rotate(-30deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}
@keyframes drift-b {
  0%   { transform: translate(0,0) rotate(0deg); }
  33%  { transform: translate(-25px,20px) rotate(-40deg); }
  66%  { transform: translate(20px,-15px) rotate(35deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}

/* ── Header ─────────────────────────────────────────────────────────── */
.piy-header {
  position: relative;
  z-index: 3;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.piy-header__brand {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  letter-spacing: .04em;
  color: var(--ink);
  text-decoration: none;
}
.piy-header__right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Lang switcher ───────────────────────────────────────────────────── */
.piy-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink-3);
  margin-right: 6px;
  font-weight: 500;
}
.piy-lang__btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px 2px;
  font: inherit;
  transition: color .2s;
}
.piy-lang__btn--active { color: var(--ink); }
.piy-lang__btn:hover   { color: var(--ink); }

/* ── Icon button ─────────────────────────────────────────────────────── */
.piy-icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, border-color .2s, color .2s;
}
.piy-icon-btn:hover {
  background: var(--card);
  border-color: var(--ink-4);
  color: var(--ink);
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.piy-hero { text-align: center; margin: 32px 0 40px; }
.piy-hero__logo-wrap { display: inline-flex; margin-bottom: 22px; }
.piy-hero__logo {
  width: 88px; height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(60,80,120,.18));
  animation: logo-float 6s ease-in-out infinite;
}
html[data-theme='dark'] .piy-hero__logo {
  filter: drop-shadow(0 4px 16px rgba(120,160,220,.25));
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-6px) rotate(2deg); }
}
.piy-hero__title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(44px, 8vw, 56px);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0 0 14px;
  color: var(--ink);
}
.piy-hero__title em {
  font-style: italic;
  color: var(--accent);
}
.piy-hero__tagline {
  color: var(--ink-3);
  font-style: italic;
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
  margin: 0;
}

/* ── Links ──────────────────────────────────────────────────────────── */
.piy-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 56px;
}
.piy-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s, background .2s, box-shadow .2s;
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.piy-link:hover {
  transform: translateY(-1px);
  border-color: var(--ink-4);
  background: var(--card-hover);
  box-shadow: var(--sh-md);
}
.piy-link:hover .piy-link__arrow { transform: translateX(3px); color: var(--accent); }
.piy-link__icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--ink-2);
  flex-shrink: 0;
}
.piy-link__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.piy-link__label { font-weight: 500; font-size: 15px; letter-spacing: -.01em; }
.piy-link__sub   { font-size: 12px; color: var(--ink-3); }
.piy-link__arrow {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  transition: transform .25s, color .25s;
}
.piy-link__shine {
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left .7s ease;
}
html[data-theme='dark'] .piy-link__shine {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
}
.piy-link:hover .piy-link__shine { left: 120%; }

/* ── Products ───────────────────────────────────────────────────────── */
.piy-products { margin-bottom: 56px; }
.piy-products__shipping {
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-4);
  margin: 0 2px 10px;
  text-align: center;
}
.piy-products__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 0 2px;
}
.piy-products__eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.piy-products__nav { display: flex; gap: 4px; }
.piy-products__nav-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding-bottom: 2px;
  transition: background .2s, border-color .2s;
  font-family: 'Instrument Serif', serif;
}
.piy-products__nav-btn:hover {
  background: var(--card);
  border-color: var(--ink-4);
}
.piy-products__carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 2px 12px;
  margin: -4px -24px -12px;
  padding-left: 24px;
  padding-right: 24px;
}
.piy-products__carousel::-webkit-scrollbar { display: none; }
.piy-products__spacer { flex-shrink: 0; width: 8px; }

/* ── Product card ───────────────────────────────────────────────────── */
.piy-product {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
}
.piy-product:hover {
  transform: translateY(-3px);
  border-color: var(--ink-4);
  box-shadow: var(--sh-lg);
}
.piy-product__img {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.piy-product__stripe {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,.08) 0 1px,
    transparent 1px 14px
  );
}
.piy-product__puzzle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform .5s;
}
.piy-product:hover .piy-product__puzzle { transform: scale(1.08) rotate(6deg); }
.piy-product__watermark {
  width: 52%; height: 52%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .30;
}
.piy-product__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  z-index: 1;
}
@keyframes piy-show-1 {
  0%, 1%    { opacity: 0; }
  12%       { opacity: 1; }
  37%       { opacity: 1; }
  48%       { opacity: 0; }
  100%      { opacity: 0; }
}
@keyframes piy-show-2 {
  0%, 49%   { opacity: 0; }
  60%       { opacity: 1; }
  85%       { opacity: 1; }
  96%       { opacity: 0; }
  100%      { opacity: 0; }
}
.piy-product__photo--1 {
  animation: piy-show-1 14s ease-in-out infinite;
  animation-delay: var(--photo-delay, 0s);
}
.piy-product__photo--2 {
  animation: piy-show-2 14s ease-in-out infinite;
  animation-delay: var(--photo-delay, 0s);
}
.piy-product__label {
  position: absolute;
  z-index: 2;
  bottom: 12px; left: 12px; right: 12px;
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: .04em;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
}
.piy-product__label strong { color: rgba(255,255,255,.95); font-weight: 600; letter-spacing: .02em; }
.piy-product__meta {
  padding: 14px 16px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.piy-product__name {
  font-family: 'Instrument Serif', serif;
  font-size: 19px;
  letter-spacing: -.01em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.piy-product__price { font-size: 12.5px; color: var(--ink-3); }
.piy-product__cta {
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  transition: color .2s;
  padding-top: 4px;
}
.piy-product:hover .piy-product__cta { color: var(--accent); }

/* ── Newsletter ─────────────────────────────────────────────────────── */
.piy-newsletter {
  margin-bottom: 64px;
  padding: 32px 28px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, transparent, var(--cream-2) 180%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.piy-newsletter::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.piy-newsletter__inner { position: relative; }
.piy-newsletter__title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -.015em;
  margin: 0 0 8px;
}
.piy-newsletter__text {
  color: var(--ink-3);
  font-size: 13.5px;
  margin: 0 auto 20px;
  max-width: 340px;
  line-height: 1.55;
}
.piy-newsletter__form {
  display: flex;
  gap: 8px;
  max-width: 380px;
  margin: 0 auto;
}
.piy-newsletter__input {
  flex: 1;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  font-size: 14px;
  transition: border-color .2s;
  min-width: 0;
}
.piy-newsletter__input:focus {
  outline: none;
  border-color: var(--accent);
}
.piy-newsletter__input::placeholder { color: var(--ink-4); }
.piy-newsletter__btn {
  padding: 12px 18px;
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}
.piy-newsletter__btn:hover {
  background: var(--ink-2);
  transform: translateY(-1px);
}
.piy-newsletter__done {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink-2);
  font-style: italic;
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
}
.piy-newsletter__check {
  display: inline-grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  font-family: system-ui;
}

/* ── How it works ───────────────────────────────────────────────────── */
.piy-how { margin-bottom: 56px; }
.piy-how__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.piy-how__photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  box-shadow: var(--sh-md);
}
.piy-how__text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 18px 0 0;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.piy-footer { text-align: center; padding-top: 20px; }
.piy-footer__divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--ink-4);
}
.piy-footer__divider-line { flex: 1; height: 1px; background: var(--rule); }
.piy-footer__logo { width: 16px; height: 16px; object-fit: contain; opacity: .4; }
.piy-footer__text {
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
  margin: 0;
}
.piy-footer__copy {
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--ink-4);
  margin: 6px 0 0;
}
.piy-footer__link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 420px) {
  .piy-main                 { padding: 40px 18px 60px; }
  .piy-header               { padding: 16px 18px 0; }
  .piy-products__carousel   { margin: -4px -18px -12px; padding-left: 18px; padding-right: 18px; }
  .piy-product              { flex: 0 0 190px; }
  .piy-newsletter           { padding: 28px 22px; }
  .piy-newsletter__form     { flex-direction: column; }
  .piy-newsletter__btn      { justify-content: center; }
  .piy-hero__title          { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .piy-bg__piece, .piy-hero__logo { animation: none !important; }
  * { transition-duration: .01s !important; }
}
