﻿:root {
  --bg: #f5f1e8;
  --paper: #fffdfa;
  --ink: #161514;
  --accent: #d54f2a;
  --accent-2: #1f7a73;
  --muted: #5f5b54;
  --line: #ddd5c8;
  --header-bg: rgba(245, 241, 232, 0.75);
  --header-border: rgba(95, 91, 84, 0.15);
  --shadow: rgba(0, 0, 0, 0.08);
  --bg-grad-a: #fff5dc;
  --bg-grad-b: #d8f1ee;
  --glass-bg: rgba(255, 255, 255, 0.52);
  --glass-line: rgba(255, 255, 255, 0.45);
}

:root[data-theme="dark"] {
  --bg: #121311;
  --paper: #1a1d19;
  --ink: #f2efe8;
  --accent: #ff7a4d;
  --accent-2: #5ed4c8;
  --muted: #bdb7ac;
  --line: #343933;
  --header-bg: rgba(18, 19, 17, 0.78);
  --header-border: rgba(242, 239, 232, 0.1);
  --shadow: rgba(0, 0, 0, 0.45);
  --bg-grad-a: #3a2216;
  --bg-grad-b: #15322f;
  --glass-bg: rgba(40, 46, 40, 0.5);
  --glass-line: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 20%, var(--bg-grad-a) 0%, transparent 35%),
    radial-gradient(circle at 90% 80%, var(--bg-grad-b) 0%, transparent 35%),
    var(--bg);
  min-height: 100%;
  /* scroll-behavior: smooth; Removed for Lenis */
  line-height: 1.6;
  overflow-x: hidden;
  scroll-padding-top: 100px;
}

#matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  opacity: 0.15;
  /* Subtle enough to not distract */
  pointer-events: none;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.5;
  animation: float 20s infinite ease-in-out;
}

.bg-shape-a {
  width: 280px;
  height: 280px;
  background: var(--accent);
  top: -70px;
  right: 10%;
  animation: drift-a 16s ease-in-out infinite alternate;
}

.bg-shape-b {
  width: 320px;
  height: 320px;
  background: var(--accent-2);
  left: -80px;
  bottom: 10%;
  animation: drift-b 18s ease-in-out infinite alternate;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  z-index: 100;
  /* Increased z-index for safety */
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-family: "Fraunces", serif;
  font-size: 1.45rem;
  font-weight: 900;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 0.25rem 0.6rem;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1rem;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--glass-bg);
  color: var(--ink);
  border-radius: 50%;
  padding: 0.5rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  transition: background 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background: var(--glass-line);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke-width: 2px;
}

main {
  padding: 120px 0 4rem;
}

.hero {
  padding: 2rem 0 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

h1,
h2,
h3 {
  font-family: "Fraunces", serif;
  line-height: 1.08;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.3rem);
  max-width: 12ch;
  margin-bottom: 1rem;
}

.hero-copy {
  max-width: 64ch;
  color: var(--muted);
}

.cta-row {
  display: flex;
  gap: 0.8rem;
  margin: 1.2rem 0 1.8rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  transition: transform 180ms ease;
}

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

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

.btn-ghost {
  border: 2px solid var(--ink);
  color: var(--ink);
}

.mini-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  padding: 0;
  margin: 0;
}

.mini-stats li {
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem;
  font-size: 0.95rem;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

.mini-stats span {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.3rem;
  backdrop-filter: blur(14px) saturate(135%);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
}

#about,
#skills,
#contact {
  margin: 2rem auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

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

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

.skill-card {
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  position: relative;
  overflow: hidden;
}

.skill-card h3 {
  margin-bottom: 0.5rem;
}

.skill-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.skill-card li {
  margin: 0.38rem 0;
}

.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px var(--shadow);
}

.card,
.skill-card,
.project-card,
.mini-stats li,
.theme-toggle {
  position: relative;
  overflow: hidden;
}

.card::before,
.skill-card::before,
.project-card::before,
.mini-stats li::before,
.theme-toggle::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
      transparent 15%,
      var(--glass-line) 45%,
      transparent 75%);
  transform: translateX(-130%);
  animation: glass-sheen 6.4s ease-in-out infinite;
  pointer-events: none;
}

.card::after,
.skill-card::after,
.project-card::after,
.mini-stats li::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border-top: 1px solid rgba(255, 255, 255, 0.33);
  pointer-events: none;
}

@keyframes glass-sheen {
  0% {
    transform: translateX(-130%);
  }

  55%,
  100% {
    transform: translateX(150%);
  }
}

@keyframes drift-a {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    transform: translate3d(36px, 28px, 0) scale(1.1);
  }
}

@keyframes drift-b {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    transform: translate3d(-34px, -22px, 0) scale(1.08);
  }
}

.project-card .stack {
  color: var(--accent-2);
  font-weight: 500;
}

.project-card a {
  color: var(--accent);
  font-weight: 700;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-links a {
  color: var(--ink);
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--header-border);
  padding: 1rem 0 2rem;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 700ms ease, transform 700ms ease;
}

@media (max-width: 640px) {
  .nav-links {
    gap: 0.6rem;
    font-size: 0.95rem;
  }

  .brand {
    font-size: 1.2rem;
  }

  .theme-toggle {
    padding: 0.4rem 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .bg-shape-a,
  .bg-shape-b,
  .card::before,
  .skill-card::before,
  .project-card::before,
  .mini-stats li::before,
  .theme-toggle::before {
    animation: none;
  }
}

.terminal-window {
  background: rgba(8, 13, 10, 0.72);
  border: 1px solid rgba(120, 166, 145, 0.35);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 28px var(--shadow);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}

.terminal-topbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.55rem 0.9rem;
}

.terminal-topbar p {
  margin: 0 0 0 0.55rem;
  color: #ccebdc;
  font-size: 0.84rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: #ff5f56;
}

.dot-yellow {
  background: #ffbd2e;
}

.dot-green {
  background: #27c93f;
}

.terminal-output {
  max-height: 320px;
  overflow-y: auto;
  padding: 1rem;
  color: #d8f6e9;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.92rem;
}

.terminal-output p {
  margin: 0 0 0.6rem;
}

.prompt {
  color: #73f2be;
  font-family: "Courier New", Courier, monospace;
  white-space: nowrap;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.22);
}

#terminalInput {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #f3fff9;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95rem;
}

#terminalInput::placeholder {
  color: rgba(217, 255, 237, 0.65);
}

#terminal {
  margin: 2rem auto;
}

.terminal-window {
  animation: terminal-glow 5s ease-in-out infinite alternate;
}

@keyframes terminal-glow {
  0% {
    box-shadow: 0 14px 28px var(--shadow), 0 0 0 rgba(94, 212, 200, 0.08);
  }

  100% {
    box-shadow: 0 14px 28px var(--shadow), 0 0 22px rgba(94, 212, 200, 0.22);
  }
}

/* Responsive Design */

/* Tablet & Small Desktop (max-width: 1024px) */
@media (max-width: 1024px) {
  .container {
    width: 90vw;
  }

  h1 {
    font-size: 3.5rem;
  }
}

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {
  main {
    padding-top: 90px;
  }

  .nav-row {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links {
    gap: 1.2rem;
    font-size: 0.9rem;
  }

  h1 {
    font-size: 2.8rem;
  }

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

  .terminal-window {
    width: 100%;
  }

  .bg-shape {
    opacity: 0.3;
  }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .site-header {
    padding: 0.5rem 0;
  }

  main {
    padding-top: 110px;
    /* Offset for stacked header */
  }

  .nav-row {
    flex-direction: column;
    gap: 0.8rem;
  }

  .nav-links {
    font-size: 0.85rem;
    gap: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand {
    font-size: 1.2rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  .cta-row {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .mini-stats {
    grid-template-columns: 1fr;
  }

  .terminal-output {
    max-height: 220px;
    font-size: 0.8rem;
  }

  .terminal-input-row {
    padding: 0.5rem;
  }

  #terminalInput {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .bg-shape,
  .card::before,
  .skill-card::before,
  .project-card::before,
  .btn,
  .theme-toggle::before {
    animation: none;
    transition: none;
  }
}

/* =========================================
   Contact Section Overhaul
   ========================================= */

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-left {
  padding-right: 2rem;
}

.contact-left h2 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #9f5afd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.contact-desc {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 48ch;
  margin-bottom: 3rem;
  line-height: 1.7;
}

/* Contact Methods */
.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.method-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.method-icon {
  width: 48px;
  height: 48px;
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.method-details {
  display: flex;
  flex-direction: column;
}

.method-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.method-link {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Social Grid */
.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 400px;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  background: var(--glass-bg);
  transition: all 0.2s ease;
}

.social-btn:hover {
  background: var(--glass-line);
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* Contact Form Card */
.contact-card {
  background: rgba(10, 10, 12, 0.6);
  /* Darker background for contrast, or use glass variable */
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px -10px var(--shadow);
}

:root[data-theme="dark"] .contact-card {
  background: rgba(18, 20, 24, 0.75);
}

.contact-card h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.form-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.input-group label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--muted);
}

.cyber-input {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: all 0.2s ease;
}

:root[data-theme="dark"] .cyber-input {
  background: rgba(0, 0, 0, 0.25);
}

.cyber-input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .cyber-input:focus {
  background: rgba(0, 0, 0, 0.4);
}

.cyber-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

textarea.cyber-input {
  resize: vertical;
  min-height: 120px;
}

.btn-transmit {
  margin-top: 1rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-transmit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px var(--shadow);
}

/* Footer Overhaul */
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 3rem;
  padding-top: 2rem;
}

.footer-brand h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.footer-brand p {
  max-width: 30ch;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.2s;
}

.footer-socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--glass-bg);
}

.footer-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

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

/* Mobile Responsiveness */
@media (max-width: 900px) {
  .contact-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .contact-left {
    padding-right: 0;
  }

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

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

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

}

/* =========================================
   Hero Redesign (Elite Tier)
   ========================================= */

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(39, 201, 63, 0.1);
  border: 1px solid rgba(39, 201, 63, 0.2);
  border-radius: 999px;
  color: #27c93f;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #27c93f;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(39, 201, 63, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(39, 201, 63, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(39, 201, 63, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(39, 201, 63, 0);
  }
}

.hero-name {
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-role {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-copy {
  font-size: 1.15rem;
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .hero-name {
    font-size: 2.5rem;
  }

  .hero-role {
    font-size: 1.1rem;
  }

  .hero-badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
  }
}