/* ============================================
   Nick Householder Portfolio
   Direction J: Prismatic Blocks
   Fonts: Clash Display + Outfit + JetBrains Mono
   ============================================ */

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

:root {
  --bg: #111111;
  --text: #f8fafc;
  --text-mid: #b0b8c4;
  --text-dim: #5a6270;
  --display: 'Clash Display', sans-serif;
  --body: 'Outfit', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ============================================
   Header — Glass floating bar
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  background: rgba(17, 17, 17, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.wordmark:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
  border-radius: 2px;
}

nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  cursor: pointer;
}

nav a:hover { color: var(--text); }
nav a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ============================================
   Hero — Gradient background, centered
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 var(--space-xl);
  position: relative;
  background: linear-gradient(135deg, #1a1040 0%, #0f2027 40%, #0a2a2a 100%);
  overflow: hidden;
}

/* Subtle radial glow */
.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 10%;
  left: 20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: var(--space-lg);
}

h1 {
  font-family: var(--display);
  font-size: clamp(3rem, 8.5vw, 7rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: var(--text);
}

.hero-sub {
  font-family: var(--body);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-mid);
  max-width: 500px;
  line-height: 1.75;
  margin-top: var(--space-xl);
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: var(--space-2xl);
  left: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 1;
}

.hero-scroll span {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.scroll-track {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.scroll-dot {
  width: 1px;
  height: 12px;
  background: var(--text-mid);
  position: absolute;
  top: 0;
  animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { top: -12px; opacity: 0; }
  30% { opacity: 1; }
  100% { top: 40px; opacity: 0; }
}

/* ============================================
   Project Blocks — Full-bleed color rooms
   ============================================ */
.projects {
  display: flex;
  flex-direction: column;
}

.block {
  display: flex;
  align-items: center;
  min-height: 420px;
  padding: var(--space-3xl) var(--space-xl);
  background: var(--block-bg);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.4s;
  border-left: 4px solid transparent;
}

.block:hover {
  border-left-color: var(--block-accent);
}

.block:focus-visible {
  outline: 3px solid var(--block-accent);
  outline-offset: -3px;
}

/* Oversized background number */
.block-number {
  position: absolute;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(8rem, 20vw, 16rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.03);
  right: var(--space-xl);
  bottom: -0.1em;
  pointer-events: none;
  user-select: none;
  transition: color 0.5s;
}

.block:hover .block-number {
  color: var(--block-glow);
}

/* Content area */
.block-content {
  max-width: 600px;
  position: relative;
  z-index: 1;
  margin-left: var(--space-3xl);
}

.block-content.align-right {
  margin-left: auto;
  margin-right: var(--space-3xl);
  text-align: right;
}

.block-content.align-right .block-header {
  justify-content: flex-end;
}

.block-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.block-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--block-accent);
  border: 1px solid var(--block-accent);
  padding: 3px 12px;
  border-radius: 100px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.block:hover .block-tag {
  opacity: 1;
}

.block-arrow {
  color: var(--text-dim);
  transition: color 0.3s, transform 0.3s;
  flex-shrink: 0;
}

.block:hover .block-arrow {
  color: var(--block-accent);
  transform: translate(3px, -3px);
}

.block h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-md);
  transition: color 0.3s;
}

.block:hover h2 {
  color: var(--block-accent);
}

.block p {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: var(--space-lg);
}

.block-url {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  transition: color 0.3s;
}

.block:hover .block-url {
  color: var(--block-accent);
}

/* Scroll-triggered entrance */
.block {
  opacity: 0;
  transform: translateY(32px);
}

.block.visible {
  animation: blockIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.block.visible:nth-child(2) { animation-delay: 0.05s; }
.block.visible:nth-child(3) { animation-delay: 0.1s; }
.block.visible:nth-child(4) { animation-delay: 0.15s; }
.block.visible:nth-child(5) { animation-delay: 0.2s; }
.block.visible:nth-child(6) { animation-delay: 0.25s; }
.block.visible:nth-child(7) { animation-delay: 0.3s; }

@keyframes blockIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Footer
   ============================================ */
footer {
  background: var(--bg);
  padding: var(--space-3xl) var(--space-xl);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.footer-link {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  cursor: pointer;
}

.footer-link:hover { color: var(--text); }
.footer-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ============================================
   Hero entrance
   ============================================ */
.hero-eyebrow { animation: fadeUp 0.7s ease-out both; }
h1 { animation: fadeUp 0.7s ease-out 0.1s both; }
.hero-sub { animation: fadeUp 0.7s ease-out 0.2s both; }
.hero-scroll { animation: fadeUp 0.7s ease-out 0.4s both; }

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

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .block { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .header-inner { padding: var(--space-md) var(--space-lg); }

  .hero { padding: 0 var(--space-lg); }
  h1 { font-size: clamp(2.4rem, 11vw, 3.8rem); }
  .hero-sub { font-size: 1rem; margin-top: var(--space-lg); }
  .hero-scroll { left: var(--space-lg); bottom: var(--space-xl); }

  .block {
    min-height: 320px;
    padding: var(--space-2xl) var(--space-lg);
  }

  .block-content {
    margin-left: 0;
  }

  .block-content.align-right {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
  }

  .block-content.align-right .block-header {
    justify-content: flex-start;
  }

  .block-number {
    font-size: 6rem;
    right: var(--space-md);
  }

  .block h2 { font-size: 1.8rem; }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header-inner { padding: 14px var(--space-md); }
  .hero { padding: 0 var(--space-md); }
  .hero-scroll { left: var(--space-md); }

  .block {
    min-height: 280px;
    padding: var(--space-xl) var(--space-md);
  }

  .block h2 { font-size: 1.5rem; }
  .block p { font-size: 0.92rem; }
  .block-number { font-size: 4.5rem; }

  footer { padding: var(--space-2xl) var(--space-md); }
}
