/* ==========================================================================
   Oopsiedeadsie - Warm Editorial Holding Page
   A site about death that feels alive
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Reset / Normalize
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */

:root {
  /* Colors - Warm Dark Theme */
  --color-bg: #1a1814;
  --color-bg-elevated: #252119;
  --color-text: #f5f0e8;
  --color-text-muted: #8b8275;
  --color-accent: #e07a5f;
  --color-accent-hover: #e8917a;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Font Weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-bold: 700;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 42rem;
  --gutter: clamp(1.5rem, 5vw, 4rem);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;

  /* Animation Delays for Staggered Reveals */
  --delay-1: 0ms;
  --delay-2: 100ms;
  --delay-3: 200ms;
  --delay-4: 300ms;
  --delay-5: 400ms;
}

/* --------------------------------------------------------------------------
   Body & Background
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: var(--weight-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  position: relative;
}

/* Subtle Grain Texture Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.035;
  z-index: 1000;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Main Layout
   -------------------------------------------------------------------------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl) var(--gutter);
  position: relative;
}

.content {
  max-width: var(--max-width);
  width: 100%;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-md);

  /* Fraunces variable font optical sizing */
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 50, 'WONK' 1;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: var(--weight-medium);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-text);
  margin-bottom: var(--space-sm);

  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 30, 'WONK' 0;
}

p {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

p.lead {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  color: var(--color-text);
  opacity: 0.9;
}

/* Accent text */
.accent {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Links & Interactive Elements
   -------------------------------------------------------------------------- */

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-base);
}

a:hover {
  color: var(--color-accent-hover);
}

a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* Button style */
.button {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: var(--weight-medium);
  color: var(--color-bg);
  background-color: var(--color-accent);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.button::after {
  display: none;
}

.button:hover {
  color: var(--color-bg);
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Fade-In Animation with Staggered Reveals
   -------------------------------------------------------------------------- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 800ms ease forwards;
}

.fade-in:nth-child(1) { animation-delay: var(--delay-1); }
.fade-in:nth-child(2) { animation-delay: var(--delay-2); }
.fade-in:nth-child(3) { animation-delay: var(--delay-3); }
.fade-in:nth-child(4) { animation-delay: var(--delay-4); }
.fade-in:nth-child(5) { animation-delay: var(--delay-5); }

/* Alternative staggered delay classes */
.delay-1 { animation-delay: var(--delay-1); }
.delay-2 { animation-delay: var(--delay-2); }
.delay-3 { animation-delay: var(--delay-3); }
.delay-4 { animation-delay: var(--delay-4); }
.delay-5 { animation-delay: var(--delay-5); }

/* --------------------------------------------------------------------------
   Decorative Elements
   -------------------------------------------------------------------------- */

/* Asymmetric accent line */
.accent-line {
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
  margin: var(--space-lg) auto;
  transform: rotate(-2deg);
}

/* Subtle divider */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-text-muted),
    transparent
  );
  opacity: 0.3;
  margin: var(--space-xl) 0;
}

/* --------------------------------------------------------------------------
   Form Elements (for email signup, etc.)
   -------------------------------------------------------------------------- */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: 24rem;
  margin: var(--space-lg) auto;
}

.form-input {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-text-muted);
  padding: var(--space-sm) var(--space-md);
  border-radius: 2px;
  transition: border-color var(--transition-fast);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-inline {
  display: flex;
  gap: var(--space-xs);
}

.form-inline .form-input {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  :root {
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
  }

  body {
    font-size: 1rem;
  }

  p {
    font-size: 1rem;
  }

  .form-inline {
    flex-direction: column;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in {
    opacity: 1;
  }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  :root {
    --color-text-muted: #b0a89a;
  }

  body::before {
    display: none;
  }
}
