/* ============================================================
   mahwiz.me — shared base styles
   ------------------------------------------------------------
   COMPONENTS
     .skip-link       — keyboard skip-to-content
     .site-nav        — sticky top bar (appears past hero)
     .btn             — call-to-action button
     .sec-label       — section header w/ ornament lines
     .sep             — decorative section separator
     .card            — model / dataset / project tile
     .grid-2          — 2-column responsive grid (auto-fit)
     .reveal          — scroll-triggered fade-up
     footer           — site footer w/ ornament
   ------------------------------------------------------------
   SCALES
     --text-*         — fluid type (clamp)
     --space-*        — fluid spacing (clamp)
   ============================================================ */

:root {
  /* palette ------------------------------------------------- */
  --bg:        #0c0c0b;
  --bg-subtle: #11110f;
  --bg-card:   #171613;
  --bg-hover:  #1c1a16;
  --bg-blur:   rgba(12, 12, 11, 0.78);

  --text:      #e4dccf;
  --text-2:    #b8ad9d;
  --text-3:    #8b8171;

  --accent:    #ad8250;
  --accent-2:  #c0a373;
  --accent-3:  #d0b98f;

  --border:    #24211b;
  --border-2:  #383126;

  --link:      #b59b74;
  --link-h:    #d0b98f;

  /* fluid type --------------------------------------------- */
  --text-hero:  clamp(2.1rem, 5.2vw, 3.6rem);
  --text-h2:    clamp(1.4rem, 3vw, 2rem);
  --text-h3:    clamp(1.05rem, 1.8vw, 1.25rem);
  --text-body:  clamp(1rem, 1.15vw, 1.125rem);
  --text-small: clamp(0.8rem, 1vw, 0.9rem);
  --text-micro: clamp(0.68rem, 0.85vw, 0.78rem);

  /* fluid spacing ------------------------------------------ */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(1rem, 2vw, 1.5rem);
  --space-md: clamp(1.5rem, 3vw, 2.5rem);
  --space-lg: clamp(2.5rem, 5vw, 4rem);
  --space-xl: clamp(4rem, 8vw, 7rem);

  /* type families ------------------------------------------ */
  --font-serif:   'Crimson Pro', Georgia, serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;

  /* container ---------------------------------------------- */
  --wrap-max: 640px;
  --wrap-max-wide: 1280px;

  /* motion ------------------------------------------------- */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

::selection { background: rgba(173, 130, 80, 0.18); color: var(--text); }

body {
  font-family: var(--font-serif);
  font-size: var(--text-body);
  line-height: 1.78;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a, button {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

/* ── SKIP LINK ─────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.55rem 0.8rem;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ── STICKY NAV ────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--bg-blur);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
  transition: transform 0.35s var(--ease), border-color 0.35s ease;
  pointer-events: none;
}
.site-nav.is-pinned {
  transform: translateY(0);
  border-bottom-color: var(--border);
  pointer-events: auto;
}
.site-nav__inner {
  max-width: var(--wrap-max-wide);
  margin: 0 auto;
  padding: 0.8rem var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.site-nav__brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav__brand:hover { color: var(--accent-2); }
.site-nav__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.site-nav__links a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 0.25s ease;
}
.site-nav__links a:hover { color: var(--accent-2); }

/* ── LAYOUT WRAP ───────────────────────────────────────── */
.wrap {
  width: min(100%, var(--wrap-max));
  margin: 0 auto;
  padding: var(--space-lg) var(--space-sm) var(--space-lg);
}

/* ── ANIMATIONS ────────────────────────────────────────── */
@keyframes up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-2);
  padding: 0.55rem 0.95rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: transparent;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s;
}
.btn.primary {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-1px);
}
.btn.primary:hover {
  color: var(--bg);
  background: var(--link-h);
  border-color: var(--link-h);
}

/* ── SECTION HEADER ────────────────────────────────────── */
.sec-head {
  text-align: center;
  margin-bottom: var(--space-md);
}
.sec-label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  position: relative;
}
.sec-label::before,
.sec-label::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 26px;
  height: 1px;
  background: var(--border-2);
}
.sec-label::before { right: calc(100% + 14px); }
.sec-label::after  { left:  calc(100% + 14px); }

/* ── SEPARATOR ─────────────────────────────────────────── */
.sep {
  text-align: center;
  margin: var(--space-md) auto;
  color: var(--accent);
  opacity: 0.35;
  font-size: 0.7rem;
  letter-spacing: 0.9em;
}

/* ── FOOTER ────────────────────────────────────────────── */
footer.site-foot {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  text-align: center;
  position: relative;
}
footer.site-foot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}
.foot-orn {
  color: var(--accent);
  opacity: 0.35;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
}
.foot-note {
  margin-top: 1.2rem;
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.08em;
  font-family: var(--font-display);
}

/* ── RESPONSIVE (shared base) ──────────────────────────── */
@media (max-width: 600px) {
  .wrap { padding-left: 1.4rem; padding-right: 1.4rem; }
  .site-nav__links { gap: 1.1rem; }
  .site-nav__links a { font-size: 0.7rem; letter-spacing: 0.14em; }
}
@media (max-width: 520px) {
  .wrap { width: 100%; max-width: 100vw; }
  .site-nav__brand { font-size: 0.85rem; letter-spacing: 0.14em; }
}

/* ── REDUCED MOTION ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
  .site-nav { transform: none; }
}
