/* Global resets and variables */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ink: #111111;
  --paper: #fafafa;
  --ghost: #a8a8a8;
  --mist: #e4e4e4;
  --warm: #6e6e6e;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #efefef;
    --paper: #0e0e0e;
    --ghost: #3a3a3a;
    --mist: #1e1e1e;
    --warm: #8c8c8c;
  }
}

:root[data-theme="dark"] {
  --ink: #efefef;
  --paper: #0e0e0e;
  --ghost: #3a3a3a;
  --mist: #1e1e1e;
  --warm: #8c8c8c;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
  -webkit-font-smoothing: antialiased;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(26,25,21,0.06) 100%);
}

.scene {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2rem;
  position: relative;
}

/* Faint horizontal rule element */
.rule {
  width: 40px;
  height: 1px;
  background: var(--mist);
  margin: 0 auto;
  opacity: 0;
  animation: ruleIn 2s ease 1.8s forwards;
}

/* Name */
.name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeUp 2s cubic-bezier(0.23, 1, 0.32, 1) 0.3s forwards;
  text-align: center;
  line-height: 1.1;
}

.tagline {
  font-family: 'Inter', -apple-system, sans-serif;
  font-style: normal;
  font-weight: 300;
  font-size: clamp(0.7rem, 1.3vw, 0.82rem);
  color: var(--warm);
  letter-spacing: 0.06em;
  margin-bottom: 2.8rem;
  opacity: 0;
  animation: fadeUp 2s cubic-bezier(0.23, 1, 0.32, 1) 0.9s forwards;
  text-align: center;
  line-height: 1.7;
}

.blurb {
  max-width: 480px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 300;
  font-size: clamp(0.82rem, 1.2vw, 0.92rem);
  line-height: 1.8;
  color: var(--warm);
  text-align: center;
  margin: 2.8rem auto 3rem;
  opacity: 0;
  animation: fadeUp 2s cubic-bezier(0.23, 1, 0.32, 1) 1.4s forwards;
}

/* Contact row */
.contact {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 2s cubic-bezier(0.23, 1, 0.32, 1) 2.4s forwards;
}

.contact a {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm);
  text-decoration: none;
  border: 1px solid var(--mist);
  padding: 0.6rem 1.5rem;
  border-radius: 100px;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.contact a:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Corner markers — like crop marks on a proof */
.mark {
  position: fixed;
  width: 24px;
  height: 24px;
  opacity: 0;
  animation: markIn 2.5s ease 3s forwards;
}

.mark--tl { top: 2rem; left: 2rem; border-top: 1px solid var(--mist); border-left: 1px solid var(--mist); }
.mark--tr { top: 2rem; right: 2rem; border-top: 1px solid var(--mist); border-right: 1px solid var(--mist); }
.mark--bl { bottom: 2rem; left: 2rem; border-bottom: 1px solid var(--mist); border-left: 1px solid var(--mist); }
.mark--br { bottom: 2rem; right: 2rem; border-bottom: 1px solid var(--mist); border-right: 1px solid var(--mist); }

/* Small edition/location text */
.edition {
  position: fixed;
  bottom: 2.2rem;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm);
  opacity: 0;
  animation: fadeUp 2s ease 3.4s forwards;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ruleIn {
  from { opacity: 0; width: 0; }
  to { opacity: 1; width: 40px; }
}

@keyframes markIn {
  from { opacity: 0; }
  to { opacity: 0.5; }
}

/* Subtle cursor glow that follows mouse */
.glow {
  position: fixed;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 192, 176, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: left 0.8s cubic-bezier(0.23, 1, 0.32, 1), top 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: left, top;
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 2.2rem;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm);
  opacity: 0;
  animation: fadeUp 2s ease 3.4s forwards;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
  z-index: 100;
  -webkit-appearance: none;
}

.theme-toggle:hover {
  color: var(--ink);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .scene {
    padding: 3rem 1.8rem;
  }
  .name {
    font-size: clamp(1.9rem, 9vw, 3rem);
    letter-spacing: 0.12em;
  }
  .tagline {
    font-size: 0.88rem;
    margin-bottom: 2.2rem;
  }
  .blurb {
    font-size: 0.9rem;
    line-height: 1.8;
    margin: 2rem auto 2.4rem;
  }
  .contact {
    gap: 1.6rem;
  }
  .contact a {
    font-size: 0.68rem;
    padding: 0.55rem 1.2rem;
  }
  .mark { display: none; }
  .theme-toggle {
    top: 1.5rem;
    font-size: 0.6rem;
    color: var(--warm);
  }
  .edition {
    font-size: 0.6rem;
    bottom: calc(1.8rem + env(safe-area-inset-bottom, 0px));
    color: var(--warm);
  }
}

/* Selection color */
::selection {
  background: var(--mist);
  color: var(--ink);
}
