/* ============================================================
   DIAVOLOS — shared stylesheet
   Aesthetic: dark, grainy, gothic, "made in 2012", exclusive.
   Palette: black + gray, white text, restrained crimson accent.
   Built mobile-first-ish but desktop is the primary canvas.
   ============================================================ */

/* ---------- Fonts ---------- */
/* Loaded via <link> in each page:
   Cinzel (engraved caps), Cormorant Garamond (serif/italic narrative),
   UnifrakturCook (blackletter flourish accents). */

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

:root {
  --void:    #050505;   /* page background          */
  --ash:     #0c0c0d;   /* raised surfaces          */
  --char:    #141416;   /* cards / panels           */
  --smoke:   #8c8a86;   /* secondary gray text      */
  --bone:    #e9e7e2;   /* primary near-white text  */
  --bone-dim:#bcb9b2;
  --crimson: #8a1717;   /* sparing accent           */
  --crimson-lit: #b4231f;
  --line:    rgba(233,231,226,0.12);
  --line-soft: rgba(233,231,226,0.05);

  --maxw: 1180px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Base ---------- */
body {
  background: var(--void);
  color: var(--bone);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: 0.2px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  /* faint starfield — a few soft specks layered over the void */
  background-image:
    radial-gradient(1px 1px at 18% 22%, rgba(233,231,226,.20), transparent 60%),
    radial-gradient(1px 1px at 73% 14%, rgba(233,231,226,.14), transparent 60%),
    radial-gradient(1px 1px at 41% 67%, rgba(233,231,226,.12), transparent 60%),
    radial-gradient(1px 1px at 88% 78%, rgba(233,231,226,.16), transparent 60%),
    radial-gradient(1px 1px at 9% 86%, rgba(233,231,226,.10), transparent 60%),
    radial-gradient(circle at 50% 0%, #111014 0%, var(--void) 60%);
  background-attachment: fixed;
}

/* film grain overlay — the "grainy" texture, self-contained SVG noise */
.grain {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* edge vignette — pulls focus to center, deepens the corners */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,.72) 100%);
}

/* thin double gothic frame around the whole viewport
   (z-index above the full-bleed banner so it frames it too) */
.frame {
  position: fixed;
  inset: 16px;
  z-index: 6;
  pointer-events: none;
  border: 1px solid var(--line);
}
.frame::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--line-soft);
}

/* ---------- Typography helpers ---------- */
.caps {
  font-family: "Cinzel", serif;
  letter-spacing: .28em;
  text-transform: uppercase;
}
.blackletter { font-family: "UnifrakturCook", "Cinzel", serif; font-weight: 700; }

a { color: var(--bone); text-decoration: none; }
a:hover { color: var(--crimson-lit); }

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

/* ornamental divider — symmetric thin flourish */
.ornament {
  display: block;
  width: 320px;
  max-width: 70%;
  height: auto;
  margin: 0 auto;
  opacity: .55;
  fill: none;
  stroke: var(--bone-dim);
  stroke-width: 1.1;
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity .8s var(--ease);
}
#loader.is-hidden { opacity: 0; }      /* fade OUT — no swipe */
#loader.is-gone   { display: none; }

/* The reveal lives on the container so it works whether the logo image
   or the text fallback is showing. Soft left→right wipe via a sliding
   mask gradient, paired with an opacity fade. */
.loader__reveal {
  opacity: 0;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 35%, rgba(0,0,0,0) 68%);
          mask-image: linear-gradient(to right, #000 0%, #000 35%, rgba(0,0,0,0) 68%);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: 300% 100%;
          mask-size: 300% 100%;
  -webkit-mask-position: 100% 0;
          mask-position: 100% 0;
  animation: logoReveal 1.9s var(--ease) .25s forwards;
  filter: drop-shadow(0 0 26px rgba(0,0,0,.9));
}
@keyframes logoReveal {
  0%   { opacity: 0; -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  18%  { opacity: 1; }
  100% { opacity: 1; -webkit-mask-position: 0 0;   mask-position: 0 0; }
}

.loader__logo {
  width: min(48vw, 440px);
  height: auto;
  display: block;
}

/* text fallback wordmark if the logo image is absent */
.loader__wordmark {
  display: block;
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 10vw, 5.4rem);
  letter-spacing: .22em;
  color: var(--bone);
  white-space: nowrap;
}

body.loading { overflow: hidden; }

/* ============================================================
   SITE HEADER / NAV  (catalog + product pages)
   ============================================================ */
.site-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 40px 22px;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-header__brand img { width: 46px; height: auto; }
.site-header__brand .name {
  font-family: "Cinzel", serif;
  letter-spacing: .34em;
  font-size: .82rem;
  text-transform: uppercase;
  color: var(--bone);
}
.site-nav {
  display: flex;
  gap: 34px;
}
.site-nav a {
  font-family: "Cinzel", serif;
  font-size: .72rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--smoke);
  transition: color .3s var(--ease);
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--bone); }

/* ============================================================
   SHARED LAYOUT
   ============================================================ */
.wrap {
  position: relative;
  z-index: 4;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 40px;
}

.page-head {
  text-align: center;
  padding: 70px 0 46px;
}
.page-head .eyebrow {
  font-family: "Cinzel", serif;
  font-size: .68rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--crimson-lit);
  margin-bottom: 18px;
}
.page-head h1 {
  font-family: "Cinzel", serif;
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bone);
}
.page-head p {
  max-width: 540px;
  margin: 22px auto 0;
  color: var(--smoke);
  font-style: italic;
  font-size: 1.05rem;
}

/* placeholder media block — intentional gothic monogram tile */
.ph {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 35%, #1a1a1d 0%, #0a0a0b 70%);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ph::before {
  /* inner grain so placeholders match the page texture */
  content: "";
  position: absolute;
  inset: 0;
  opacity: .08;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ph__mono {
  font-family: "UnifrakturCook", "Cinzel", serif;
  font-size: 5rem;
  color: rgba(233,231,226,.10);
  line-height: 1;
  user-select: none;
}
.ph__tag {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: .58rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--smoke);
  opacity: .6;
}

/* ============================================================
   CATALOG GRID
   ============================================================ */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;                 /* hairline gutters — gallery feel */
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  margin: 30px 0 90px;
}
.product-card {
  background: var(--void);
  display: block;
  padding: 0;
  border: 1px solid transparent;
  transition: background .4s var(--ease), border-color .35s var(--ease);
}
.product-card:hover { background: var(--ash); border-color: var(--crimson); }
.product-card__media {
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
}
.product-card__media .ph { width: 100%; height: 100%; }

/* Front / back image swap on hover */
.product-card__media--swap .img-front,
.product-card__media--swap .img-back {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .45s var(--ease);
}
.product-card__media--swap .img-front { opacity: 1; z-index: 1; }
.product-card__media--swap .img-back  { opacity: 0; z-index: 2; }
.product-card:hover .product-card__media--swap .img-front { opacity: 0; }
.product-card:hover .product-card__media--swap .img-back  { opacity: 1; }
.product-card__body {
  padding: 20px 22px 30px;
  text-align: center;
}
.product-card__name {
  font-family: "Cinzel", serif;
  font-size: .92rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bone);
  transition: color .3s var(--ease);
}
.product-card:hover .product-card__name { color: var(--crimson-lit); }
.product-card__meta {
  margin-top: 7px;
  font-size: .9rem;
  color: var(--smoke);
  font-style: italic;
}
.product-card__price {
  margin-top: 12px;
  font-family: "Cinzel", serif;
  font-size: .82rem;
  letter-spacing: .1em;
  color: var(--bone-dim);
}

/* ============================================================
   PRODUCT PAGE
   ============================================================ */
.breadcrumb {
  position: relative;
  z-index: 4;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 40px 0;
  font-family: "Cinzel", serif;
  font-size: .64rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--smoke);
}
.breadcrumb a { color: var(--smoke); }
.breadcrumb a:hover { color: var(--bone); }
.breadcrumb span { color: var(--bone-dim); }

.product {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 60px;
  align-items: start;
  padding: 40px 0 80px;
}
.product__media {
  aspect-ratio: 3 / 4;
}
.product__media .ph { width: 100%; height: 100%; }

.product__info { padding-top: 14px; }
.product__cat {
  font-family: "Cinzel", serif;
  font-size: .66rem;
  letter-spacing: .36em;
  text-transform: uppercase;
  color: var(--crimson-lit);
  margin-bottom: 16px;
}
.product__title {
  font-family: "Cinzel", serif;
  font-weight: 400;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--bone);
}
.product__price {
  margin-top: 16px;
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  letter-spacing: .08em;
  color: var(--bone-dim);
}
.product__desc {
  margin-top: 26px;
  color: var(--bone-dim);
  font-size: 1.08rem;
  line-height: 1.75;
}
.product__desc + .product__desc { margin-top: 16px; }

.spec {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  display: grid;
  gap: 10px;
}
.spec__row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: .98rem;
}
.spec__row dt {
  font-family: "Cinzel", serif;
  font-size: .64rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--smoke);
}
.spec__row dd { color: var(--bone-dim); font-style: italic; }

/* size selector */
.sizes { margin-top: 30px; }
.sizes__label {
  font-family: "Cinzel", serif;
  font-size: .64rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--smoke);
  margin-bottom: 14px;
}
.size-row { display: flex; gap: 10px; flex-wrap: wrap; }
.size-btn {
  min-width: 52px;
  padding: 12px 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--bone-dim);
  font-family: "Cinzel", serif;
  font-size: .72rem;
  letter-spacing: .1em;
  cursor: pointer;
  transition: border-color .3s var(--ease), color .3s var(--ease), background .3s var(--ease);
}
.size-btn:hover { border-color: var(--bone-dim); color: var(--bone); }
.size-btn.is-selected {
  border-color: var(--crimson);
  background: rgba(138,23,23,.15);
  color: var(--bone);
}
.size-btn:disabled,
.size-btn.is-disabled {
  opacity: .32;
  cursor: not-allowed;
  text-decoration: line-through;
  border-color: var(--line-soft);
  color: var(--smoke);
}
.size-btn:disabled:hover,
.size-btn.is-disabled:hover {
  border-color: var(--line-soft);
  color: var(--smoke);
  background: transparent;
}

/* buttons */
.btn {
  display: inline-block;
  width: 100%;
  margin-top: 30px;
  padding: 18px 0;
  text-align: center;
  background: var(--bone);
  color: #0a0a0a;
  border: 1px solid var(--bone);
  font-family: "Cinzel", serif;
  font-size: .74rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.btn:hover { background: transparent; color: var(--bone); }
.btn--ghost {
  background: transparent;
  color: var(--bone);
}
.btn--ghost:hover { background: var(--bone); color: #0a0a0a; }

.product__note {
  margin-top: 16px;
  text-align: center;
  font-size: .82rem;
  color: var(--smoke);
  font-style: italic;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 60px 40px 70px;
  border-top: 1px solid var(--line-soft);
  margin-top: 30px;
}
.site-footer .ornament { margin-bottom: 26px; }
.site-footer p {
  font-family: "Cinzel", serif;
  font-size: .64rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--smoke);
}
.site-footer .small { margin-top: 12px; letter-spacing: .18em; opacity: .6; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); }
  .product { grid-template-columns: 1fr; gap: 34px; }
  .site-header { flex-direction: column; gap: 18px; padding: 26px 24px 18px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap, .breadcrumb { padding-left: 22px; padding-right: 22px; }
  .catalog-grid { grid-template-columns: 1fr; }
  .frame { inset: 9px; }
  .site-nav { gap: 22px; }
}
