/* ============================================================
   CODEGAATORS — style.css
   Fonts: Space Grotesk (display) · Sora (body) · JetBrains Mono (code)
============================================================ */

/* === THEME VARIABLES === */
:root {
  --bg:         #0C0E12;
  --bg-alt:     #131620;
  --text:       #E4E4F0;
  --muted:      #838796;
  --accent:     #00D97E;
  --accent-dim: rgba(0, 217, 126, 0.1);
  --warn:       #FF5035;
  --border:     rgba(255, 255, 255, 0.07);
  --card:       #131620;
  --card-hover: #1A1E2C;
  --nav-bg:     rgba(12, 14, 18, 0.78);
  --shadow:     0 10px 40px rgba(0,0,0,0.55);
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --r:          5px;
}

[data-theme="light"] {
  --bg:         #F4F3EF;
  --bg-alt:     #ECEAE5;
  --text:       #18192B;
  --muted:      #696D82;
  --accent:     #00985A;
  --accent-dim: rgba(0, 152, 90, 0.1);
  --warn:       #D93A20;
  --border:     rgba(0, 0, 0, 0.07);
  --card:       #FFFFFF;
  --card-hover: #F0EEE9;
  --nav-bg:     rgba(244, 243, 239, 0.80);
  --shadow:     0 10px 40px rgba(0,0,0,0.09);
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; }

body {
  font-family: 'Sora', sans-serif;
  font-weight: 300;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

a { color: inherit; }
img { display: block; max-width: 100%; }
input, select, textarea, button { font-family: inherit; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
}

/* === LAYOUT === */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.section-heading {
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
  margin-bottom: 3rem;
}

/* === NAVIGATION === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease), box-shadow 0.3s;
}

.nav.scrolled {
  box-shadow: 0 1px 28px rgba(0,0,0,0.2);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-bracket { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.2rem;
}

.nav-links a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta-link { color: var(--accent) !important; }
.nav-cta-link::after { background: var(--accent); }

/* Theme Toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toggle-icon {
  position: absolute;
  transition: opacity 0.3s, transform 0.35s var(--ease);
  line-height: 1;
}

[data-theme="dark"]  .t-sun  { opacity: 1; transform: scale(1) rotate(0deg); }
[data-theme="dark"]  .t-moon { opacity: 0; transform: scale(0) rotate(-90deg); }
[data-theme="light"] .t-sun  { opacity: 0; transform: scale(0) rotate(90deg); }
[data-theme="light"] .t-moon { opacity: 1; transform: scale(1) rotate(0deg); }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--r);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0C0E12;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover {
  background: transparent;
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-full { width: 100%; justify-content: center; }

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 64px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 1;
}

[data-theme="light"] .hero-bg {
  background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px);
}

.hero-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -55%);
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 80px 28px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.8rem;
}

.eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 var(--accent-dim); }
  50%       { opacity: 0.6; transform: scale(0.85); box-shadow: 0 0 0 6px transparent; }
}

.hero-heading {
  font-size: clamp(2.6rem, 5.5vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.0;
  margin-bottom: 1.4rem;
}

.hero-accent { color: var(--accent); }

.hero-sub {
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.75;
  max-width: 400px;
  margin-bottom: 2.4rem;
}

.hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Terminal */
.hero-terminal {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: var(--shadow);
}

.term-bar {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

[data-theme="light"] .term-bar { background: rgba(0,0,0,0.04); }

.term-dot { width: 11px; height: 11px; border-radius: 50%; }
.term-dot.red    { background: #FF5F57; }
.term-dot.yellow { background: #FEBC2E; }
.term-dot.green  { background: #28C840; }

.term-title {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 0.04em;
}

.term-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 140px;
}

.term-line {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.t-prompt { color: var(--accent); user-select: none; }
.t-cmd    { color: var(--text); }

.t-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  line-height: 1;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.term-output {
  color: var(--muted);
  font-size: 0.76rem;
  padding-left: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.4s;
}

.term-output.show { opacity: 1; }
.term-ok   { color: #28C840; }
.term-info { color: #FEBC2E; }

/* === SERVICES === */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--border);
  border: 1px solid var(--border);
  gap: 1px;
}

.service-card {
  background: var(--bg);
  padding: 2.4rem 2rem;
  transition: background 0.22s;
}

[data-theme="light"] .service-card { background: var(--card); }

.service-card:hover { background: var(--bg-alt); }

.service-icon {
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  color: var(--accent);
  display: block;
  line-height: 1;
}

.service-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 0.55rem;
}

.service-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 300;
}

/* === WORK PREVIEW === */
.work-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.8rem;
}

.work-header .section-heading { margin-bottom: 0; }

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.work-card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}

.work-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(0,217,126,0.25);
}

.work-card-img {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  font-size: 2.4rem;
  transition: font-size 0.25s;
}

.work-card:hover .work-card-img { font-size: 2.8rem; }

.work-card-info { padding: 1.3rem 1.4rem; }

.work-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.work-card-info h3 {
  font-size: 1.05rem;
  letter-spacing: -0.025em;
  margin-bottom: 0.4rem;
}

.work-card-info p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
}

/* === WHY US === */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.5rem;
}

.why-item {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.why-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.why-item h3 {
  font-size: 1.02rem;
  letter-spacing: -0.025em;
  margin-bottom: 0.55rem;
}

.why-item p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
}

/* === CONTACT === */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 5rem;
  align-items: start;
}

.contact-sub {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 2rem;
  font-weight: 300;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.contact-details span { display: flex; align-items: center; gap: 8px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 13px;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 0.88rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  appearance: none;
  -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--muted); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group select { cursor: pointer; }
.form-group select option { background: var(--card); color: var(--text); }

/* === FOOTER === */
.footer {
  padding: 48px 0 28px;
  border-top: 1px solid var(--border);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.footer-brand .nav-logo {
  display: inline-block;
  text-decoration: none;
  margin-bottom: 0.4rem;
}

.footer-brand p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.8rem;
}

.footer-links a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

/* === SCROLL REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(1) { transition-delay: 0.05s; }
.reveal:nth-child(2) { transition-delay: 0.15s; }
.reveal:nth-child(3) { transition-delay: 0.25s; }

/* === PROJECTS PAGE: PAGE HERO === */
.page-hero {
  padding: 148px 0 64px;
  border-bottom: 1px solid var(--border);
}

.page-hero-heading {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  letter-spacing: -0.04em;
  margin: 0.8rem 0 1rem;
}

.page-hero > .container > p {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 300;
}

/* === FILTER BAR === */
.filter-section {
  position: sticky;
  top: 64px;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 2rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  letter-spacing: -0.01em;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0C0E12;
  font-weight: 600;
}

/* === PROJECTS GRID === */
.projects-section { padding: 56px 0 100px; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.4rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--card-accent, var(--border));
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  cursor: default;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.project-card-top {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.project-card-top .p-emoji {
  font-size: 3.2rem;
  transition: transform 0.3s var(--ease);
  position: relative;
  z-index: 2;
}

.project-card:hover .p-emoji { transform: scale(1.12) rotate(-4deg); }

.project-card-body { padding: 1.3rem 1.4rem; }

.p-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--card-accent, var(--accent));
  margin-bottom: 0.5rem;
}

.project-card-body h3 {
  font-size: 1.1rem;
  letter-spacing: -0.025em;
  margin-bottom: 0.45rem;
}

.project-card-body p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.62;
  font-weight: 300;
  margin-bottom: 1rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 1.1rem;
}

.tech-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  background: var(--bg-alt);
  letter-spacing: 0.02em;
}

.p-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--card-accent, var(--accent));
  transition: gap 0.2s;
}

.p-link:hover { gap: 9px; }

.p-link-arrow { transition: transform 0.2s; }
.p-link:hover .p-link-arrow { transform: translateX(3px); }

/* Fade-out for filtered cards */
.project-card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
}

/* === HAMBURGER (mobile nav) === */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--muted);
  transition: all 0.25s;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }
  .hero-sub { max-width: none; }
  .hero-terminal { max-width: 480px; }
  .services-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr; gap: 2rem; }
  .contact-wrap { grid-template-columns: 1fr; gap: 2.5rem; }
  .work-header { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .section { padding: 60px 0; }
  .hero-inner { padding: 60px 20px; }
  .hero-heading { font-size: clamp(2.1rem, 9vw, 3rem); }
  .form-row { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .projects-grid { grid-template-columns: 1fr; }
  .page-hero { padding: 120px 0 48px; }
  .container { padding: 0 20px; }
}

/* Mobile menu */
.nav-mobile {
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 199;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s var(--ease);
}

.nav-mobile.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.nav-mobile a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover { color: var(--accent); }

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
