/* fengshui.ge: verdigris ground, brass coin, one cinnabar thread. */

@font-face {
  font-family: "FS Display";
  src: url("../fonts/display.woff2") format("woff2");
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: "FS Sans";
  src: url("../fonts/sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --verdigris: #1e3a35;
  --verdigris-deep: #142824;
  --patina: #8fb5a8;
  --brass: #d2ab55;
  --brass-hi: #ecd08a;
  --brass-lo: #6e5018;
  --cinnabar: #c8102e;
  --cinnabar-dk: #a00c24;
  --celadon: #edf1ea;
  --paper: #fafbf8;
  --ink: #16201d;
  --ink-soft: #4a5a55;
  --rule: #cfd8d0;
  --display: "FS Display", "Noto Serif Georgian", "Sylfaen", Georgia, serif;
  --sans: "FS Sans", "Noto Sans Georgian", "Sylfaen", system-ui, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 10px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font: 400 1.0625rem/1.65 var(--sans);
  color: var(--ink);
  background: var(--celadon);
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: .5rem 1rem;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}
.skip:focus { top: 1rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 2.9rem;
  padding: .65em 1.4em;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: progress; }
.btn-red { background: var(--cinnabar); color: #fff; }
.btn-red:hover { background: var(--cinnabar-dk); }
.btn-line { border-color: var(--brass); color: var(--brass-hi); background: transparent; }
.btn-line:hover { background: rgb(210 171 85 / .14); }
.btn-quiet { border-color: var(--rule); color: var(--ink); background: transparent; }
.btn-quiet:hover { border-color: var(--ink-soft); }

/* Header bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 2rem;
  padding: .7rem var(--gutter);
  background: var(--verdigris);
  color: var(--celadon);
  border-bottom: 1px solid rgb(210 171 85 / .18);
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-right: auto;
  font: 700 1.2rem/1 var(--display);
  color: var(--brass-hi);
  text-decoration: none;
}
.brand-coin { width: 1.75rem; height: 1.75rem; flex: none; }
.brand-coin circle { fill: var(--brass); }
.brand-coin rect { fill: var(--verdigris); }

.nav { display: flex; gap: 1.5rem; }
.nav a {
  padding-block: .3rem;
  border-bottom: 2px solid transparent;
  color: var(--celadon);
  text-decoration: none;
  opacity: .85;
}
.nav a:hover, .nav a[aria-current] { opacity: 1; border-color: var(--cinnabar); }

.cart { position: relative; }

.cart-toggle {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem .35rem .3rem 1rem;
  border: 1px solid rgb(210 171 85 / .45);
  border-radius: 999px;
  background: none;
  color: var(--celadon);
  font: 500 .95rem/1 var(--sans);
  cursor: pointer;
}
.cart-toggle:hover { border-color: var(--brass); }

/* The count sits in the square hole of a small cash coin. */
.cart-count {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-hi), var(--brass) 55%, var(--brass-lo));
  color: var(--brass-hi);
  font: 700 .75rem/1 var(--sans);
}
.cart-count::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 1.15rem;
  height: 1.15rem;
  background: var(--verdigris);
}

.cart-panel {
  position: absolute;
  right: 0;
  top: calc(100% + .75rem);
  width: min(24rem, calc(100vw - 2rem));
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgb(10 20 18 / .38);
}

.cart-list { max-height: 50vh; margin: 0; padding: 0; overflow: auto; list-style: none; }

.cart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--rule);
}
.cart-item img { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: #fff; }
.cart-item-name { font-size: .95rem; font-weight: 600; line-height: 1.35; }
.cart-item-meta { font-size: .875rem; color: var(--ink-soft); }
.cart-item-remove {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.cart-item-remove:hover { border-color: var(--cinnabar); color: var(--cinnabar); }

.cart-empty { padding: .5rem 0; color: var(--ink-soft); }
.cart-empty a { color: var(--cinnabar); font-weight: 600; }

.cart-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; }

/* Hero: the book sits in the square hole of a cash coin */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
  background: var(--verdigris);
  color: var(--celadon);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60rem 40rem at 72% 45%, rgb(143 181 168 / .2), transparent 62%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero-copy { position: relative; z-index: 2; }

.eyebrow { font: 600 .8125rem/1 var(--sans); letter-spacing: .08em; color: var(--brass); }

.hero-title {
  margin-top: 1rem;
  font-size: clamp(2.9rem, 7vw, 5.6rem);
  font-weight: 800;
  line-height: 1.08;
  color: var(--paper);
}
.hero-title span { display: block; color: var(--brass-hi); }

.hero-author { margin-top: 1.5rem; font-size: 1.125rem; font-weight: 600; color: var(--brass); }

.hero-quote {
  max-width: 34rem;
  margin: 1.75rem 0 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--cinnabar);
  color: rgb(237 241 234 / .86);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.coin-figure { display: grid; justify-items: center; gap: 1.25rem; margin: 0; }

.coin-stage {
  position: relative;
  width: min(100%, 34rem);
  aspect-ratio: 1;
  container-type: inline-size;
}

.coin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #f3dc9c 0%, var(--brass) 36%, #a7802f 68%, var(--brass-lo) 100%);
  box-shadow:
    inset 0 0 0 2.2cqi #b58d3b,
    inset 0 0 0 2.6cqi rgb(70 45 10 / .45),
    inset 0 .8cqi 1.4cqi 2.6cqi rgb(255 240 200 / .25),
    0 3cqi 8cqi rgb(0 0 0 / .45);
}
/* Worn concentric grain on the metal */
.coin::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, rgb(0 0 0 / .04) 0 .25cqi, transparent .25cqi .9cqi);
  pointer-events: none;
}

.coin-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: var(--verdigris-deep);
  box-shadow:
    0 0 0 2cqi #b58d3b,
    0 0 0 2.4cqi rgb(70 45 10 / .45),
    inset 0 1.5cqi 3cqi rgb(0 0 0 / .5);
}

.coin-word {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  font: 800 6.2cqi/1 var(--display);
  color: #5a3f10;
  text-shadow: 0 .18cqi 0 rgb(255 236 180 / .55);
  white-space: nowrap;
}
.coin-top { top: 8%; }
.coin-bottom { bottom: 8%; }

.coin-gua {
  position: absolute;
  top: 50%;
  width: 7cqi;
  translate: 0 -50%;
  fill: #5a3f10;
  filter: drop-shadow(0 .18cqi 0 rgb(255 236 180 / .55));
}
.coin-left { left: 9%; }
.coin-right { right: 9%; }

.thread {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.thread line {
  stroke: var(--cinnabar);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: thread 1.5s .25s cubic-bezier(.6, 0, .2, 1) forwards;
}
@keyframes thread { to { stroke-dashoffset: 0; } }

/* Book geometry matches the thread line: 40% wide, centred, cover ratio 800:1124 */
.book {
  position: absolute;
  left: 30%;
  top: 21.9%;
  z-index: 2;
  width: 40%;
  aspect-ratio: 800 / 1124;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 1400px;
}
.book:focus-visible { outline-offset: 6px; }
.book-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.book-face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border-radius: 2px 4px 4px 2px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 2cqi 5cqi rgb(0 0 0 / .5);
}
.book-face img { width: 100%; height: 100%; object-fit: cover; }
.book-back { transform: rotateY(180deg); }

@media (hover: hover) {
  .book:hover .book-inner { transform: rotateY(-12deg); }
  .book[aria-pressed="true"]:hover .book-inner { transform: rotateY(168deg); }
}
.book[aria-pressed="true"] .book-inner { transform: rotateY(180deg); }

.coin-caption { max-width: 22rem; font-size: .95rem; line-height: 1.45; color: var(--patina); text-align: center; }

/* Sections */

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--rule);
}
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }

.more { color: var(--cinnabar); font-weight: 600; text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; text-underline-offset: .2em; }

.goods-grid, .book-grid, .product-grid { display: grid; margin: 0; padding: 0; list-style: none; gap: clamp(1rem, 2.5vw, 1.75rem); }

.goods-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.goods-grid a { display: block; text-decoration: none; }
.goods-img {
  width: 100%;
  aspect-ratio: 1;
  padding: 8%;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 0 var(--rule);
  transition: transform .3s;
}
.goods-grid a:hover .goods-img { transform: translateY(-3px); }
.goods-name { display: block; margin-top: .8rem; font-weight: 600; line-height: 1.4; }
.goods-price { display: block; margin-top: .2rem; font-weight: 700; color: var(--cinnabar); }

.books { background: var(--paper); }
.book-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 15rem)); }
.book-grid a { display: grid; gap: .5rem; text-decoration: none; }
.book-grid img {
  width: 100%;
  margin-bottom: .5rem;
  border-radius: 3px;
  box-shadow: 0 18px 30px -18px rgb(20 32 29 / .6);
  transition: transform .3s;
}
.book-grid a:hover img { transform: translateY(-4px) rotate(-1deg); }
.book-title { font: 700 1.125rem/1.35 var(--display); }
.book-note { font-size: .875rem; color: var(--ink-soft); }

/* Contact and forms */

.contact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.5rem 2rem; margin: 0; }
.contact-list dt { font-size: .8125rem; letter-spacing: .06em; color: var(--ink-soft); }
.contact-list dd { margin: 0; font-size: 1.25rem; font-weight: 600; overflow-wrap: anywhere; }
.contact-list a { text-decoration: none; border-bottom: 1.5px solid var(--cinnabar); }

.order-form {
  display: grid;
  gap: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule);
}
.order-form h2, .order-summary h2 { font-size: 1.4rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; font-size: .875rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--verdigris); box-shadow: 0 0 0 3px rgb(30 58 53 / .18); }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.form-error { font-weight: 600; color: var(--cinnabar); }

/* Shop and order pages */

.page-head {
  position: relative;
  overflow: hidden;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  background: var(--verdigris);
  color: var(--celadon);
}
/* The cover's thread, at the cover's angle */
.page-head::after {
  content: "";
  position: absolute;
  right: 14%;
  top: -40%;
  width: 4px;
  height: 180%;
  background: var(--cinnabar);
  rotate: 29deg;
}
.page-head .wrap { position: relative; z-index: 1; }
.page-head h1 { margin-top: .6rem; font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; color: var(--paper); }
.greet { margin-top: .75rem; color: var(--brass); }

.product-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.product {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule), 0 12px 30px -24px rgb(20 32 29 / .5);
}
.product:target { outline: 3px solid var(--brass); outline-offset: 4px; }
.product-img { width: 100%; aspect-ratio: 1; padding: 6%; object-fit: contain; background: #fff; }
.product-body { display: flex; flex: 1; flex-direction: column; gap: .7rem; padding: 1.25rem 1.25rem 1.4rem; }
.product-name { font-size: 1.3rem; }
.product-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.product-desc.is-open { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.more-toggle {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cinnabar);
  font: 600 .9rem var(--sans);
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

.product-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
}
.product-buy .btn { flex: 1 1 100%; }
.product-price { margin-right: auto; font: 800 1.7rem/1 var(--display); color: var(--cinnabar); }

.qty { display: inline-flex; align-items: center; overflow: hidden; border: 1.5px solid var(--rule); border-radius: 999px; background: #fff; }
.qty button { width: 2.4rem; height: 2.6rem; border: 0; background: none; color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.qty button:hover { background: var(--celadon); }
.qty input { width: 2.4rem; border: 0; background: none; font: 600 1rem var(--sans); text-align: center; appearance: textfield; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: clamp(2rem, 5vw, 4rem); }
.order-summary { display: grid; gap: .5rem; padding: 1.5rem; border-radius: var(--radius); background: var(--paper); }
.order-total { display: flex; justify-content: space-between; margin-top: .5rem; font-size: 1.2rem; }

.notice {
  display: grid;
  gap: .75rem;
  max-width: 40rem;
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--cinnabar);
  border-radius: var(--radius);
  background: var(--paper);
}
.notice h2 { font-size: 1.6rem; }

/* Sign-in dialog */

.login {
  width: min(26rem, calc(100vw - 2rem));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px rgb(0 0 0 / .4);
}
.login::backdrop { background: rgb(20 40 36 / .6); backdrop-filter: blur(3px); }
.login-form { display: grid; gap: 1rem; padding: 1.75rem; }
.login-form h2 { font-size: 1.5rem; }
.login-form p { font-size: .95rem; color: var(--ink-soft); }
.login-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: .5rem; }

/* Footer */

.foot { padding-block: 1.75rem; background: var(--verdigris-deep); color: rgb(237 241 234 / .75); font-size: .9rem; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.foot a { color: var(--brass-hi); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* Responsive */

@media (max-width: 880px) {
  .hero-inner, .order-grid { grid-template-columns: minmax(0, 1fr); }
  .coin-stage { width: min(100%, 26rem); }
  /* Stacked layout: keep the thread inside the coin so it stays off the copy above */
  .thread { overflow: hidden; }
}

@media (max-width: 720px) {
  .nav { order: 3; width: 100%; gap: 1.25rem; overflow-x: auto; }
  .brand { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .cart-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cart-toggle { padding-left: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
}
