/* ============================================================
   KILISTRA — main.css
   Global resets, CSS variables, typography, utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;900&family=Cinzel+Decorative:wght@400;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Colors */
  --clr-bg:          #0F0E0C;
  --clr-bg-2:        #1A1814;
  --clr-bg-3:        #252018;
  --clr-surface:     #1E1B14;
  --clr-surface-2:   #2A2620;
  --clr-border:      rgba(201,168,76,0.18);
  --clr-border-soft: rgba(255,255,255,0.06);

  --clr-gold:        #C9A84C;
  --clr-gold-light:  #E4C97A;
  --clr-gold-dark:   #8F6F2A;
  --clr-gold-glow:   rgba(201,168,76,0.15);

  --clr-stone:       #F5F0E8;
  --clr-stone-muted: #C8BFA8;
  --clr-stone-dim:   #8A7E6A;

  --clr-terra:       #8B5E3C;
  --clr-terra-light: #B07D52;
  --clr-terra-dark:  #5A3A20;

  --clr-text:        #E8E0D0;
  --clr-text-muted:  #9A8E78;
  --clr-text-dim:    #5A5040;

  --clr-white:       #FFFFFF;
  --clr-overlay:     rgba(15,14,12,0.7);

  /* Typography */
  --font-display:    'Cinzel Decorative', 'Cinzel', serif;
  --font-heading:    'Cinzel', serif;
  --font-body:       'Inter', sans-serif;

  /* Spacing scale */
  --sp-xs:  0.25rem;
  --sp-sm:  0.5rem;
  --sp-md:  1rem;
  --sp-lg:  1.5rem;
  --sp-xl:  2rem;
  --sp-2xl: 3rem;
  --sp-3xl: 4rem;
  --sp-4xl: 6rem;
  --sp-5xl: 8rem;

  /* Radii */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
  --shadow-xl:   0 16px 64px rgba(0,0,0,0.7);
  --shadow-gold: 0 0 32px rgba(201,168,76,0.2);

  /* Transitions */
  --ease-fast:   0.15s ease;
  --ease-normal: 0.3s ease;
  --ease-slow:   0.6s ease;
  --ease-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1280px;
  --container-pad: clamp(1rem, 5vw, 3rem);
  --navbar-h:      72px;

  /* Z-index */
  --z-base:    1;
  --z-raised:  10;
  --z-overlay: 100;
  --z-modal:   200;
  --z-navbar:  300;
  --z-toast:   400;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

button, input, textarea, select {
  font: inherit;
  border: none;
  outline: none;
  background: none;
}

button { cursor: pointer; }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--clr-stone);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: clamp(1rem, 2vw, 1.25rem); }

p {
  color: var(--clr-text);
  max-width: 70ch;
}

.display-title {
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

/* ── Container ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── Section padding ───────────────────────────────────────── */
.section {
  padding-block: clamp(3rem, 8vw, 6rem);
}

/* ── Section header ────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--sp-3xl);
}

.section-header .section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--clr-gold);
  margin-bottom: var(--sp-sm);
}

.section-header h2 {
  margin-bottom: var(--sp-md);
}

.section-header p {
  color: var(--clr-text-muted);
  font-size: 1.05rem;
  max-width: 55ch;
  margin-inline: auto;
}

/* ── Gold divider ───────────────────────────────────────────── */
.gold-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  justify-content: center;
  margin-block: var(--sp-lg);
}

.gold-divider::before,
.gold-divider::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--clr-gold));
}

.gold-divider::after {
  background: linear-gradient(90deg, var(--clr-gold), transparent);
}

.gold-divider-icon {
  color: var(--clr-gold);
  font-size: 0.75rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 0.7rem 1.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all var(--ease-normal);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--ease-fast);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: var(--clr-gold);
  color: var(--clr-bg);
}

.btn-primary::before {
  background: rgba(255,255,255,0.12);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,168,76,0.4);
}

.btn-outline {
  border: 1px solid var(--clr-gold);
  color: var(--clr-gold);
}

.btn-outline::before {
  background: var(--clr-gold-glow);
}

.btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,168,76,0.2);
}

.btn-ghost {
  color: var(--clr-stone-muted);
  border: 1px solid var(--clr-border-soft);
}

.btn-ghost:hover {
  color: var(--clr-stone);
  border-color: var(--clr-border);
  background: var(--clr-surface-2);
}

/* ── Image placeholder ─────────────────────────────────────── */
.img-placeholder {
  background: var(--clr-surface-2);
  position: relative;
  overflow: hidden;
}

.img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    var(--clr-surface-2) 0%,
    var(--clr-bg-3) 50%,
    var(--clr-surface-2) 100%
  );
  background-size: 200% 200%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% -200%; }
  100% { background-position: 200% 200%; }
}

.img-wrapper {
  position: relative;
  overflow: hidden;
}

.img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ease-slow);
}

.img-wrapper:hover img {
  transform: scale(1.05);
}

/* ── Page hero (inner pages) ───────────────────────────────── */
.page-hero {
  position: relative;
  min-height: 42vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--sp-3xl);
  overflow: hidden;
  margin-top: var(--navbar-h);
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--clr-bg) 0%,
    var(--clr-overlay) 50%,
    rgba(15,14,12,0.4) 100%
  );
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--clr-gold);
  margin-bottom: var(--sp-sm);
}

.page-hero h1 {
  color: var(--clr-stone);
  margin-bottom: var(--sp-sm);
}

.page-hero p {
  color: var(--clr-stone-muted);
  font-size: 1.1rem;
  max-width: 55ch;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.8rem;
  color: var(--clr-text-dim);
  margin-bottom: var(--sp-md);
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
}

.breadcrumb a {
  color: var(--clr-gold-dark);
  transition: color var(--ease-fast);
}

.breadcrumb a:hover { color: var(--clr-gold); }

.breadcrumb-sep { color: var(--clr-text-dim); }

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-gold {
  background: rgba(201,168,76,0.12);
  color: var(--clr-gold);
  border: 1px solid rgba(201,168,76,0.25);
}

.badge-terra {
  background: rgba(139,94,60,0.12);
  color: var(--clr-terra-light);
  border: 1px solid rgba(139,94,60,0.25);
}

/* ── Ornament ───────────────────────────────────────────────── */
.ornament {
  display: inline-block;
  width: 40px;
  height: 2px;
  background: var(--clr-gold);
  vertical-align: middle;
  margin-inline: var(--sp-sm);
}

/* ── Scroll indicator ───────────────────────────────────────── */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: bounce 2s infinite;
}

.scroll-indicator span {
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--clr-gold));
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

/* ── Loading overlay ────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--clr-bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--sp-lg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--clr-gold);
  letter-spacing: 0.2em;
}

.loader-bar {
  width: 120px;
  height: 2px;
  background: var(--clr-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--clr-gold);
  border-radius: var(--radius-full);
  animation: load-fill 1s ease forwards;
}

@keyframes load-fill {
  to { width: 100%; }
}

/* ── Utilities ──────────────────────────────────────────────── */
.text-gold    { color: var(--clr-gold); }
.text-muted   { color: var(--clr-text-muted); }
.text-center  { text-align: center; }
.text-left    { text-align: left; }

.mt-auto { margin-top: auto; }
.mb-sm   { margin-bottom: var(--sp-sm); }
.mb-md   { margin-bottom: var(--sp-md); }
.mb-lg   { margin-bottom: var(--sp-lg); }
.mb-xl   { margin-bottom: var(--sp-xl); }

.hidden          { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.sr-only { @extend .visually-hidden; }

/* ── Responsive grid helpers ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-xl); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xl); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-xl); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── AOS overrides ──────────────────────────────────────────── */
[data-aos] {
  pointer-events: none;
}
[data-aos].aos-animate {
  pointer-events: auto;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--clr-bg); }
::-webkit-scrollbar-thumb { background: var(--clr-gold-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-gold); }

/* ── Selection ──────────────────────────────────────────────── */
::selection {
  background: rgba(201,168,76,0.3);
  color: var(--clr-stone);
}
