/* ============================================
   Dragonfly Job Board — Styles
   Brutalist Editorial Crypto Aesthetic
   ============================================ */

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

/* --- @font-face --- */
@font-face {
  font-family: 'Non Natural Grotesk';
  src: url('../fonts/NONNaturalGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Non Natural Grotesk';
  src: url('../fonts/NONNaturalGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Non Natural Mono';
  src: url('../fonts/NONNaturalMono-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Variables --- */
:root {
  --dfly-black: #000000;
  --dfly-grey: #F2F2F2;
  --dfly-orange: #FA4C14;
  --dfly-pink: #EC39B6;
  --dfly-blue: #5014FA;
  --dfly-dim: #888888;

  --font-primary: 'Non Natural Grotesk', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Non Natural Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;

  --ease-out: cubic-bezier(.215, .61, .355, 1);
  --ease-in-out: cubic-bezier(.645, .045, .355, 1);
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);

  --grid-margin: 24px;
  --section-gap: 128px;

  --border-subtle: rgba(242, 242, 242, 0.08);
  --border-medium: rgba(242, 242, 242, 0.14);
}

/* --- Base --- */
html {
  background: var(--dfly-black);
  color: var(--dfly-grey);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Selection */
::selection {
  background: var(--dfly-orange);
  color: var(--dfly-black);
}

/* Film grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--grid-margin);
}

main {
  flex: 1;
}

.hidden {
  display: none !important;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.15; }
}

@keyframes loadBar {
  0% { transform: scaleX(0); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  50.01% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.anim-fade-up {
  animation: fadeUp 0.8s var(--ease-out-expo) both;
}

/* --- Section Label (reusable) --- */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding-bottom: 20px;
}

.section-label-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dfly-dim);
  white-space: nowrap;
}

.section-label-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.section-label-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--dfly-orange);
  white-space: nowrap;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeIn 0.6s var(--ease-out) both;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 18px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.3s var(--ease-out);
}

.logo:hover img {
  opacity: 1;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  padding: 10px 18px;
  color: var(--dfly-dim);
  position: relative;
  transition: color 0.3s var(--ease-out);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--dfly-orange);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out-expo);
}

.nav-link:hover {
  color: var(--dfly-grey);
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-link.active {
  color: var(--dfly-grey);
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* --- Hero --- */
.hero {
  padding: 96px 0 72px;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dfly-orange);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.7s var(--ease-out-expo) 0.1s both;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--dfly-orange);
}

.hero-title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: clamp(56px, 10vw, 120px);
  line-height: 0.88;
  letter-spacing: -3px;
  text-transform: uppercase;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.2s both;
}

.hero-subtitle {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.4;
  margin-top: 28px;
  color: var(--dfly-grey);
  opacity: 0.45;
  max-width: 560px;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.35s both;
}

.hero-rule {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--border-medium), transparent 80%);
  margin-top: 72px;
  animation: fadeIn 1s var(--ease-out) 0.5s both;
}

.hero-description {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.7;
  color: var(--dfly-grey);
  opacity: 0.4;
  margin-top: 40px;
  max-width: 680px;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.55s both;
}

/* --- Hero Glyph --- */
.hero-glyph {
  position: absolute;
  top: 72px;
  right: 0;
  width: 160px;
  height: auto;
  opacity: 0.045;
  user-select: none;
  pointer-events: none;
  animation: fadeIn 1.5s var(--ease-out) 0.8s both;
}

/* --- States --- */
.loading-state,
.error-state,
.empty-state {
  padding: 96px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loading-text,
.error-text,
.empty-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.4;
}

.loading-text {
  animation: pulse 2s ease-in-out infinite;
}

.loading-bar {
  width: 120px;
  height: 1px;
  background: var(--border-medium);
  position: relative;
  overflow: hidden;
}

.loading-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--dfly-orange);
  animation: loadBar 1.8s var(--ease-in-out) infinite;
}

.retry-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dfly-orange);
  padding: 10px 24px;
  border: 1px solid rgba(250, 76, 20, 0.3);
  transition: all 0.3s var(--ease-out);
}

.retry-btn:hover {
  background: var(--dfly-orange);
  color: var(--dfly-black);
  border-color: var(--dfly-orange);
}

/* --- Job List (Venture) --- */
.jobs-section {
  animation: fadeUp 0.6s var(--ease-out-expo) 0.5s both;
}

.job-list {
  border-top: 1px solid var(--border-subtle);
}

.job-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  transition: all 0.4s var(--ease-out-expo);
}

.job-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--dfly-orange);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease-out-expo);
}

.job-card:hover::before {
  transform: scaleY(1);
}

.job-card:active::before {
  transform: scaleY(1);
}

.job-card:hover {
  padding-left: 20px;
}

.job-card-content {
  flex: 1;
  min-width: 0;
}

.job-card-index {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  color: var(--dfly-dim);
  opacity: 0.4;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
  transition: all 0.3s var(--ease-out);
}

.job-card:hover .job-card-index {
  color: var(--dfly-orange);
  opacity: 1;
}

.job-title {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.3px;
  transition: color 0.3s var(--ease-out);
}

.job-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-medium);
  color: var(--dfly-dim);
  transition: all 0.3s var(--ease-out);
}

.job-card:hover .badge {
  border-color: rgba(250, 76, 20, 0.25);
  color: var(--dfly-grey);
}

.job-arrow {
  font-size: 20px;
  flex-shrink: 0;
  color: var(--dfly-dim);
  opacity: 0.3;
  transition: all 0.4s var(--ease-out-expo);
}

.job-card:hover .job-arrow {
  opacity: 1;
  color: var(--dfly-orange);
  transform: translateX(6px);
}

/* --- Process Section (Portfolio) --- */
.process {
  padding: 56px 0;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeUp 0.8s var(--ease-out-expo) 0.4s both;
}

.process-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.process-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dfly-dim);
}

.process-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.process-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.process-step {
  position: relative;
  padding: 0 32px;
  border-left: 1px solid var(--border-subtle);
}

.process-step:first-child {
  padding-left: 0;
  border-left: none;
}

.process-step:last-child {
  padding-right: 0;
}

.process-step-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  color: var(--dfly-orange);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  display: block;
}

.process-step-text {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--dfly-grey);
  opacity: 0.5;
}

/* --- Bucket Grid (Portfolio) --- */
.buckets-section {
  animation: fadeUp 0.6s var(--ease-out-expo) 0.5s both;
}

.bucket-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
}

.bucket-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1;
  padding: 20px;
  background: var(--dfly-black);
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
}

/* Subtle inner gradient for depth */
.bucket-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(242,242,242,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s var(--ease-out-expo);
}

.bucket-card:hover::after {
  opacity: 0;
}

/* Orange wipe on hover */
.bucket-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--dfly-orange);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease-out-expo);
  z-index: 0;
}

.bucket-card:hover::before {
  transform: translateY(0);
}

/* Active state for touch */
.bucket-card:active::before {
  transform: translateY(0);
}

.bucket-card-index {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--dfly-dim);
  opacity: 0.35;
  position: relative;
  z-index: 1;
  transition: all 0.4s var(--ease-out-expo);
}

.bucket-card:hover .bucket-card-index {
  color: var(--dfly-black);
  opacity: 0.5;
}

.bucket-card-bottom {
  position: relative;
  z-index: 1;
}

.bucket-card-name {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: -0.2px;
  transition: color 0.4s var(--ease-out-expo);
}

.bucket-card:hover .bucket-card-name {
  color: var(--dfly-black);
}

.bucket-card-arrow {
  font-size: 16px;
  margin-top: 10px;
  display: block;
  color: var(--dfly-dim);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: all 0.4s var(--ease-out-expo);
}

.bucket-card:hover .bucket-card-arrow {
  color: var(--dfly-black);
  opacity: 1;
  transform: translate(0, 0);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0;
  margin-top: var(--section-gap);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo {
  height: 14px;
  width: auto;
  opacity: 0.25;
  transition: opacity 0.3s var(--ease-out);
}

.footer-logo:hover {
  opacity: 0.5;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dfly-dim);
  opacity: 0.3;
  max-width: 280px;
  line-height: 1.5;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-nav-link {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dfly-dim);
  opacity: 0.35;
  transition: all 0.3s var(--ease-out);
}

.footer-nav-link:hover {
  color: var(--dfly-grey);
  opacity: 1;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dfly-dim);
  opacity: 0.2;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .bucket-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --grid-margin: 16px;
    --section-gap: 80px;
  }

  /* Header */
  .site-header .container {
    height: 56px;
  }

  .logo img {
    height: 15px;
  }

  .nav-link {
    font-size: 10px;
    padding: 8px 12px;
  }

  /* Hero */
  .hero {
    padding: 56px 0 40px;
  }

  .hero-eyebrow {
    font-size: 10px;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: 48px;
    letter-spacing: -1.5px;
  }

  .hero-subtitle {
    font-size: 16px;
    margin-top: 20px;
  }

  .hero-description {
    font-size: 14px;
    line-height: 1.6;
    margin-top: 24px;
  }

  .hero-rule {
    margin-top: 40px;
  }

  .hero-glyph {
    display: none;
  }

  /* Process */
  .process {
    padding: 36px 0;
    margin-bottom: 36px;
  }

  .process-header {
    margin-bottom: 28px;
  }

  .process-steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .process-step {
    padding: 0;
    border-left: none;
    padding-left: 16px;
    border-left: 1px solid var(--border-subtle);
  }

  .process-step:first-child {
    padding-left: 16px;
    border-left: 1px solid var(--border-subtle);
  }

  .process-step-text {
    font-size: 14px;
  }

  /* Bucket grid */
  .bucket-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bucket-card {
    padding: 16px;
  }

  .bucket-card-name {
    font-size: 13px;
  }

  .bucket-card-arrow {
    margin-top: 6px;
    font-size: 14px;
  }

  /* Job cards */
  .job-card {
    padding: 24px 0;
    gap: 16px;
  }

  .job-card:hover {
    padding-left: 12px;
  }

  .job-title {
    font-size: 18px;
  }

  .job-meta {
    margin-top: 10px;
    gap: 6px;
  }

  .badge {
    font-size: 9px;
    padding: 5px 8px;
  }

  .job-arrow {
    font-size: 16px;
  }

  /* Footer */
  .site-footer {
    padding: 32px 0;
    margin-top: 64px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
  }

  .footer-left {
    align-items: center;
  }

  .footer-tagline {
    max-width: none;
  }

  .footer-right {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 36px;
    letter-spacing: -1px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .hero-description {
    font-size: 13px;
  }

  .bucket-card {
    padding: 14px;
  }

  .bucket-card-index {
    font-size: 8px;
  }

  .bucket-card-name {
    font-size: 11px;
  }

  .job-title {
    font-size: 16px;
  }

  .process-step-text {
    font-size: 13px;
  }
}
