/* =============================================================================
   TOBIN BLANK - Personal Website
   A clean, minimal, luxury personal brand site
   ============================================================================= */

/* -------------------------------------------------------------------------- */
/*                                COLOR PALETTE                                */
/* -------------------------------------------------------------------------- */
:root {
  /* Gold accents from original design */
  --gold:         #C9A227;
  --gold-light:   #E3C767;

  /* Dark luxury palette */
  --near-black:   #0C0C0C;
  --dark-jungle:  #1A2228;
  --warm-black:   #1C1C1C;

  /* Text colors */
  --text-primary:   #E8E4DF;
  --text-secondary: #9A9690;
  --text-muted:     #6B6760;

  /* UI elements */
  --accent:         #C49A6C;
  --accent-light:   #D4B896;
  --glass:          rgba(255, 255, 255, 0.06);
  --stroke:         rgba(255, 255, 255, 0.12);

  /* Borders */
  --border-subtle:  rgba(232, 228, 223, 0.05);
  --border-light:   rgba(232, 228, 223, 0.1);

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

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Loading animation */
  --sig-duration:  8.5s;
}

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

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

body {
  font-family: var(--font-primary);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--near-black);
  line-height: 1.75;
  overflow: auto;
}

/* Animated backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 70% -10%, rgba(201, 162, 39, 0.06), transparent 60%),
    radial-gradient(800px 600px at -10% 80%, rgba(227, 199, 103, 0.06), transparent 60%),
    linear-gradient(180deg, var(--near-black) 0%, var(--dark-jungle) 100%);
  background-attachment: fixed;
}

/* -------------------------------------------------------------------------- */
/*                                LOADING SCREEN                               */
/* -------------------------------------------------------------------------- */
.no-scroll {
  overflow: hidden;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--near-black);
  transition: opacity 2s ease;
}

.intro.complete {
  opacity: 0;
  visibility: hidden;
}

.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* Signature */
#signature {
  width: min(82vw, 900px);
  height: auto;
}

.sig-stroke {
  fill: none;
  stroke: url(#grad-stroke);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 3361.365;
  stroke-dashoffset: 3361.365;
  opacity: 0;
  animation: sig-draw 8s ease forwards 0.5s;
}

.sig-dot {
  fill: none;
  stroke: #EBDFAE;
  stroke-width: 2;
  stroke-dasharray: 15.3073;
  stroke-dashoffset: 15.3073;
  animation: sig-dot 0.25s linear forwards 0.8s;
}

@keyframes sig-draw {
  0% { opacity: 0; stroke-dashoffset: 3361.365; }
  6% { opacity: 1; }
  100% { opacity: 1; stroke-dashoffset: 0; }
}

@keyframes sig-dot {
  to { stroke-dashoffset: 0; }
}

/* Core values */
.intro-words {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
}

.intro-word {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0;
  transform: translateY(10px);
}

.intro-word.word-1 { animation: word-fade 1s ease forwards 2s; }
.intro-word.word-2 { animation: word-fade 1s ease forwards 3s; }
.intro-word.word-3 { animation: word-fade 1s ease forwards 4s; }

@keyframes word-fade {
  to { opacity: 1; transform: translateY(0); }
}

/* Loading bar */
.load-wrap {
  width: min(62vw, 540px);
}

.loading-track {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.loading-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.35);
  animation: load-progress var(--sig-duration) ease forwards 0.5s;
  position: relative;
}

.loading-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  mix-blend-mode: screen;
  opacity: 0.22;
  animation: load-sheen calc(var(--sig-duration) * 0.9) linear forwards 0.9s;
}

@keyframes load-progress {
  to { width: 100%; }
}

@keyframes load-sheen {
  to { transform: translateX(100%); }
}

/* -------------------------------------------------------------------------- */
/*                                SITE REVEAL                                 */
/* -------------------------------------------------------------------------- */
.intro-active .site,
.intro-active .site-header,
.intro-active .site-footer {
  opacity: 0;
  visibility: hidden;
}

.site,
.site-header,
.site-footer {
  transition: opacity 2s ease, visibility 2s ease;
}

body.revealed .site,
body.revealed .site-header,
body.revealed .site-footer {
  opacity: 1;
  visibility: visible;
}

body.revealed {
  overflow: auto;
}

/* -------------------------------------------------------------------------- */
/*                                LAYOUT                                      */
/* -------------------------------------------------------------------------- */
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(2rem, 5vw, 4rem);
}

/* Skip link - visually hidden */
.skip-link {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* -------------------------------------------------------------------------- */
/*                                HEADER                                      */
/* -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 3rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.5s ease, left 0.5s ease;
  transform: translateX(-50%);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
  left: 0;
  transform: translateX(0);
}

/* -------------------------------------------------------------------------- */
/*                                HERO                                        */
/* -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background:
    linear-gradient(160deg, rgba(12, 12, 12, 0.92) 0%, rgba(26, 34, 40, 0.65) 40%, rgba(12, 12, 12, 0.88) 100%),
    url("hero-mountain-1536-topcrop-tight.jpg");
  background-size: cover;
  background-position: center 35%;
  background-attachment: fixed;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(196, 154, 108, 0.025) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 10%, rgba(12, 12, 12, 0.4) 0%, transparent 40%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(2rem, 5vw, 4rem);
  padding-block: 8rem 5rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 2rem;
  max-width: 16ch;
}

.hero h1 span {
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 46ch;
  line-height: 1.85;
  font-weight: 300;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.5s ease, color 0.5s ease;
}

.hero-cta:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.hero-cta svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

.hero-cta:hover svg {
  transform: translateX(3px);
}

/* -------------------------------------------------------------------------- */
/*                                SECTIONS                                    */
/* -------------------------------------------------------------------------- */
section {
  padding-block: var(--space-3xl);
}

section + section {
  border-top: 1px solid var(--border-subtle);
}

/* Section headers */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.section-header p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  max-width: 60ch;
  line-height: 1.7;
}

/* Work grid */
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
}

.work-card {
  background: var(--near-black);
  padding: 2.25rem 1.75rem;
  transition: background-color 0.5s ease, transform 0.5s ease;
}

.work-card:hover {
  background: var(--dark-jungle);
  transform: translateY(-4px);
}

.work-card h3 {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.work-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.work-card .card-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* About section */
.about-section {
  background: var(--warm-black);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-content h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
}

.about-content p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat-card {
  padding: 1.75rem;
  background: var(--dark-jungle);
  box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.3), -6px -6px 12px rgba(255, 255, 255, 0.03);
  transition: transform 0.5s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card h4 {
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.stat-card p {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-primary);
}

/* Connect section */
.connect-section {
  text-align: center;
}

.connect-section h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.connect-section > .container > p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 48ch;
  margin: 0 auto 2.5rem;
}

.connect-links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-subtle);
}

.connect-links a {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.connect-links a:hover {
  color: var(--accent-light);
}

/* -------------------------------------------------------------------------- */
/*                                FOOTER                                      */
/* -------------------------------------------------------------------------- */
.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--warm-black);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.social {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.social a {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.social a:hover {
  color: var(--text-primary);
}

/* -------------------------------------------------------------------------- */
/*                                MOBILE NAV                                  */
/* -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 4px auto;
  transition: 0.5s ease;
  border-radius: 1px;
}

.menu-open .nav-toggle .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-open .nav-toggle .bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-open .nav-toggle .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* QR Prompt */
.qr-prompt {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--warm-black);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.3), -6px -6px 12px rgba(255, 255, 255, 0.03);
  z-index: 200;
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
  text-align: center;
}

.qr-prompt.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.qr-prompt p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.qr-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--near-black);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3), -4px -4px 8px rgba(255, 255, 255, 0.03);
}

.qr-close:hover {
  color: var(--text-primary);
}

/* -------------------------------------------------------------------------- */
/*                                RESPONSIVE                                   */
/* -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 1rem;
    right: 1rem;
    background: var(--near-black);
    border: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: 0.5s ease;
  }

  .menu-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    display: block;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    text-align: center;
  }

  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  section {
    padding-block: var(--space-xl);
  }

  .footer-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .connect-links {
    flex-direction: column;
    gap: 1rem;
  }

  .intro-words {
    gap: 1rem;
  }
}

/* -------------------------------------------------------------------------- */
/*                                REDUCE MOTION                                */
/* -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .intro {
    opacity: 0;
    visibility: hidden;
  }

  .site,
  .site-header,
  .site-footer {
    opacity: 1;
    visibility: visible;
  }
}
