/* =============================================
   ChinYong.net — Design System
   Dark terminal aesthetic with cyan/aqua accents
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
  /* Core palette */
  --bg-deep: #000a12;
  --bg-surface: #001220;
  --bg-card: #001a2e;
  --bg-card-hover: #002040;

  /* Accent */
  --accent: #00e5ff;
  --accent-dim: #00b8d4;
  --accent-glow: rgba(0, 229, 255, 0.15);
  --accent-glow-strong: rgba(0, 229, 255, 0.35);

  /* Text */
  --text-primary: #e8f9fb;
  --text-secondary: #a8e0d8;
  --text-muted: #7aada5;
  --text-comment: #7e9aa3;

  /* Borders */
  --border: rgba(0, 229, 255, 0.12);
  --border-hover: rgba(0, 229, 255, 0.35);

  /* Fonts */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --section-pad: clamp(4rem, 10vw, 8rem) clamp(1.5rem, 5vw, 4rem);
  --container-max: 960px;

  /* Transition */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Safe-area insets (iOS notch / Android gesture bar) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: rgba(0, 229, 255, 0.2);
}

a, button {
  -webkit-tap-highlight-color: rgba(0, 229, 255, 0.2);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

a:hover {
  color: #fff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Particle Canvas --- */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

/* --- Navigation --- */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.5rem, 5vw, 4rem);
  padding-top: calc(1rem + var(--safe-top));
  padding-left: calc(clamp(1.5rem, 5vw, 4rem) + var(--safe-left));
  padding-right: calc(clamp(1.5rem, 5vw, 4rem) + var(--safe-right));
  background: rgba(0, 10, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

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

#nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  z-index: 110;
}

#nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

#nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
#nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
#nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

#nav-links {
  display: flex;
  gap: 2rem;
}

#nav-links a {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color 0.3s var(--ease), text-shadow 0.3s var(--ease);
  position: relative;
  display: inline-block;
  padding: 6px 0;
}

#nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

#nav-links a:hover {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow-strong);
}

#nav-links a:hover::after {
  width: 100%;
}

#nav-links a.nav-active {
  color: var(--accent);
}

/* --- Hero Section --- */
#hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--section-pad);
  padding-top: calc(clamp(4rem, 10vw, 8rem) + var(--safe-top));
  padding-bottom: calc(clamp(4rem, 10vw, 8rem) + var(--safe-bottom));
  text-align: center;
}

.hero-content {
  max-width: 700px;
  width: 100%;
}

.hero-comment {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  word-break: break-word;
}

.hero-title .brace {
  color: var(--accent);
  font-weight: 300;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Terminal Window (hero decoration) --- */
.terminal-window {
  max-width: 560px;
  margin: 0 auto 2.5rem;
  background: rgba(0, 18, 32, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 255, 0.06);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: left;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: rgba(0, 10, 18, 0.6);
  border-bottom: 1px solid var(--border);
}

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

.terminal-dot.red    { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green  { background: #27c93f; }

.terminal-title {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-comment);
  letter-spacing: 0.03em;
}

.terminal-body {
  padding: 1rem 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-secondary);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.terminal-body .t-prompt { color: var(--accent); user-select: none; }
.terminal-body .t-cmd    { color: var(--text-primary); }
.terminal-body .t-key    { color: #b388ff; }
.terminal-body .t-str    { color: #69f0ae; }
.terminal-body .t-comment{ color: var(--text-comment); font-style: italic; }

/* --- Buttons --- */
.btn {
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  min-height: 44px;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 600;
  box-shadow: 0 0 20px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  background: #fff;
  color: var(--bg-deep);
  box-shadow: 0 0 30px var(--accent-glow-strong), 0 6px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-glow);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* --- Section Tags --- */
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-comment);
  font-weight: 400;
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

#about   .section-tag { color: #69f0ae; }
#services .section-tag { color: #ff8a65; }
#tools    .section-tag { color: #b388ff; }
#contact  .section-tag { color: var(--accent); }

.section-tag-close {
  margin-top: 3rem;
  margin-bottom: 0;
  opacity: 0.4;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: -1.5rem;
  margin-bottom: 2.5rem;
}

/* --- Sections Base --- */
section {
  position: relative;
  z-index: 1;
  padding: var(--section-pad);
}

#about   { background: var(--bg-surface); }
#services { background: var(--bg-deep); }
#tools    { background: var(--bg-surface); }
#contact  { background: var(--bg-deep); }

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.about-text .accent {
  color: var(--accent);
  font-weight: 500;
}

.about-note {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  background: var(--accent-glow);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.about-note .comment {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card {
  padding: 1.2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}

.stat-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.stat-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
}

.stat-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.service-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.service-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 229, 255, 0.08);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.15);
}

.service-icon svg {
  width: 22px;
  height: 22px;
}

.service-card h3 {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.service-card ul {
  padding-left: 0;
}

.service-card li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.service-card li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* --- Tools / Recommended Section --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: rgba(0, 26, 46, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease), color 0.4s var(--ease);
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}

.tool-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 229, 255, 0.1);
  color: var(--text-primary);
}

.tool-card:hover::after {
  transform: scaleX(1);
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tool-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.05);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.1);
  transition: background 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
  flex-shrink: 0;
}

.tool-card:hover .tool-icon {
  background: rgba(0, 229, 255, 0.15);
  transform: rotate(5deg) scale(1.08);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
}

.tool-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-vps { color: #b388ff; background: rgba(179, 136, 255, 0.1); border: 1px solid rgba(179, 136, 255, 0.2); }
.badge-hosting { color: #ff8a65; background: rgba(255, 138, 101, 0.1); border: 1px solid rgba(255, 138, 101, 0.2); }
.badge-forex { color: #69f0ae; background: rgba(105, 240, 174, 0.1); border: 1px solid rgba(105, 240, 174, 0.2); }
.badge-productivity { color: #4fc3f7; background: rgba(79, 195, 247, 0.1); border: 1px solid rgba(79, 195, 247, 0.2); }

.tool-card h3 {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}

.tool-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.tool-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.tool-link svg {
  transition: transform 0.3s ease;
}

.tool-card:hover .tool-link {
  color: #fff;
}

.tool-card:hover .tool-link svg {
  transform: translateX(5px);
}

/* --- Contact Form --- */
.contact-info-extra {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

#contact-form {
  max-width: 560px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px; /* >=16px prevents iOS auto-zoom on focus */
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

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

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.btn-submit {
  width: 100%;
  justify-content: center;
  padding: 1rem;
  font-size: 1rem;
}

.loader {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: var(--bg-deep);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.hidden {
  display: none !important;
}

.form-status {
  margin-top: 1.2rem;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 1rem;
  text-align: center;
}

.form-status.success {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.form-status.error {
  background: rgba(255, 82, 82, 0.1);
  color: #ff5252;
  border: 1px solid #ff5252;
}

/* --- Footer --- */
#footer {
  position: relative;
  z-index: 1;
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  padding-bottom: calc(2rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}

.footer-text {
  text-align: center;
}

.footer-text .comment {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-comment);
}

/* --- Scroll to Top Button --- */
.scroll-top-btn {
  position: fixed;
  bottom: calc(1.5rem + var(--safe-bottom));
  right: calc(1.5rem + var(--safe-right));
  width: 48px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), 0 6px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s var(--ease) forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
  #nav-toggle {
    display: flex;
  }

  #nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 75vw;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-surface);
    flex-direction: column;
    padding: calc(5rem + var(--safe-top)) 2rem calc(2rem + var(--safe-bottom));
    padding-right: calc(2rem + var(--safe-right));
    gap: 1.5rem;
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    z-index: 105;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #nav-links.open {
    transform: translateX(0);
  }

  #nav-links a {
    font-size: 1.05rem;
    padding: 10px 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    justify-content: center;
  }

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

  .tool-header {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  :root {
    --section-pad: 3.5rem 1.2rem;
  }

  .hero-comment {
    font-size: 0.78rem;
  }

  .service-card {
    padding: 1.5rem;
  }

  .tool-card {
    padding: 1.5rem;
  }

  .terminal-body {
    font-size: 0.75rem;
  }
}

/* --- Backdrop overlay for mobile nav --- */
.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

.nav-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* --- Cursor Spotlight Glow --- */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.06) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.6s ease;
  will-change: transform;
}

/* --- Available Badge --- */
.available-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #69f0ae;
  background: rgba(105, 240, 174, 0.07);
  border: 1px solid rgba(105, 240, 174, 0.2);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  margin-bottom: 1.4rem;
  letter-spacing: 0.04em;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #69f0ae;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(105, 240, 174, 0.5);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(105, 240, 174, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(105, 240, 174, 0); }
  100% { box-shadow: 0 0 0 0 rgba(105, 240, 174, 0); }
}

/* --- Gradient Hero Text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Hero Typewriter --- */
.hero-typed {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  min-height: 1.8rem;
  word-break: break-word;
}

.typed-prefix {
  color: var(--accent);
  user-select: none;
}

.typed-cursor {
  display: inline-block;
  color: var(--accent);
  margin-left: 2px;
  animation: blink-cursor 0.75s step-end infinite;
  line-height: 1;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* --- Grain / Noise Texture Overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  will-change: opacity;
  transform: translateZ(0);
}

/* Drop expensive overlays on small viewports and coarse pointers */
@media (max-width: 768px), (pointer: coarse) {
  body::after { display: none; }
  #cursor-glow { display: none !important; }
}

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

  .reveal { opacity: 1; transform: none; }
  .fade-in { opacity: 1; transform: none; animation: none; }
  .scroll-line, .badge-dot, .typed-cursor { animation: none; }
  #particles-canvas, #cursor-glow, body::after { display: none !important; }
}
