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

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --keyword: #ff7b72;
  --string: #a5d6ff;
  --fn: #d2a8ff;
  --type: #79c0ff;
  --prop: #79c0ff;
  --var: #ffa657;
  --comment: #8b949e;
  --accent: #3fb950;
  --accent-dim: rgba(63, 185, 80, 0.12);
  --glow: rgba(63, 185, 80, 0.2);
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Background */
.code-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: drift 18s ease-in-out infinite;
}

.glow-orb--1 {
  width: 400px;
  height: 400px;
  background: rgba(63, 185, 80, 0.15);
  top: -10%;
  right: 10%;
}

.glow-orb--2 {
  width: 300px;
  height: 300px;
  background: rgba(121, 192, 255, 0.1);
  bottom: 10%;
  left: -5%;
  animation-delay: -9s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -15px); }
}

/* Syntax tokens */
.tok-keyword { color: var(--keyword); }
.tok-string { color: var(--string); }
.tok-fn { color: var(--fn); }
.tok-type { color: var(--type); }
.tok-prop { color: var(--prop); }
.tok-var { color: var(--var); }
.tok-comment { color: var(--comment); }
.tok-muted { color: var(--muted); }

/* Layout */
.header,
main,
.footer {
  position: relative;
  z-index: 2;
  width: min(960px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  color: var(--accent);
  font-size: 1rem;
}

.logo-text {
  font-size: 0.95rem;
  font-weight: 500;
}

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

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-path {
  font-size: 0.75rem;
  color: var(--comment);
}

.header-link {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.header-link:hover {
  color: var(--accent);
  border-color: rgba(63, 185, 80, 0.4);
  background: var(--accent-dim);
}

/* Terminal */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

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

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

.terminal-title {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-size: clamp(0.7rem, 2.2vw, 0.82rem);
  line-height: 1.7;
  overflow-x: auto;
}

.terminal-body code {
  font-family: inherit;
}

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

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

/* Hero */
main {
  flex: 1;
  padding-bottom: 3rem;
}

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

.terminal--hero {
  margin-bottom: 1.75rem;
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 0.7s ease forwards;
}

.lead {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-left: 0.25rem;
  opacity: 0;
  animation: fade-up 0.7s ease 0.15s forwards;
}

.line-prefix {
  color: var(--accent);
  margin-right: 0.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  opacity: 0;
  animation: fade-up 0.7s ease 0.25s forwards;
}

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
}

.btn-prefix {
  color: inherit;
  opacity: 0.8;
}

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

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--glow);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--glow); }
  50% { opacity: 0.5; box-shadow: 0 0 8px 2px var(--glow); }
}

/* Services */
.section-label {
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  opacity: 0;
  transform: translateY(16px);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.card[data-animate].is-visible {
  animation: card-in 0.6s ease var(--delay, 0s) forwards;
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  border-color: rgba(63, 185, 80, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.card-file {
  font-size: 0.7rem;
  color: var(--string);
}

.card-status {
  font-size: 0.65rem;
  color: var(--keyword);
}

.card h2 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.card p {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Footer */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem 0 2rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-link {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.footer-link:hover {
  opacity: 0.75;
  text-decoration: underline;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  visibility: hidden;
}

.modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.75);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.is-open .modal-overlay {
  opacity: 1;
}

.modal-panel {
  position: relative;
  width: min(440px, 100%);
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.is-open .modal-panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.terminal--modal .terminal-bar {
  position: relative;
}

.modal-close {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.modal-close:hover {
  color: var(--text);
}

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

.modal-title {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.modal-desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-size: 0.7rem;
}

.field input,
.field textarea {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--comment);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(63, 185, 80, 0.5);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.form-error {
  font-size: 0.75rem;
  color: var(--keyword);
}

.form-success {
  font-size: 0.75rem;
  color: var(--accent);
}

.btn-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
}

@media (max-width: 600px) {
  .header-path {
    display: none;
  }

  .terminal-body {
    padding: 1rem;
    font-size: 0.68rem;
  }
}

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