:root {
  --bg-color: #0b0c10;
  --card-bg: #15161a;
  --card-border: #23252a;
  --accent-color: #00e6d0;
  --text-primary: #ffffff;
  --text-secondary: #a0aab5;
  --text-muted: #6b7280;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "Fira Code", monospace;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 600;
}

/* Layout */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.8;
}

main {
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero {
  height: 100vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 2rem;
  background: radial-gradient(
    circle at center,
    #1a1e24 0%,
    var(--bg-color) 70%
  );
}

.hero-content {
  text-align: center;
  z-index: 2;
}

.brand-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-family: var(--font-mono);
  letter-spacing: -2px;
  margin-bottom: 1rem;
  color: #ffffff;
  position: relative;
  text-shadow: 0 0 20px rgba(0, 230, 208, 0.4);
  animation: glitch 3s infinite;
}

.brand-title::before,
.brand-title::after {
  content: "ATHERIS.DEV";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.brand-title::before {
  left: 2px;
  text-shadow: -2px 0 red;
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.brand-title::after {
  left: -2px;
  text-shadow: -2px 0 var(--accent-color);
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% {
    clip: rect(15px, 9999px, 83px, 0);
  }
  5% {
    clip: rect(61px, 9999px, 3px, 0);
  }
  10% {
    clip: rect(40px, 9999px, 49px, 0);
  }
  15% {
    clip: rect(81px, 9999px, 86px, 0);
  }
  20% {
    clip: rect(65px, 9999px, 35px, 0);
  }
  25% {
    clip: rect(10px, 9999px, 20px, 0);
  }
  30% {
    clip: rect(51px, 9999px, 90px, 0);
  }
  35% {
    clip: rect(32px, 9999px, 60px, 0);
  }
  40% {
    clip: rect(72px, 9999px, 14px, 0);
  }
  45% {
    clip: rect(2px, 9999px, 50px, 0);
  }
  50% {
    clip: rect(98px, 9999px, 78px, 0);
  }
  55% {
    clip: rect(44px, 9999px, 33px, 0);
  }
  60% {
    clip: rect(87px, 9999px, 11px, 0);
  }
  65% {
    clip: rect(25px, 9999px, 69px, 0);
  }
  70% {
    clip: rect(59px, 9999px, 95px, 0);
  }
  75% {
    clip: rect(19px, 9999px, 42px, 0);
  }
  80% {
    clip: rect(76px, 9999px, 88px, 0);
  }
  85% {
    clip: rect(38px, 9999px, 22px, 0);
  }
  90% {
    clip: rect(91px, 9999px, 57px, 0);
  }
  95% {
    clip: rect(5px, 9999px, 73px, 0);
  }
  100% {
    clip: rect(48px, 9999px, 99px, 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip: rect(65px, 9999px, 100px, 0);
  }
  5% {
    clip: rect(52px, 9999px, 74px, 0);
  }
  10% {
    clip: rect(79px, 9999px, 85px, 0);
  }
  15% {
    clip: rect(75px, 9999px, 5px, 0);
  }
  20% {
    clip: rect(67px, 9999px, 61px, 0);
  }
  25% {
    clip: rect(14px, 9999px, 79px, 0);
  }
  30% {
    clip: rect(1px, 9999px, 66px, 0);
  }
  35% {
    clip: rect(86px, 9999px, 30px, 0);
  }
  40% {
    clip: rect(23px, 9999px, 98px, 0);
  }
  45% {
    clip: rect(85px, 9999px, 72px, 0);
  }
  50% {
    clip: rect(71px, 9999px, 75px, 0);
  }
  55% {
    clip: rect(2px, 9999px, 48px, 0);
  }
  60% {
    clip: rect(30px, 9999px, 16px, 0);
  }
  65% {
    clip: rect(59px, 9999px, 50px, 0);
  }
  70% {
    clip: rect(41px, 9999px, 62px, 0);
  }
  75% {
    clip: rect(2px, 9999px, 82px, 0);
  }
  80% {
    clip: rect(47px, 9999px, 73px, 0);
  }
  85% {
    clip: rect(3px, 9999px, 27px, 0);
  }
  90% {
    clip: rect(26px, 9999px, 55px, 0);
  }
  95% {
    clip: rect(42px, 9999px, 97px, 0);
  }
  100% {
    clip: rect(38px, 9999px, 49px, 0);
  }
}

.typing-container {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--accent-color);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
}

.cursor {
  display: inline-block;
  width: 2px;
  background-color: var(--accent-color);
  margin-left: 2px;
  animation: blink 1s step-start infinite;
}

.cursor.typing {
  animation: none;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.scroll-down {
  position: absolute;
  bottom: 2rem;
  color: var(--text-secondary);
  animation: bounce 2s infinite;
  transition: var(--transition);
}

.scroll-down:hover {
  color: var(--accent-color);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Services Section */
.services {
  padding: 8rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-size: 2.5rem;
  margin: 0 auto 5rem auto;
  text-align: center;
  color: var(--text-primary);
  font-family: var(--font-mono);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 6px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.section-title::before {
  content: "<";
  color: var(--accent-color);
  margin-right: 1rem;
  font-weight: 300;
  text-shadow: 0 0 12px var(--accent-color);
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: auto;
  height: auto;
  background-color: transparent;
  box-shadow: none;
}

.section-title::after {
  content: "/>";
  color: var(--accent-color);
  margin-left: 1rem;
  font-weight: 300;
  text-shadow: 0 0 12px var(--accent-color);
  position: relative;
  top: auto;
  right: auto;
  transform: none;
  width: auto;
  height: auto;
  background-color: transparent;
  box-shadow: none;
}

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

.service-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 3rem 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    800px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(0, 230, 208, 0.06),
    transparent 40%
  );
  z-index: 1;
  pointer-events: none;
}

.service-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-color),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.service-card > * {
  position: relative;
  z-index: 2;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 230, 208, 0.4);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(0, 230, 208, 0.1);
}

.service-card:hover::after {
  transform: translateX(100%);
}

.card-icon {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #ffffff;
  font-family: var(--font-mono);
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  flex-grow: 1;
}

/* Footer Section */
.footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--card-border);
  padding: 6rem 2rem 2rem 2rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand h2 {
  font-size: 1.8rem;
  color: #ffffff;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 400px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links h3,
.footer-action h3 {
  font-size: 1.2rem;
  color: #ffffff;
  font-family: var(--font-mono);
  margin-bottom: 1rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
  width: fit-content;
}

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

.footer-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.contact-btn {
  display: inline-block;
  padding: 1rem 1.5rem;
  background-color: rgba(0, 230, 208, 0.05);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.1rem;
  text-decoration: none;
  border: 1px solid rgba(0, 230, 208, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.contact-btn:hover {
  background-color: rgba(0, 230, 208, 0.15);
  border-color: var(--accent-color);
  box-shadow:
    0 0 20px rgba(0, 230, 208, 0.2),
    inset 0 0 10px rgba(0, 230, 208, 0.1);
  color: #ffffff;
}

.cmd-prompt {
  color: var(--text-muted);
  margin-right: 8px;
}

.cmd-cursor {
  color: var(--accent-color);
  animation: blink 1s step-start infinite;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

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

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

/* Contact Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 1.5rem;
}

.modal-overlay.active {
  visibility: visible;
  opacity: 1;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
}

.modal-container {
  width: 100%;
  max-width: 540px;
  background: linear-gradient(165deg, #12131a 0%, #0d0e14 100%);
  border: 1px solid var(--card-border);
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 230, 208, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
}

.modal-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
  opacity: 0.6;
}

.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Terminal Bar */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--card-border);
}

.modal-terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.75rem;
  letter-spacing: 0.5px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
  line-height: 0;
}

.modal-close:hover {
  color: #ff5f57;
}

/* Modal Body */
.modal-body {
  padding: 1.75rem 1.75rem 2rem;
}

/* System Log */
.modal-log {
  margin-bottom: 1.75rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 230, 208, 0.02);
  border-left: 2px solid rgba(0, 230, 208, 0.3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.8;
}

.modal-log p {
  color: var(--text-secondary);
  margin: 0;
}

.log-ts {
  color: var(--text-muted);
}

.log-ok {
  color: #28c840;
  font-weight: 600;
}

.log-info {
  color: var(--accent-color);
  font-weight: 600;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.label-prompt {
  color: var(--accent-color);
  margin-right: 6px;
  font-weight: 700;
}

.label-type {
  color: var(--text-muted);
  font-weight: 300;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  outline: none;
  letter-spacing: 0.3px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.input-line {
  height: 2px;
  background: var(--card-border);
  position: relative;
  overflow: hidden;
}

.input-line::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 100%;
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateX(-50%);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(0, 230, 208, 0.4);
  background: rgba(0, 230, 208, 0.03);
  box-shadow: 0 0 0 3px rgba(0, 230, 208, 0.06);
}

.form-group input:focus ~ .input-line::after,
.form-group textarea:focus ~ .input-line::after {
  width: 100%;
}

/* Validation */
.form-group input:invalid:not(:placeholder-shown) {
  border-color: rgba(255, 95, 87, 0.4);
}

.form-group input:invalid:not(:placeholder-shown) ~ .input-line::after {
  background: #ff5f57;
  box-shadow: 0 0 8px #ff5f57;
  width: 100%;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  margin-top: 0.5rem;
  background: rgba(0, 230, 208, 0.06);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1rem;
  border: 1px solid rgba(0, 230, 208, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 230, 208, 0.08),
    transparent
  );
  transition: left 0.6s ease;
}

.submit-btn:hover {
  background: rgba(0, 230, 208, 0.12);
  border-color: var(--accent-color);
  box-shadow:
    0 0 25px rgba(0, 230, 208, 0.15),
    inset 0 0 15px rgba(0, 230, 208, 0.05);
  color: #ffffff;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 230, 208, 0.3);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Form Status */
.form-status {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  min-height: 1.5rem;
}

.form-status.success {
  color: #28c840;
}

.form-status.error {
  color: #ff5f57;
}

.form-status .status-prefix {
  font-weight: 700;
}

/* Button as styled (remove default button look) */
button.contact-btn {
  cursor: pointer;
  font: inherit;
}

/* Responsive */
@media (max-width: 768px) {
  .services {
    padding: 5rem 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 3rem;
  }

  .section-title::before,
  .section-title::after {
    margin: 0 0.5rem;
  }

  .footer {
    padding: 4rem 1.5rem 2rem 1.5rem;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 2.5rem;
  }

  .footer-action {
    align-items: flex-start;
    text-align: left;
  }

  .contact-btn {
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .modal-overlay {
    padding: 1rem;
    align-items: flex-end;
  }

  .modal-body {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .modal-log {
    font-size: 0.65rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 0.85rem;
    padding: 0.75rem 0.85rem;
  }

  .submit-btn {
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
  }
}

/* Scroll Animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1),
    transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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