:root {
  /* PALETTE */
  --bg: #050505;
  --surface: #0a0a0a;
  --border: #222222;
  --text-main: #ffffff;
  --text-muted: #888888;
  --accent: #ff3300; /* International Safety Orange */
  --code: #00ff41;   /* Terminal Green */

  /* DIMENSIONS */
  --max-width: 800px;
  --header-height: 100px;

  /* FONTS */
  --font-human: 'Inter', system-ui, sans-serif;
  --font-machine: 'JetBrains Mono', ui-monospace, monospace;

  /* ANIMATION */
  --ease-mechanical: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  --duration-fast: 0.2s;
  --duration-med: 0.4s;
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-human);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 4rem;
  cursor: crosshair;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--duration-fast);
}
a:hover {
  opacity: 0.85;
}

/* === ACCESSIBILITY === */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: #000;
  padding: 0.5rem 1rem;
  z-index: 10000;
  font-family: var(--font-machine);
  font-size: 0.8rem;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* === TEXTURE (Film Grain) === */
.noise-overlay {
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
}

.app-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === HEADER === */
header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  margin-bottom: 3rem;
  padding-top: 10px;
}

.brand-anim-container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding-bottom: 6px;
}

.brand-letters {
  display: flex;
  font-family: var(--font-machine);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-main);
}

.letter {
  display: inline-block;
  transform: translateY(110%);
  animation: riseUp 0.8s var(--ease-mechanical) forwards;
}
.L1 { animation-delay: 0.6s; }
.L2 { animation-delay: 0.7s; }
.L3 { animation-delay: 0.8s; }
.L4 { animation-delay: 0.9s; }
.L5 { animation-delay: 1.0s; }
.L6 { animation-delay: 1.1s; }

.baseline-draw {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--text-main);
  width: 0%;
  animation: drawLine 0.6s ease-out forwards;
  animation-delay: 1.2s;
}

@keyframes drawLine { to { width: 100%; } }
@keyframes riseUp { to { transform: translateY(0); } }

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-machine);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--code);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--code);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === HERO === */
.hero {
  margin-bottom: 4rem;
  animation: fadeIn 1s ease forwards 1.2s;
  opacity: 0;
}

.hero h1 {
  font-family: var(--font-human);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.03em;
}

.hero-accent {
  color: var(--accent);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2.5rem;
}

/* === PROGRESS BAR === */
.construction-status {
  max-width: 100%;
  border: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 2px;
}

.status-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-machine);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.progress-track {
  width: 100%;
  height: 12px;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--text-main);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0,0,0,0),
    rgba(0,0,0,0) 6px,
    rgba(0,0,0,0.8) 6px,
    rgba(0,0,0,0.8) 12px
  );
  transition: width 0.6s var(--ease-mechanical);
}

/* === NAVIGATION === */
.filter-bar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-machine);
  font-size: 0.8rem;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.25rem 0;
  cursor: crosshair;
  position: relative;
  transition: color 0.3s;
}
.filter-btn:hover,
.filter-btn:focus-visible {
  color: var(--text-main);
}
.filter-btn.active {
  color: var(--accent);
}
.filter-btn.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

/* === FEED === */
.feed-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  opacity: 0;
  animation: fadeIn 1s ease forwards 1.4s;
}

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

/* === CARD SYSTEM === */
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s;
}
.card:hover {
  border-color: #444;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-machine);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-header .accent {
  color: var(--accent);
}

.card-body {
  padding: 1.5rem;
}

h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1rem;
  font-weight: 500;
}

p {
  margin: 0;
  color: #b0b0b0;
  font-size: 0.95rem;
  line-height: 1.7;
}

.meta-line {
  font-family: var(--font-machine);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === IDENTITY === */
.identity-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2rem;
}

.id-photo {
  width: 100%;
  aspect-ratio: 1;
  background: #111;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.id-photo::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--code);
  box-shadow: 0 0 10px var(--code);
  animation: scan 3s infinite linear;
}

@keyframes scan {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.id-stats {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: var(--font-machine);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.id-stats strong {
  color: var(--text-main);
  min-width: 70px;
  display: inline-block;
}

/* === AUDIO / MUSIC === */
.audio-interface {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  background: #000;
  padding: 1rem;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text-main);
  border: none;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  cursor: crosshair;
  flex-shrink: 0;
}
.play-btn:hover {
  background: var(--accent);
}

.play-icon {
  width: 0;
  height: 0;
  border-left: 10px solid #000;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 3px;
  transition: all 0.15s;
}

.play-btn.is-playing .play-icon {
  width: 12px;
  height: 14px;
  border: none;
  background: transparent;
  border-left: 4px solid #000;
  border-right: 4px solid #000;
  margin-left: 0;
}

.waveform {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.bar {
  width: 3px;
  background: #333;
  border-radius: 2px;
  height: 40%;
}

.audio-interface.playing .bar {
  animation: equalize 0.8s infinite ease-in-out;
  background: var(--accent);
}

@keyframes equalize {
  0%, 100% { height: 20%; }
  50% { height: 100%; }
}

.stream-actions {
  margin-top: 1.25rem;
}

.stream-btn {
  display: inline-block;
  font-family: var(--font-machine);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--text-main);
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--text-main);
  transition: all 0.25s var(--ease-mechanical);
}
.stream-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  opacity: 1;
}

/* === ENGINEERING === */
.eng-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 1.75rem;
}

.eng-tag {
  font-family: var(--font-machine);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  color: var(--text-muted);
  background: #080808;
}

.eng-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.eng-item {
  border: 1px solid var(--border);
  padding: 1rem;
  background: #080808;
}

.eng-item h3 {
  font-family: var(--font-machine);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.eng-item p {
  font-size: 0.85rem;
}

/* === JOURNAL === */
.journal-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
}

.journal-entry {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  font-family: var(--font-machine);
  font-size: 0.75rem;
  align-items: center;
  transition: background 0.2s;
  cursor: crosshair;
}

.journal-entry:hover {
  background: #111;
}

.j-id {
  color: var(--text-muted);
}

.j-title {
  color: var(--text-main);
}

.j-date {
  color: var(--text-muted);
}

/* === PROJECTS === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  margin-top: 1.5rem;
}

.project-card {
  background: var(--surface);
  padding: 1.5rem;
  position: relative;
  min-height: 140px;
  transition: background 0.25s;
}

.project-card:hover {
  background: #111;
}

.tape-label {
  font-family: var(--font-machine);
  font-size: 0.65rem;
  background: var(--text-main);
  color: var(--bg);
  padding: 2px 6px;
  position: absolute;
  top: 12px;
  left: 12px;
  font-weight: 700;
}

.project-card h3 {
  margin-top: 1.75rem;
  font-family: var(--font-machine);
  font-size: 0.9rem;
}

.project-card p {
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.status-badge {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-machine);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--code);
  border: 1px solid var(--code);
  padding: 0.15rem 0.4rem;
}

/* === CONTACT === */
.contact-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-family: var(--font-machine);
  font-size: 0.8rem;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
}

.contact-item strong {
  color: var(--text-muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
}

.contact-item span,
.contact-item a {
  color: var(--text-main);
}

/* === LOCKED STATE === */
.locked {
  position: relative;
  cursor: not-allowed;
}

.locked .product-img,
.locked .card-body,
.locked .j-title,
.locked h3,
.locked p {
  opacity: 0.35;
  filter: grayscale(100%);
}

.locked::before {
  content: "ENCRYPTED";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.4rem 1rem;
  font-family: var(--font-machine);
  font-size: 0.7rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  pointer-events: none;
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-main);
  color: var(--bg);
  padding: 0.8rem 1.2rem;
  font-family: var(--font-machine);
  font-size: 0.75rem;
  transform: translateY(150%);
  transition: transform 0.4s var(--ease-mechanical);
  z-index: 200;
  font-weight: 700;
  pointer-events: none;
}

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

/* === FOOTER === */
footer {
  border-top: 1px solid var(--border);
  margin-top: 6rem;
  padding-top: 2rem;
  font-family: var(--font-machine);
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .identity-grid {
    grid-template-columns: 1fr;
  }

  .id-photo {
    max-width: 120px;
  }

  .journal-entry {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  header {
    height: 80px;
  }

  .brand-letters {
    font-size: 1.5rem;
  }
}

@media (min-width: 1400px) {
  :root {
    --max-width: 860px;
  }
}

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

  .letter {
    transform: none;
  }

  .baseline-draw {
    width: 100%;
  }

  .hero,
  .feed-grid {
    opacity: 1;
  }
}

/* YouTube player (hidden, controlled by custom UI) */
.yt-player {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.stream-btn--outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
}
.stream-btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}
