*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0f0f14;
  --bg-elevated: #1a1a24;
  --text: #f4f2ef;
  --text-muted: #b4b0b8;
  --gold: #d4ad32;
  --gold-rgb: 212, 173, 50;
  --gold-soft: rgba(212, 173, 50, 0.12);
  --border: rgba(255, 255, 255, 0.1);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-dramatic: cubic-bezier(0.16, 1, 0.3, 1);
  --leading: 1.7;
  --leading-tight: 1.25;
  --mood-transition: 0.9s var(--ease-dramatic);
}

html[data-mood="ember"] {
  --bg: #120e10;
  --bg-elevated: #1c1518;
  --gold: #e8925c;
  --gold-rgb: 232, 146, 92;
  --gold-soft: rgba(232, 146, 92, 0.14);
}

html[data-mood="sage"] {
  --bg: #0c1210;
  --bg-elevated: #141c18;
  --gold: #7eb89a;
  --gold-rgb: 126, 184, 154;
  --gold-soft: rgba(126, 184, 154, 0.14);
}

html[data-mood="dawn"] {
  --bg: #141218;
  --bg-elevated: #1e1a24;
  --gold: #c9a8e8;
  --gold-rgb: 201, 168, 232;
  --gold-soft: rgba(201, 168, 232, 0.14);
}

html[data-mood="noir"] {
  --bg: #080808;
  --bg-elevated: #141414;
  --gold: #c8c8c8;
  --gold-rgb: 200, 200, 200;
  --gold-soft: rgba(200, 200, 200, 0.1);
}

body {
  transition: background-color var(--mood-transition), color var(--mood-transition);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: var(--leading);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 90% 60% at 50% -15%, var(--gold-soft), transparent 55%),
    radial-gradient(circle at 85% 95%, rgba(var(--gold-rgb), 0.06), transparent 45%),
    radial-gradient(circle at 10% 80%, rgba(var(--gold-rgb), 0.04), transparent 35%);
  animation: ambient-drift 14s ease-in-out infinite alternate;
  transition: background var(--mood-transition);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(var(--gold-rgb), 0.55);
  box-shadow: 0 0 12px rgba(var(--gold-rgb), 0.4);
  animation: float-particle 12s var(--ease) infinite;
  opacity: 0;
}

.particles span:nth-child(1) { left: 8%; top: 18%; animation-delay: 0s; animation-duration: 14s; }
.particles span:nth-child(2) { left: 22%; top: 72%; animation-delay: 1.2s; animation-duration: 11s; }
.particles span:nth-child(3) { left: 45%; top: 35%; animation-delay: 2.4s; animation-duration: 16s; }
.particles span:nth-child(4) { left: 68%; top: 12%; animation-delay: 0.6s; animation-duration: 13s; }
.particles span:nth-child(5) { left: 88%; top: 58%; animation-delay: 3s; animation-duration: 15s; }
.particles span:nth-child(6) { left: 75%; top: 82%; animation-delay: 1.8s; animation-duration: 12s; }
.particles span:nth-child(7) { left: 55%; top: 88%; animation-delay: 4s; animation-duration: 17s; }
.particles span:nth-child(8) { left: 12%; top: 48%; animation-delay: 2s; animation-duration: 14s; }
.particles span:nth-child(9) { left: 92%; top: 28%; animation-delay: 0.3s; animation-duration: 11s; }
.particles span:nth-child(10) { left: 38%; top: 8%; animation-delay: 2.8s; animation-duration: 16s; }

@keyframes float-particle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.6); }
  15% { opacity: 0.7; }
  50% { opacity: 0.35; transform: translateY(-40px) scale(1); }
  85% { opacity: 0.6; }
}

.secret-flash {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.35), transparent 70%);
  opacity: 0;
}

.secret-flash.is-active {
  animation: secret-flash 1.2s var(--ease-dramatic) both;
}

@keyframes secret-flash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes ambient-drift {
  from { transform: scale(1) translateY(0) rotate(0deg); }
  to { transform: scale(1.06) translateY(-2%) rotate(1deg); }
}

::selection {
  background: rgba(212, 173, 50, 0.35);
  color: var(--text);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--gold), rgba(var(--gold-rgb), 0.4));
  box-shadow: 0 0 12px rgba(var(--gold-rgb), 0.5);
  z-index: 200;
  pointer-events: none;
  transition: width 0.08s linear;
}

.cursor-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.14) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  will-change: transform;
}

.cursor-glow-outer {
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.05) 0%, transparent 70%);
  z-index: 0;
}

.cursor-glow.is-active {
  opacity: 1;
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-glow {
    display: none;
  }

  body::before {
    animation: none;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

.logo:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

.logo-mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
}

.logo-text {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.logo-text em {
  font-style: normal;
  color: var(--text-muted);
}

.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav a {
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}

.nav a:hover {
  color: var(--text);
}

.hero {
  position: relative;
  padding: 4rem 0 5rem;
  max-width: 42rem;
}

.scroll-hint {
  margin: 3rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.5s var(--ease);
}

.scroll-hint.is-hidden {
  opacity: 0;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-item {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.is-visible .reveal-item,
.hero .reveal-item {
  animation: fade-up 0.75s var(--ease) both;
}

.hero .reveal-item:nth-child(1) { animation-delay: 0.05s; }
.hero .reveal-item:nth-child(2) { animation-delay: 0.15s; }
.hero .reveal-item:nth-child(3) { animation-delay: 0.25s; }
.hero .reveal-item:nth-child(4) { animation-delay: 0.35s; }
.hero .reveal-item:nth-child(5) { animation-delay: 0.55s; }

.reveal.is-visible .reveal-item:nth-child(1) { animation-delay: 0s; }
.reveal.is-visible .reveal-item:nth-child(2) { animation-delay: 0.08s; }
.reveal.is-visible .reveal-item:nth-child(3) { animation-delay: 0.16s; }
.reveal.is-visible .reveal-item:nth-child(4) { animation-delay: 0.24s; }

.reveal.is-visible .service-grid .reveal-item:nth-child(1) { animation-delay: 0.1s; }
.reveal.is-visible .service-grid .reveal-item:nth-child(2) { animation-delay: 0.2s; }
.reveal.is-visible .service-grid .reveal-item:nth-child(3) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .scroll-hint {
    display: none;
  }
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.25rem;
}

.logo-mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1;
  animation: logo-shimmer 6s ease-in-out infinite;
}

@keyframes logo-shimmer {
  0%, 85%, 100% { filter: brightness(1); text-shadow: none; }
  92% { filter: brightness(1.3); text-shadow: 0 0 20px rgba(var(--gold-rgb), 0.5); }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5vw, 3.35rem);
  font-weight: 400;
  line-height: var(--leading-tight);
  margin: 0 0 1.5rem;
  text-wrap: pretty;
  will-change: transform;
}

.type-wrap {
  display: inline-block;
  vertical-align: baseline;
  min-width: 11.5ch;
}

.type-word {
  display: inline;
  border-right: 3px solid var(--gold);
  padding-right: 2px;
  box-shadow: 3px 0 10px rgba(var(--gold-rgb), 0.35);
  animation: cursor-blink 0.9s step-end infinite;
}

@keyframes cursor-blink {
  0%, 45% {
    border-right-color: var(--gold);
    box-shadow: 3px 0 10px rgba(var(--gold-rgb), 0.35);
  }
  50%, 100% {
    border-right-color: transparent;
    box-shadow: none;
  }
}

.hero-lead {
  font-size: 1.125rem;
  line-height: var(--leading);
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 38rem;
  text-wrap: pretty;
  will-change: transform;
}

.hero-eyebrow,
.hero-actions {
  will-change: transform;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gold {
  color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.15s var(--ease),
    box-shadow 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: #e0b83a;
  box-shadow: 0 4px 24px rgba(var(--gold-rgb), 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.services {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.services h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 400;
  line-height: var(--leading-tight);
  margin: 0 0 2rem;
}

.service-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.service-card {
  padding: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition:
    border-color 0.25s var(--ease),
    transform 0.35s var(--ease-dramatic),
    box-shadow 0.35s var(--ease-dramatic),
    background-color var(--mood-transition);
}

.service-card:hover {
  border-color: rgba(var(--gold-rgb), 0.45);
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.35),
    0 0 40px rgba(var(--gold-rgb), 0.08);
}

.service-num {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.service-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: 0 0 0.6rem;
}

.service-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
  line-height: var(--leading);
}

.philosophy {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  max-width: 36rem;
}

.philosophy blockquote {
  margin: 0;
}

.philosophy blockquote p {
  font-family: var(--font-display);
  font-size: clamp(1.3125rem, 2.5vw, 1.5625rem);
  line-height: 1.55;
  font-weight: 400;
  margin: 0;
  color: var(--text);
  text-wrap: pretty;
}

.philosophy-note {
  margin: 1.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: var(--leading);
}

.glow-word {
  display: inline-block;
  transition: color 0.3s var(--ease), text-shadow 0.3s var(--ease), transform 0.3s var(--ease-dramatic);
  cursor: default;
}

.glow-word:hover {
  color: var(--gold);
  text-shadow: 0 0 28px rgba(var(--gold-rgb), 0.45);
  transform: scale(1.05);
}

.contact {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .contact {
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: start;
  }
}

.contact h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 400;
  line-height: var(--leading-tight);
  margin: 0 0 0.6rem;
}

.contact-intro p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: var(--leading);
  margin: 0;
}

.contact-form {
  display: grid;
  gap: 1rem;
}

@media (min-width: 480px) {
  .contact-form {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-form label.full {
  grid-column: 1 / -1;
}

.contact-form label span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background-color var(--mood-transition);
}

.contact-form select {
  padding-right: 2.5rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b4b0b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(180, 176, 184, 0.55);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.5);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.contact-form input:invalid:not(:placeholder-shown),
.contact-form textarea:invalid:not(:placeholder-shown),
.contact-form select:invalid:not([value=""]) {
  border-color: rgba(220, 80, 80, 0.5);
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.form-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-status {
  font-size: 0.875rem;
  margin: 0;
}

.form-status.success {
  color: #6bc96b;
}

.form-status.error {
  color: #e07070;
}

.footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.footer-brand {
  margin: 0;
  color: var(--text);
}

.mood-hint {
  font-style: normal;
  font-weight: 400;
  color: rgba(var(--gold-rgb), 0.65);
  font-size: 0.75rem;
}

.mood-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.15rem;
}

.mood-swatch {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  transition:
    transform 0.25s var(--ease-dramatic),
    box-shadow 0.25s;
}

.mood-swatch:hover {
  transform: scale(1.15);
}

.mood-swatch.is-active {
  box-shadow:
    0 0 0 2px var(--text),
    0 0 0 4px var(--bg),
    0 0 20px rgba(var(--gold-rgb), 0.35);
  transform: scale(1.1);
}

.mood-swatch[data-mood="gold"] { background-color: #d4ad32; background-image: linear-gradient(135deg, #d4ad32, #8a6d1a); }
.mood-swatch[data-mood="ember"] { background-color: #e8925c; background-image: linear-gradient(135deg, #e8925c, #a84a28); }
.mood-swatch[data-mood="sage"] { background-color: #7eb89a; background-image: linear-gradient(135deg, #7eb89a, #3d6b52); }
.mood-swatch[data-mood="dawn"] { background-color: #c9a8e8; background-image: linear-gradient(135deg, #c9a8e8, #7a5a9e); }
.mood-swatch[data-mood="noir"] { background-color: #d0d0d0; background-image: linear-gradient(135deg, #d0d0d0, #5a5a5a); }

.footer-copy {
  margin: 0;
}

.secret-whisper {
  color: rgba(var(--gold-rgb), 0.35);
  cursor: default;
  transition: color 0.3s, text-shadow 0.3s;
}

.secret-whisper:hover {
  color: var(--gold);
  text-shadow: 0 0 16px rgba(var(--gold-rgb), 0.5);
}

.nugget {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(8, 8, 12, 0.88);
  backdrop-filter: blur(12px);
}

.nugget:not([hidden]) {
  animation: nugget-backdrop 0.5s var(--ease-dramatic) both;
}

@keyframes nugget-backdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.nugget-inner {
  position: relative;
  max-width: 28rem;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(var(--gold-rgb), 0.4);
  border-radius: 12px;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(var(--gold-rgb), 0.12);
  animation: nugget-pop 0.65s var(--ease-dramatic) both;
}

@keyframes nugget-pop {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(24px) rotate(-1deg);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(0);
  }
}

.nugget-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--gold);
  margin: 0 0 1rem;
}

.nugget-inner p {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
  line-height: var(--leading);
}

.nugget-inner p:last-of-type {
  margin-bottom: 0;
}

.nugget-close {
  font-size: 0.8125rem;
  color: var(--text);
  font-style: italic;
}

.nugget-dismiss {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.nugget-dismiss:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nugget[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .type-word {
    border-right: none;
    box-shadow: none;
    animation: none;
  }

  .particles,
  .grain {
    display: none;
  }

  .logo-mark {
    animation: none;
  }

  .nugget-inner {
    animation: none;
  }
}
