/* ============================================
   Codebase Solutions — Terminal Green
   Horizontal single-page, no vertical scroll
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-raised: #1a1a2e;
  --text: #e2e2e2;
  --text-muted: #666666;
  --text-dim: #333333;
  --accent: #00d4aa;
  --rail-width: 50px;
  --panel-width: calc(100vw - var(--rail-width));
  --transition-speed: 0.6s;
  --transition-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
}

/* --- Reset --- */

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

button {
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
}

/* --- Side Rail --- */

.rail {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--rail-width);
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-right: 1px solid var(--bg-raised);
  background: var(--bg);
}

.rail-logo {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  white-space: nowrap;
}

.rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rail-logo-icon {
  width: 24px;
  height: 24px;
}

.rail-dots {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.rail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  background: transparent;
  transition: all 0.3s ease;
  padding: 0;
}

.rail-dot:hover {
  border-color: var(--accent);
}

.rail-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0, 212, 170, 0.3);
}

.rail-counter {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* --- Panel Track --- */

.track {
  display: flex;
  margin-left: var(--rail-width);
  height: 100vh;
  will-change: transform;
  transition: transform var(--transition-speed) var(--transition-ease);
}

/* --- Panels --- */

.panel {
  width: var(--panel-width);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 60px 6vw;
  position: relative;
  gap: 4vw;
}

.panel-label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 3px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
}

.panel-heading {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  font-family: var(--font-sans);
  line-height: 1.15;
  margin-bottom: 24px;
}

/* --- Panel: Hero --- */

.panel-hero {
  justify-content: space-between;
}

.hero-content {
  max-width: 560px;
  flex-shrink: 0;
}

.hero-headline {
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 700;
  font-family: var(--font-sans);
  line-height: 1.1;
  margin-bottom: 24px;
}

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

.hero-sub {
  font-size: clamp(13px, 1.2vw, 16px);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-cta {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px 32px;
  font-size: 12px;
  letter-spacing: 2px;
  font-family: var(--font-mono);
  transition: background 0.25s ease, color 0.25s ease;
}

.hero-cta:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Hero decoration — terminal window */

.hero-decoration {
  flex: 1;
  max-width: 480px;
  min-width: 320px;
}

.terminal {
  border: 1px solid var(--bg-raised);
  border-radius: 8px;
  overflow: hidden;
  background: #0d0d0d;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #141414;
  border-bottom: 1px solid var(--bg-raised);
}

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

.terminal-title {
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.terminal-body {
  padding: 20px;
  font-size: 13px;
  line-height: 1.8;
}

.terminal-body code {
  display: block;
  white-space: pre;
  font-family: var(--font-mono);
}

.code-keyword { color: var(--accent); }
.code-var { color: var(--text); }
.code-key { color: #7aa2f7; }
.code-string { color: #9ece6a; }
.code-fn { color: #bb9af7; }
.code-comment { color: var(--text-dim); }
.code-dim { color: var(--text-dim); }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  right: 40px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  animation: pulse-hint 2.5s ease-in-out infinite;
}

@keyframes pulse-hint {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Blinking cursor after headline */
.cursor {
  display: inline-block;
  width: 3px;
  height: 0.9em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: baseline;
  animation: blink 1s step-end infinite;
}

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

/* --- Panel: Services --- */

.services-content {
  width: 100%;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 6vw;
  width: 100%;
}

.service-card {
  border-left: 2px solid var(--accent);
  padding: 20px 24px;
  position: relative;
}

.service-icon {
  display: block;
  font-size: 28px;
  font-weight: 400;
  font-family: var(--font-mono);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 14px;
  opacity: 0.7;
}

.service-name {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-sans);
  margin-bottom: 10px;
}

.service-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 360px;
}

/* --- Panel: About --- */

.panel-about {
  justify-content: space-between;
}

.about-content {
  max-width: 500px;
  flex-shrink: 0;
}

.about-text {
  font-size: clamp(14px, 1.2vw, 16px);
  color: #999999;
  line-height: 1.85;
  margin-bottom: 20px;
}

.about-decoration {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-code {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 2;
  white-space: nowrap;
}

.about-code .code-brace {
  font-size: 1.3em;
  color: var(--text-muted);
}

.about-code .code-key {
  color: #7aa2f7;
}

.about-code .code-string {
  color: #9ece6a;
}

/* --- Panel: Contact --- */

.panel-contact {
  justify-content: space-between;
}

.contact-content {
  max-width: 480px;
  flex-shrink: 0;
}

.contact-block {
  margin-bottom: 32px;
}

.contact-label {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.contact-value {
  font-size: 18px;
  color: var(--text);
}

.contact-value a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-value a:hover {
  color: var(--accent);
}

.contact-footer {
  margin-top: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--bg-raised);
}

.contact-footer-line {
  font-size: 11px;
  color: var(--text-muted);
}

.contact-decoration {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 420px;
}

.contact-terminal {
  font-family: var(--font-mono);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.8;
}

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

.contact-cmd {
  color: var(--text);
}

.contact-cursor-block {
  display: inline-block;
  width: 12px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 4px;
  animation: blink 1s step-end infinite;
}

.contact-output {
  font-size: 0.75em;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Progress Bar --- */

.progress {
  position: fixed;
  bottom: 0;
  left: var(--rail-width);
  right: 0;
  display: flex;
  height: 3px;
  z-index: 100;
}

.progress-segment {
  flex: 1;
  background: var(--bg-raised);
  transition: background 0.4s ease;
}

.progress-segment.active {
  background: var(--accent);
}

/* --- Panel enter animations --- */

.panel-label,
.hero-headline,
.hero-sub,
.hero-cta,
.hero-decoration,
.panel-heading,
.service-card,
.about-text,
.about-decoration,
.contact-block,
.contact-footer,
.contact-decoration {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.panel.visible .panel-label { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }
.panel.visible .hero-headline { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.panel.visible .panel-heading { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.panel.visible .hero-sub { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.panel.visible .hero-cta { opacity: 1; transform: translateY(0); transition-delay: 0.4s; }
.panel.visible .hero-decoration { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }


.panel.visible .service-card:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.panel.visible .service-card:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.panel.visible .service-card:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.35s; }
.panel.visible .service-card:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.45s; }

.panel.visible .about-text:nth-of-type(1) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.panel.visible .about-text:nth-of-type(2) { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.panel.visible .about-decoration { opacity: 1; transform: translateY(0); transition-delay: 0.35s; }

.panel.visible .contact-block:nth-of-type(1) { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.panel.visible .contact-block:nth-of-type(2) { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.panel.visible .contact-footer { opacity: 1; transform: translateY(0); transition-delay: 0.4s; }
.panel.visible .contact-decoration { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }

/* --- Scroll hint hide on non-first panel --- */

.scroll-hint {
  transition: opacity 0.3s ease;
}

/* --- Responsive: Mobile --- */

@media (max-width: 768px) {
  :root {
    --rail-width: 0px;
  }

  html, body {
    overflow: auto;
    height: auto;
  }

  /* Top nav bar */
  .rail {
    position: fixed;
    width: 100vw;
    height: 44px;
    flex-direction: row;
    padding: 0 16px;
    border-right: none;
    border-bottom: 1px solid var(--bg-raised);
    z-index: 100;
  }

  .rail-logo {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 12px;
  }

  .rail-bottom {
    flex-direction: row;
    gap: 8px;
  }

  .rail-dots,
  .rail-counter,
  .rail-logo-icon {
    display: none;
  }

  /* Vertical stacked layout */
  .track {
    display: flex;
    flex-direction: column;
    margin-left: 0;
    margin-top: 44px;
    height: auto;
    transform: none !important;
    transition: none;
  }

  .panel {
    width: 100vw;
    height: auto;
    min-height: 100svh;
    min-height: calc(100vh - 44px);
    padding: 48px 24px;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
  }

  /* All panels visible on mobile (no JS-driven animations) */
  .panel .panel-label,
  .panel .hero-headline,
  .panel .hero-sub,
  .panel .hero-cta,
  .panel .panel-heading,
  .panel .service-card,
  .panel .about-text,
  .panel .contact-block,
  .panel .contact-footer {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .hero-headline {
    font-size: 28px;
  }

  .hero-decoration,
  .about-decoration,
  .contact-decoration {
    display: none;
  }

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

  .service-icon {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .scroll-hint {
    display: none;
  }

  .progress {
    display: none;
  }

  /* Dividers between sections */
  .panel + .panel {
    border-top: 1px solid var(--bg-raised);
  }
}
