/* ============================================================
   MAIN — Global Reset + Layout Foundation
   ============================================================ */

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  overflow-x: hidden;
  cursor: none; /* custom cursor */
}

h1, h2, h3, h4, h5, h6, p, figure {
  margin: 0;
}

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

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

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  border: none;
  background: none;
  cursor: none;
  font-family: inherit;
}

input, textarea, select, button {
  font-family: var(--font-primary);
  font-size: var(--fs-base);
}

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

.container--full {
  width: 100%;
  max-width: 100%;
}

/* ── Page Wrapper ────────────────────────────────────────── */
#app {
  position: relative;
  overflow-x: hidden;
}

/* ── Section Base ────────────────────────────────────────── */
.section {
  width: 100%;
  position: relative;
}

.section--vh {
  min-height: 100vh;
}

/* ── Flex Utilities ──────────────────────────────────────── */
.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }

/* ── Text Utilities ──────────────────────────────────────── */
.text-muted   { color: var(--color-text-muted); }
.text-white   { color: var(--color-text-light); }
.text-accent  { color: var(--color-accent); }

/* ── Image Container ─────────────────────────────────────── */
.img-wrap {
  overflow: hidden;
  position: relative;
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--dur-slow) var(--ease-smooth);
  will-change: transform;
}

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

/* ── Overflow control ────────────────────────────────────── */
.overflow-hidden { overflow: hidden; }
.overflow-clip   { overflow: clip; }

/* ── Will-change optimization ────────────────────────────── */
.gpu {
  will-change: transform;
  transform: translateZ(0);
}

/* ── No select on interactive elements ───────────────────── */
.no-select {
  user-select: none;
  -webkit-user-select: none;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ── Page Load Overlay ───────────────────────────────────── */
#page-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 9999;
  pointer-events: none;
  transform-origin: top;
  transition: transform var(--dur-page) var(--ease-smooth);
}

#page-overlay.loaded {
  transform: scaleY(0);
}

/* ── Custom Cursor ───────────────────────────────────────── */
#cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-text);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition:
    transform var(--dur-fast) var(--ease-smooth),
    width var(--dur-medium) var(--ease-spring),
    height var(--dur-medium) var(--ease-spring),
    background-color var(--dur-fast) var(--ease-standard),
    opacity var(--dur-fast) var(--ease-standard);
  mix-blend-mode: difference;
}

#cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(22, 21, 21, 0.3);
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  transition:
    transform 0.12s var(--ease-smooth),
    width var(--dur-medium) var(--ease-spring),
    height var(--dur-medium) var(--ease-spring),
    opacity var(--dur-medium) var(--ease-standard),
    border-color var(--dur-medium) var(--ease-standard);
  will-change: transform;
}

body.cursor-hover #cursor {
  width: 6px;
  height: 6px;
  background: var(--color-accent);
}

body.cursor-hover #cursor-ring {
  width: 56px;
  height: 56px;
  border-color: rgba(255, 64, 0, 0.4);
}

body.cursor-text #cursor {
  width: 2px;
  height: 20px;
  border-radius: 1px;
  background: var(--color-text);
}

body.cursor-text #cursor-ring {
  opacity: 0;
}

/* Show default cursor on mobile */
@media (pointer: coarse) {
  body { cursor: auto; }
  #cursor, #cursor-ring { display: none; }
  button { cursor: pointer; }
  a { cursor: pointer; }
}
