/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { list-style: none; }
html { scroll-behavior: auto; }

body {
  background: var(--void);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  overflow-x: hidden;
}

/* Selection */
::selection { background: var(--accent); color: var(--void); }

/* Focus: visible accent ring everywhere, never removed without replacement (R-32) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link (R-32 keyboard access) */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 999;
  background: var(--accent);
  color: var(--void);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  border-radius: 3px;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible {
  top: 1rem;
  outline-offset: 0;
}

/* Typography defaults */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.eyebrow, .mono, .index, time, .tag, .clock, .nav-link, .lang-note {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.06em;
  color: var(--ivory-3);
}

p { max-width: 62ch; }
p.wide { max-width: 74ch; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Grain overlay: makes the black read as material rather than flat #000 (purpose, R-07) */
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
}

/* Custom cursor: pointer-fine only, tactile accent for the luxury feel (R-19 purpose) */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 300;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid var(--hairline-strong);
  transition: width var(--dur-fast) var(--ease-out), height var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.cursor-ring.is-hover {
  width: 56px; height: 56px;
  border-color: var(--accent);
}
body.has-custom-cursor, body.has-custom-cursor a, body.has-custom-cursor button {
  cursor: none;
}

@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
  body.has-custom-cursor, body.has-custom-cursor a, body.has-custom-cursor button {
    cursor: auto;
  }
}

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity var(--dur-slow) var(--ease-in-out), visibility var(--dur-slow);
}
.preloader__count {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  min-width: 3ch;
  text-align: center;
}
.preloader__bar {
  width: min(220px, 60vw);
  height: 1px;
  background: var(--hairline);
  position: relative;
  overflow: hidden;
}
.preloader__bar span {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent);
}
.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}
