/* ── Mories Regular ── */
@font-face {
  font-family: 'Mories';
  src: url('../fonts/Mories.otf') format('opentype'),
       url('../fonts/Mories.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Mories Display ── */
@font-face {
  font-family: 'Mories Display';
  src: url('../fonts/Mories Display.otf') format('opentype'),
       url('../fonts/Mories Display.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

/* ── Variables ── */
:root {
  --cream:          #f0ebe4;
  --cream-deep:     #e8e1d8;
  --header-bg:      #120c06;
  --card:           #ffffff;
  --text:           #1a1714;
  --text-muted:     #7a736c;
  --text-light:     #f0ece6;
  --text-light-dim: rgba(240,236,230,0.60);
  --line:           rgba(0,0,0,0.09);
  --line-hover:     rgba(0,0,0,0.18);
  --shadow-card:    0 2px 12px rgba(0,0,0,0.09), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-hover:   0 6px 22px rgba(0,0,0,0.14), 0 2px 6px rgba(0,0,0,0.07);
  --accent:         #c9945c;
  --accent-text:    #9b6535;
  --radius:         16px;
}

/* ── Base — cream throughout ── */
html, body {
  min-height: 100%;
  background-color: var(--cream);
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--cream);
}

/* ── Page layout ── */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem max(3rem, env(safe-area-inset-bottom));
}

/* ── Header logo text ── */
.logo-text {
  font-family: 'Mories', Georgia, serif;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.08em;
  line-height: 1;
  display: block;
}

.logo-text--full {
  font-family: 'Mories Display', 'Mories', Georgia, serif;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  letter-spacing: 0.14em;
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

.logo-text--full::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.28rem;
  transform: translateX(-50%);
  width: 68%;
  height: 1px;
  background: rgba(255, 255, 255, 0.38);
}

.logo-text--full::after {
  content: '✦';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  padding: 0 0.45rem;
  background: var(--header-bg);
  color: #ffffff;
  font-size: 0.72rem;
  line-height: 1;
}

.logo-text--mini {
  font-size: 1.35rem;
}

/* ── Header logo (image fallack kept for compatibility) ── */
.header-logo {
  display: block;
  height: 72px;
  width: auto;
  object-fit: contain;
}

.header-logo--mini {
  height: 36px;
}

/* ════════════════════════════════════
   PROFILE HEADER (index.html)
   Full-bleed dark coffee zone
════════════════════════════════════ */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  /* Full-bleed: break out of .page padding */
  margin-left:  -1rem;
  margin-right: -1rem;
  padding: max(2.2rem, env(safe-area-inset-top)) 1rem 2rem;
  background: var(--header-bg);
  margin-top: 0;
  margin-bottom: 1.8rem;
}

.avatar-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #e0a96d 0%, #c2687e 50%, #9b59b6 100%);
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1e1208;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  position: relative; z-index: 1;
}

.avatar-letter {
  position: absolute;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  z-index: 0;
  line-height: 1;
}

.avatar--fallback img { display: none; }
.avatar--fallback .avatar-letter { z-index: 1; }

.profile-name {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.2;
}

/* ════════════════════════════════════
   CATEGORIES LIST
════════════════════════════════════ */
.links-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 2.5rem;
}

.categories-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem 0 0.1rem;
}

/* ── Category item (with share button) ── */
.item {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 58px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.item:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--line-hover);
  transform: translateY(-2px);
}

.item-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.75rem 0.85rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  min-width: 0;
}

.item-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }
.item-main > span:not(.item-icon) { flex: 1; }

.lt-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.30;
  color: var(--text);
  transition: opacity 0.2s, transform 0.2s;
}

.item:hover .lt-chevron {
  opacity: 0.55;
  transform: translateX(2px);
}

.item-dots {
  width: 50px;
  flex-shrink: 0;
  border: none;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.item-dots:hover { color: var(--text); background: rgba(0,0,0,0.03); }
.item-dots:active { transform: scale(0.94); }

/* ── Brand footer ── */
.brand-tag {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.18);
  letter-spacing: 0.06em;
  padding-bottom: 0.5rem;
}

/* ════════════════════════════════════
   MINI HEADER (looks + products)
   Full-bleed dark coffee zone
════════════════════════════════════ */
.mini-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  /* Full-bleed */
  margin-left:  -1rem;
  margin-right: -1rem;
  margin-bottom: 1.25rem;
  padding: max(0.9rem, env(safe-area-inset-top)) 1rem 0.9rem;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-light);
}

.mini-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #e0a96d 0%, #c2687e 100%);
  flex-shrink: 0;
}

.mini-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #1e1208;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}

.mini-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.03em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--text-light-dim);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.back-link:hover {
  color: var(--text-light);
  background: rgba(255,255,255,0.14);
}

/* ════════════════════════════════════
   GALLERY GRID
════════════════════════════════════ */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-media {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--cream-deep);
  overflow: hidden;
}

.card-media img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.35s ease;
}

.card:hover .card-media img { transform: scale(1.03); }

.ph, .state {
  width: 100%;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 1rem;
}

.state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.5);
}

/* ════════════════════════════════════
   SHARE SHEET
════════════════════════════════════ */
.share-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
}

.share-sheet {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 420px);
  z-index: 90;
  background: #1a1208;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 0.8rem;
  box-shadow: 0 24px 60px rgba(0,0,0,0.50);
}

.share-handle {
  width: 36px; height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  margin: 0.15rem auto 0.9rem;
}

.share-action {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: var(--text-light);
  padding: 0.95rem 1rem;
  font-size: 0.93rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: background 0.2s;
}

.share-action:hover { background: rgba(255,255,255,0.11); }
.share-action + .share-action { margin-top: 0.55rem; }

.share-action-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.5;
  color: var(--text-light);
}

/* ── Toast ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--header-bg);
  color: var(--text-light);
  border-radius: 999px;
  padding: 0.68rem 1.1rem;
  font-size: 0.83rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (min-width: 640px) {
  .profile { padding-top: 2.8rem; padding-bottom: 2.2rem; }
  .avatar-ring { width: 100px; height: 100px; }
  .profile-name { font-size: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, .item, .card, .toast { transition: none !important; }
}

/* ── Home variation only (categories) ── */
html:has(body[data-screen="categories"]),
body[data-screen="categories"] {
  background-color: var(--header-bg);
}

body[data-screen="categories"]::before {
  background:
    radial-gradient(ellipse 85% 40% at 50% -8%, rgba(201,148,92,0.12) 0%, transparent 60%),
    var(--header-bg);
}

body[data-screen="categories"] .links-wrap {
  margin-bottom: 2.2rem;
}

body[data-screen="categories"] .item {
  background: var(--cream);
  border: 1px solid rgba(0,0,0,0.14);
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
}

body[data-screen="categories"] .item:hover {
  border-color: rgba(0,0,0,0.22);
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}

body[data-screen="categories"] .item-dots {
  border-left: 1px solid rgba(0,0,0,0.14);
}

body[data-screen="categories"] .brand-tag {
  color: rgba(255,255,255,0.35);
}

/* ── Inner pages variation (looks + products) ── */
html:has(body[data-screen="looks"]),
html:has(body[data-screen="products"]),
body[data-screen="looks"],
body[data-screen="products"] {
  background-color: var(--header-bg);
}

body[data-screen="looks"]::before,
body[data-screen="products"]::before {
  background:
    radial-gradient(ellipse 85% 40% at 50% -8%, rgba(201,148,92,0.10) 0%, transparent 60%),
    var(--header-bg);
}

body[data-screen="looks"] .card,
body[data-screen="products"] .card {
  background: var(--cream);
  border: 1px solid rgba(0,0,0,0.14);
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
}

body[data-screen="looks"] .card:hover,
body[data-screen="products"] .card:hover {
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}

body[data-screen="looks"] .card-media,
body[data-screen="products"] .card-media {
  background: var(--cream-deep);
}

body[data-screen="looks"] .state,
body[data-screen="products"] .state {
  background: rgba(240, 235, 228, 0.72);
  border: 1px dashed rgba(0,0,0,0.14);
}
