@import url('https://fonts.cdnfonts.com/css/tribeca');

:root {
  --font-display: 'Tribeca', 'Georgia', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bg: #f5f0e8;
  --text: #1a1510;
  --text-muted: rgba(26,21,16,.55);
  --accent: #b86a3a;
  --accent-soft: rgba(184,106,58,.12);
  --accent-glow: rgba(184,106,58,.25);
  --accent-light: #d48a5a;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-card: 0 2px 8px rgba(26,21,16,.06);
  --shadow-card-hover: 0 8px 28px rgba(26,21,16,.1);
  --shadow-modal: 0 20px 60px rgba(0,0,0,.4);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --nav-height: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; overflow: hidden; }
body {
  height: 100%; overflow: hidden;
  background: var(--bg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ── Preloader ── */
#preloader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-text {
  font-family: var(--font-display);
  font-size: clamp(32px,7vw,64px);
  color: var(--accent);
  letter-spacing: .04em;
  line-height: 1;
  margin-bottom: var(--space-md);
}
.preloader-bar-wrap {
  width: clamp(140px,18vw,280px);
  height: 2px;
  background: var(--accent-soft);
  border-radius: 2px;
  overflow: hidden;
}
.preloader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  animation: preloader-fill 0.6s ease-in-out forwards;
}
@keyframes preloader-fill {
  to { width: 100%; }
}

/* ── Viewport & SVG ── */
#viewport-center {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; pointer-events: none;
}
#svg-perspective-wrap {
  perspective: 1000px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform;
  width: min(88vw, 88vh);
  aspect-ratio: 1 / 1;
  max-height: 88vh;
  opacity: 0;
}
#svg-perspective-wrap svg {
  display: block;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: auto;
}

/* ── Navigation ── */
nav {
  position: fixed; bottom: var(--space-md); left: 50%;
  transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: rgba(26,21,10,.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.08);
}
nav a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font: 500 clamp(11px,1.1vw,14px) var(--font-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: color .25s, background .25s;
  cursor: pointer;
  white-space: nowrap;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 100px;
}
nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-toggle {
  display: none; background: none; border: none;
  color: rgba(255,255,255,.7); font-size: 22px;
  cursor: pointer; padding: var(--space-xs) var(--space-sm);
  line-height: 1;
}
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs); }

@media (max-width: 600px) {
  nav { padding: var(--space-sm) 12px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; align-items: center;
    position: absolute; bottom: calc(100% + var(--space-sm));
    left: 50%; transform: translateX(-50%);
    background: rgba(26,21,10,.6); backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    gap: var(--space-xs);
    white-space: nowrap;
    min-width: 160px;
  }
  .nav-links.open { display: flex; }
}

/* ── Sections ── */
.sections-wrap { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.section {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-2xl);
  opacity: 0; pointer-events: none;
  color: #fff; font-family: var(--font-body);
  text-align: center; overflow: hidden;
}
#section-home { position: fixed; inset: 0; z-index: 0; opacity: 0; }

.section::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -3;
  background-blend-mode: multiply;
  background-size: cover;
  background-position: center;
  filter: brightness(1);
  transition: filter 2.5s ease-in-out;
}
.section.night::before {
  filter: brightness(0.3);
}
.section::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  z-index: -2;
  filter: blur(12px);
  transition: top 2.5s ease-in-out, opacity 2.5s ease-in-out, transform 2.5s ease-in-out;
  top: 10%;
  transform: translateX(-50%) scale(1);
  opacity: .9;
}
.section.night::after {
  top: 85%;
  transform: translateX(-50%) scale(.5);
  opacity: .15;
}

/* Section-specific backgrounds */
#section-home::before {
  background-image: url('pattern-home.svg'), linear-gradient(180deg, #f0c078 0%, #d4a05a 25%, #a87840 55%, #604028 80%, #241810 100%);
}
#section-home::after {
  background: radial-gradient(circle, #fff8f0 0%, #f0c078 40%, #d48838 100%);
  box-shadow: 0 0 140px 20px #e0a858;
}
#section-about::before {
  background-image: url('pattern-about.svg'), linear-gradient(180deg, #f0c078 0%, #d4a05a 25%, #a87840 55%, #604028 80%, #241810 100%);
}
#section-about::after {
  background: radial-gradient(circle, #fff8f0 0%, #f0c078 40%, #d48838 100%);
  box-shadow: 0 0 140px 20px #e0a858;
}
#section-shop::before {
  background-image: url('pattern-shop.svg'), linear-gradient(180deg, #c08070 0%, #905048 30%, #603830 55%, #38201a 80%, #18100c 100%);
}
#section-shop::after {
  background: radial-gradient(circle, #fce8e0 0%, #d09078 40%, #a85848 100%);
  box-shadow: 0 0 120px 20px #c07060;
}
#section-community::before {
  background-image: url('pattern-community.svg'), linear-gradient(180deg, #b8a0c8 0%, #9070a8 30%, #604880 55%, #382050 80%, #181028 100%);
}
#section-community::after {
  background: radial-gradient(circle, #f0e8f8 0%, #b890c8 40%, #8060a0 100%);
  box-shadow: 0 0 140px 20px #a880b8;
}
#section-expressions::before {
  background-image: url('pattern-expressions.svg'), linear-gradient(180deg, #a0c0b0 0%, #709880 30%, #486858 55%, #243230 80%, #121c18 100%);
}
#section-expressions::after {
  background: radial-gradient(circle, #e8f4e8 0%, #88b078 40%, #588050 100%);
  box-shadow: 0 0 120px 20px #78a068;
}

.section.active { pointer-events: auto; }

.section h2 {
  font-size: clamp(26px,3.5vw,48px);
  letter-spacing: -.01em;
  margin-bottom: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 400;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  max-width: 100%;
}
.section > p {
  font-size: clamp(14px,1.2vw,18px);
  max-width: 560px;
  width: 100%;
  line-height: 1.65;
  opacity: .8;
}
.tagline-about {
  font-size: clamp(14px,1.3vw,20px);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #f0b878;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
#section-about p,
#section-community p,
#section-expressions p {
  margin-bottom: var(--space-sm);
}

/* ── Blog / Shop shared grid styles ── */
.section .grid {
  display: grid;
  width: 100%;
  margin-top: var(--space-lg);
}
#section-shop .grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
  max-width: 940px;
  padding: var(--space-lg);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
}

/* ── Shop cards ── */
#section-shop .card {
  position: relative; width: 100%; height: 260px;
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-end;
  background-size: cover; background-position: center;
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.25,.46,.45,.94),
              box-shadow .35s ease,
              border-color .35s ease;
}
#section-shop .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 36px rgba(0,0,0,.35);
  border-color: rgba(255,255,255,.18);
}
#section-shop .card .card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.15) 45%, rgba(0,0,0,.05) 100%);
  z-index: 1;
  transition: background .35s ease;
}
#section-shop .card:hover .card-overlay {
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,.08) 100%);
}
#section-shop .card .card-content {
  position: relative; z-index: 2;
  padding: var(--space-lg) var(--space-md) var(--space-md);
  transition: transform .35s cubic-bezier(.25,.46,.45,.94);
}
#section-shop .card:hover .card-content {
  transform: translateY(-3px);
}
#section-shop .card h3 {
  font-size: clamp(13px,1vw,16px);
  font-weight: 600;
  margin-bottom: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
#section-shop .card .product-type {
  font-size: clamp(10px,.7vw,12px);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f0a870;
  margin-bottom: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,.35);
}
#section-shop .card .product-price {
  font-size: clamp(13px,1vw,16px);
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
#section-shop .card p {
  font-size: clamp(10px,.7vw,12px);
  opacity: .7;
  margin: 0;
}

/* ── Back button ── */
.back-btn {
  position: fixed; top: 24px; right: 24px; z-index: 10;
  background: none;
  border: 1.5px solid rgba(255,255,255,.3);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: background .3s, border-color .3s;
  display: flex; align-items: center; justify-content: center;
}
.back-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.5); }

/* ── Blog section ── */
#section-blog::before {
  background-image: url('pattern-about.svg'), linear-gradient(180deg, #bea078 0%, #987858 30%, #684838 55%, #382820 80%, #1c1008 100%);
}
#section-blog::after {
  background: radial-gradient(circle, #f5e0c0 0%, #d0a070 40%, #a87048 100%);
  box-shadow: 0 0 140px 20px #b89068;
}

.blog-content {
  position: relative; z-index: 1;
  width: 100%; max-width: 920px;
  padding: 0 var(--space-lg);
  margin-top: var(--space-xl);
  max-height: 78vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.blog-content::-webkit-scrollbar { width: 4px; }
.blog-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.blog-subtitle { margin-bottom: var(--space-md); }

.category-filters {
  display: flex; gap: var(--space-sm);
  flex-wrap: wrap; justify-content: center;
  margin-bottom: var(--space-lg);
}
.cat-filter {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.65);
  padding: 5px 14px;
  border-radius: 100px;
  cursor: pointer;
  font: 500 clamp(11px,.9vw,13px) var(--font-body);
  transition: all .2s;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cat-filter:hover { background: rgba(255,255,255,.12); color: #fff; }
.cat-filter.active {
  background: rgba(255,255,255,.18);
  color: #fff;
  border-color: rgba(255,255,255,.25);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}
.blog-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(6px);
  text-align: left;
  transition: transform .3s, background .3s, border-color .3s;
  cursor: pointer;
}
.blog-card:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}
.blog-card-img {
  width: 100%; height: 160px;
  object-fit: cover;
  display: block; background: rgba(255,255,255,.03);
}
.blog-card-body { padding: var(--space-md) var(--space-md) var(--space-lg); }
.blog-card-category {
  display: inline-block;
  font-size: clamp(10px,.7vw,11px);
  text-transform: uppercase; letter-spacing: .08em;
  color: #f0a870;
  margin-bottom: var(--space-xs);
}
.blog-card-title {
  font-size: clamp(15px,1.2vw,18px);
  font-weight: 600;
  margin-bottom: var(--space-xs);
  line-height: 1.3;
}
.blog-card-excerpt {
  font-size: clamp(12px,.85vw,13px);
  opacity: .6;
  line-height: 1.55;
  margin-bottom: var(--space-sm);
}
.blog-card-meta {
  font-size: clamp(10px,.7vw,11px);
  opacity: .4;
  display: flex; align-items: center; gap: var(--space-sm);
}
.blog-loading {
  text-align: center; padding: var(--space-xl) 0;
  opacity: .45; font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
}
.blog-empty { text-align: center; padding: var(--space-xl) 0; opacity: .45; }

/* ── Blog post detail modal ── */
.blog-post-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
  padding: var(--space-lg);
}
.blog-post-overlay.open { opacity: 1; pointer-events: auto; }
.blog-post-modal {
  background: #1a1510;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-xl);
  max-width: 680px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  padding: var(--space-xl);
  position: relative;
  box-shadow: var(--shadow-modal);
  transform: scale(.96) translateY(8px);
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent;
}
.blog-post-overlay.open .blog-post-modal { transform: scale(1) translateY(0); }
.blog-post-modal::-webkit-scrollbar { width: 4px; }
.blog-post-modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.blog-post-close {
  position: absolute; top: var(--space-md); right: var(--space-md);
  background: none; border: none;
  color: rgba(255,255,255,.4);
  font-size: 22px; cursor: pointer;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .2s, color .2s;
  line-height: 1;
}
.blog-post-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.blog-post-modal img {
  width: 100%; border-radius: var(--radius);
  margin-bottom: var(--space-lg);
  max-height: 340px; object-fit: cover;
}
.blog-post-modal .post-category {
  display: inline-block;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: #f0a870;
  margin-bottom: var(--space-sm);
}
.blog-post-modal h2 {
  font-size: clamp(22px,2.8vw,30px);
  margin-bottom: var(--space-sm);
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.blog-post-modal .post-meta {
  font-size: 13px; opacity: .35;
  margin-bottom: var(--space-lg);
}
.blog-post-modal .post-body {
  font-size: clamp(14px,.9vw,15px);
  line-height: 1.75;
  opacity: .82;
}
.blog-post-modal .post-body p { margin-bottom: var(--space-md); }
.blog-post-modal .post-body img { margin: var(--space-md) 0; }

/* ── Product detail overlay ── */
.product-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-lg);
  opacity: 0; transition: opacity .3s ease;
}
.product-overlay.open { opacity: 1; }
.product-modal {
  background: #1a1510;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 720px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-modal);
  transform: scale(.95) translateY(10px);
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
  position: relative;
}
.product-overlay.open .product-modal { transform: scale(1) translateY(0); }
.product-close {
  position: absolute; top: 14px; right: var(--space-md); z-index: 10;
  background: rgba(0,0,0,.3); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
  width: 32px; height: 32px;
  border-radius: 50%; font-size: 18px;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background .2s, color .2s;
  line-height: 1;
}
.product-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.product-modal-inner { display: flex; flex-direction: column; }
.product-modal-img {
  width: 100%; height: 320px;
  background-size: cover; background-position: center;
  background-color: #2a2018;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.product-modal-body { padding: var(--space-xl) var(--space-xl) var(--space-xl); }

.product-modal-body > * {
  opacity: 0;
  animation: fadeUp .4s ease forwards;
}
.product-modal-type {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: #f0a870;
  display: block; margin-bottom: var(--space-xs);
  animation-delay: .05s;
}
.product-modal-body h2 {
  font-weight: 600;
  font-size: clamp(22px,2.5vw,28px);
  margin-bottom: var(--space-sm);
  color: #f0e8e0;
  animation-delay: .1s;
}
.product-modal-price {
  font-size: clamp(20px,2.2vw,26px);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  animation-delay: .15s;
}
.product-modal-cat {
  display: inline-block;
  font-size: 11px; padding: 2px 10px;
  border-radius: 100px;
  background: rgba(184,106,58,.1);
  color: var(--accent);
  margin-bottom: var(--space-md);
  animation-delay: .2s;
}
.product-modal-desc {
  font-size: clamp(14px,.9vw,15px);
  line-height: 1.7; opacity: .78;
  animation-delay: .25s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Tablet (601–900px) ── */
@media (min-width: 601px) and (max-width: 900px) {
  #section-shop .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: var(--space-md); }
  .section .grid { margin-top: var(--space-md); }
  .blog-content { padding: 0 var(--space-md); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .blog-card-img { height: 140px; }
}

/* ── Mobile (≤600px) ── */
@media (max-width: 600px) {
  .section {
    padding: var(--space-xl) var(--space-md) 80px;
    justify-content: flex-start;
    overflow: hidden;
  }
  .section h2 {
    font-size: clamp(20px,4.5vw,30px);
    flex-shrink: 0;
  }
  .section > p {
    font-size: clamp(13px,1.4vw,15px);
    max-width: 100%;
    flex-shrink: 0;
  }
  #section-shop .grid {
    grid-template-columns: repeat(2, 1fr);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    padding: var(--space-sm);
    gap: var(--space-sm);
    margin-top: var(--space-md);
    align-content: start;
  }
  #section-shop .card { min-height: 170px; height: auto; }
  #section-shop .card .card-content { padding: 12px 10px 10px; }
  #section-shop .card .product-type { font-size: 9px; margin-bottom: 2px; }
  #section-shop .card .product-price { font-size: 12px; margin-bottom: 3px; }
  #section-shop .card p { font-size: 9px; }
  #section-shop .card:hover { transform: translateY(-2px); }
  #section-shop .card:hover .card-content { transform: translateY(-2px); }
  .category-filters { gap: var(--space-xs); margin-bottom: 0; padding: var(--space-sm) 0; flex-shrink: 0; }
  .cat-filter { padding: 5px 10px; font-size: 9px; }
  .product-overlay { padding: var(--space-sm); align-items: flex-end; }
  .product-modal { max-height: 85vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .product-modal-img { height: 160px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .product-modal-body { padding: var(--space-lg); }
  .blog-post-overlay { padding: var(--space-sm); align-items: flex-end; }
  .blog-post-modal {
    padding: var(--space-lg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
  }
  .blog-post-modal img { max-height: 180px; }
  .blog-post-modal h2 { font-size: 18px; }
  .blog-content { max-height: 70vh; padding: 0 var(--space-sm); }
  .blog-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm);
  }
  .blog-card-img { height: 120px; }
  .blog-card-body { padding: var(--space-sm) var(--space-sm) var(--space-md); }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
