/* =========================================
   PROMPTS & FLOW - PORTFOLIO STYLESHEET
   Modern editorial × tech aesthetic
   ========================================= */

:root {
  /* Theme: Dark (default) */
  --bg: #0a0a0a;
  --bg-elevated: #131313;
  --bg-card: #161616;
  --border: #262626;
  --border-strong: #333;
  --text: #f5f5f5;
  --text-muted: #999;
  --text-faint: #666;
  --accent: #e8ff3a;
  --accent-hover: #d4eb1f;
  --accent-text: #0a0a0a;
  --noise-opacity: 0.03;
}

[data-theme="light"] {
  --bg: #fafaf7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: #e8e6e0;
  --border-strong: #d0cdc4;
  --text: #0f0f0f;
  --text-muted: #5a5a5a;
  --text-faint: #999;
  --accent: #1a1a1a;
  --accent-hover: #000;
  --accent-text: #e8ff3a;
  --noise-opacity: 0.02;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter Tight', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Subtle noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: var(--noise-opacity);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ============== NAVIGATION ============== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  backdrop-filter: blur(20px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.nav-logo-mark {
  display: inline-block;
  font-size: 1.2rem;
  filter: drop-shadow(0 0 8px var(--accent));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-cta {
  background: var(--accent);
  color: var(--accent-text) !important;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-weight: 600 !important;
}

.nav-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ============== THEME TOGGLE ============== */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 99;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ============== HERO ============== */
.hero {
  position: relative;
  padding: 8rem 2rem 4rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.15;
  filter: blur(80px);
  pointer-events: none;
}

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

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  margin-bottom: 2rem;
  animation: fadeUp 0.6s ease 0.1s both;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 12px #4ade80;
  animation: pulse 2s infinite;
}

.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin-bottom: 2rem;
  max-width: 1000px;
  animation: fadeUp 0.6s ease 0.2s both;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
  position: relative;
}

.hero-rotate {
  display: inline-block;
  font-style: italic;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.1em;
  min-width: 8ch;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2.5rem;
  line-height: 1.6;
  animation: fadeUp 0.6s ease 0.3s both;
}

.hero-sub abbr {
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
  animation: fadeUp 0.6s ease 0.4s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--text);
  background: var(--bg-card);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 700px;
  animation: fadeUp 0.6s ease 0.5s both;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.stat-num {
  font-family: 'Instrument Serif', serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
  font-style: italic;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Marquee */
.marquee {
  margin-top: 4rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.marquee-track {
  display: flex;
  gap: 2rem;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  color: var(--text-muted);
  font-style: italic;
}

.marquee-track span {
  flex-shrink: 0;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ============== SECTIONS COMMON ============== */
section {
  padding: 6rem 2rem;
  position: relative;
  z-index: 2;
}

.section-header {
  max-width: 1200px;
  margin: 0 auto 4rem;
}

.section-num {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.section-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin-bottom: 1rem;
  max-width: 900px;
}

.section-title em {
  font-style: italic;
  color: var(--accent);
}

.section-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

/* ============== SERVICES ============== */
.services {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.services-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.service-card-accent {
  border-color: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--bg-card)) 0%, var(--bg-card) 60%);
}

.service-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.service-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.service-list {
  list-style: none;
  margin-bottom: 2rem;
}

.service-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
  position: relative;
  padding-left: 1.5rem;
}

.service-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.service-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: all 0.2s;
}

.service-link:hover {
  color: var(--accent);
}

/* ============== PROJECTS ============== */
.projects-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.project {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.3s;
  position: relative;
}

.project:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px color-mix(in srgb, var(--accent) 30%, transparent);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.project-num {
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

.project-status {
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.status-live {
  background: color-mix(in srgb, #4ade80 15%, transparent);
  color: #4ade80;
  border: 1px solid color-mix(in srgb, #4ade80 30%, transparent);
}

.status-progress {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

[data-theme="light"] .status-progress {
  color: #b8860b;
  background: color-mix(in srgb, #b8860b 10%, transparent);
  border-color: color-mix(in srgb, #b8860b 30%, transparent);
}

.project-title {
  font-family: 'Instrument Serif', serif;
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.project-stack span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

.project-highlight {
  font-size: 0.85rem;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: var(--text);
  line-height: 1.5;
}

/* ============== VERTICALS ============== */
.verticals {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.verticals-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.vertical {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  text-align: left;
  transition: all 0.3s;
}

.vertical:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.vertical-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.vertical h3 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.vertical p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ============== TIMELINE ============== */
.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), var(--border) 50%, transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.timeline-content h4 {
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.timeline-content p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============== CONTACT ============== */
.contact {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.contact-inner {
  max-width: 700px;
  margin: 0 auto;
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-field {
  display: block;
  margin-bottom: 1.25rem;
}

.form-field span {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-direct {
  text-align: center;
  color: var(--text-muted);
}

.contact-direct p {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: all 0.2s;
}

.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============== FOOTER ============== */
.footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner > div:first-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.footer-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============== ANIMATIONS ============== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============== RESPONSIVE ============== */
@media (max-width: 768px) {
  .nav {
    padding: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .hero {
    padding: 6rem 1.25rem 3rem;
  }

  section {
    padding: 4rem 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .service-card,
  .contact-form {
    padding: 1.75rem;
  }

  .theme-toggle {
    bottom: 1rem;
    right: 1rem;
  }

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

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