/* ============================================
   CRAYFISH — Marketing Website
   Design: Dark cinematic, terminal-inspired
   ============================================ */

/* --- Variables --- */
:root {
  --bg: #0a0a0a;
  --bg-card: #18181b;
  --bg-elevated: #27272a;
  --navy: #141b34;
  --accent: #e8732a;
  --accent-glow: rgba(232, 115, 42, 0.2);
  --secondary: #00d4aa;
  --text: #eaeaea;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #27272a;
  --border-muted: #3f3f46;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.25, 0, 0, 1);
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
input, textarea { border: none; outline: none; background: none; font-family: inherit; color: inherit; resize: none; }
::selection { background: var(--accent); color: var(--bg); }

/* --- Utilities --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 120px); }
.mono { font-family: var(--font-mono); }
.section-label { font-size: 12px; font-weight: 500; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; }
.section-label.center { text-align: center; display: block; }

/* --- Grain Overlay --- */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Custom Cursor --- */
.cursor {
  position: fixed; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); pointer-events: none; z-index: 10000;
  transform: translate(-50%, -50%); transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease);
  mix-blend-mode: difference;
}
.cursor-follower {
  position: fixed; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(232, 115, 42, 0.4); pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%); transition: width 0.4s var(--ease), height 0.4s var(--ease), border-color 0.3s var(--ease);
}
.cursor--hover .cursor { width: 16px; height: 16px; }
.cursor--hover .cursor-follower { width: 52px; height: 52px; border-color: var(--accent); }
@media (hover: none) { .cursor, .cursor-follower { display: none; } }

/* --- Preloader --- */
.preloader {
  position: fixed; inset: 0; z-index: 10001; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.preloader__inner { text-align: center; }
.preloader__logo {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  letter-spacing: 6px; color: var(--text); margin-bottom: 32px;
}
.preloader__bar {
  width: 200px; height: 2px; background: var(--border);
  margin: 0 auto 16px; overflow: hidden; border-radius: 1px;
}
.preloader__progress { width: 0%; height: 100%; background: var(--accent); border-radius: 1px; }
.preloader__counter { font-size: 12px; color: var(--text-muted); }

/* --- Navigation --- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 60px); height: 80px;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}
.nav--scrolled { background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.nav__logo { display: flex; align-items: center; }
.nav__logo img { height: 28px; width: auto; object-fit: contain; }
.nav__links { display: flex; gap: 40px; }
.nav__link {
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  transition: color 0.3s var(--ease); position: relative;
}
.nav__link::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px;
  background: var(--accent); transition: width 0.3s var(--ease);
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after { width: 100%; }
.nav__cta {
  font-size: 14px; font-weight: 600; background: var(--accent); color: var(--bg);
  padding: 10px 24px; border-radius: 8px; display: inline-block;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav__cta:hover { box-shadow: 0 4px 24px var(--accent-glow); }
.nav__burger {
  display: none; flex-direction: column; gap: 6px; width: 28px; padding: 4px 0; z-index: 1001;
}
.nav__burger span {
  display: block; width: 100%; height: 2px; background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav__burger--active span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__burger--active span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* --- Mobile Menu --- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 999; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px;
  opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
}
.mobile-menu--active { opacity: 1; pointer-events: all; }
.mobile-menu__link {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  color: var(--text-secondary); transition: color 0.3s var(--ease);
}
.mobile-menu__link:hover { color: var(--accent); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 32px; border-radius: 8px; font-size: 16px; font-weight: 600;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.btn--primary { background: var(--accent); color: var(--bg); }
.btn--primary:hover { box-shadow: 0 4px 24px var(--accent-glow); }
.btn--outline { border: 1px solid var(--border-muted); color: var(--text-secondary); }
.btn--outline:hover { border-color: var(--text-muted); color: var(--text); }

/* --- Hero --- */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding: clamp(100px, 15vh, 160px) clamp(24px, 8vw, 120px) clamp(60px, 10vh, 100px);
  overflow: hidden;
  background: #0a0a0a;
  background-image:
    radial-gradient(ellipse at 30% 60%, rgba(20, 27, 52, 0.4) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 40%, rgba(26, 14, 5, 0.3) 0%, transparent 60%);
}
.hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
}
.hero__content { position: relative; z-index: 1; max-width: 900px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 100px; border: 1px solid var(--border-muted);
  margin-bottom: 32px; font-size: 12px; color: var(--text-secondary);
}
.hero__badge-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--secondary);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}
.hero__title { margin-bottom: 24px; }
.hero__line {
  display: block; overflow: hidden;
}
.hero__line-inner {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 7vw, 86px); line-height: 1.05;
  transform: translateY(110%);
}
.hero__line--accent .hero__line-inner { color: var(--accent); }
.hero__sub {
  font-size: clamp(12px, 1.2vw, 14px); color: var(--text-muted);
  line-height: 1.6; max-width: 700px; margin-bottom: 32px; min-height: 44px;
}
.hero__sub .cursor-blink {
  animation: blink 1s step-end infinite; color: var(--secondary);
}
.hero__ctas { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 11px; color: var(--text-muted);
}
.hero__scroll-line {
  width: 1px; height: 48px; background: var(--border-muted); position: relative; overflow: hidden;
}
.hero__scroll-line::after {
  content: ''; position: absolute; top: -100%; left: 0; width: 100%; height: 50%;
  background: var(--accent); animation: scrollLine 2s ease infinite;
}
@keyframes scrollLine {
  0% { top: -50%; } 100% { top: 150%; }
}

/* --- About --- */
.about { padding: clamp(80px, 10vh, 120px) 0; }
.about__grid {
  display: grid; grid-template-columns: 400px 1fr; gap: clamp(40px, 6vw, 80px);
  margin-bottom: clamp(60px, 8vh, 80px);
}
.about__heading {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px);
  font-weight: 700; line-height: 1.1; position: relative;
}
.about__left { display: flex; flex-direction: column; gap: 24px; }
.about__right { display: flex; flex-direction: column; gap: 32px; }
.about__lead { font-size: 18px; color: var(--text-secondary); line-height: 1.7; }
.about__quote {
  padding-left: 24px; border-left: 3px solid var(--accent);
}
.about__quote blockquote {
  font-family: var(--font-display); font-size: 20px; font-weight: 500;
  font-style: italic; color: var(--text); line-height: 1.5;
}
.about__body { font-size: 16px; color: var(--text-muted); line-height: 1.7; }
.about__stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px;
  padding-top: 40px; border-top: 1px solid var(--border);
}
.about__stat { display: flex; flex-direction: column; gap: 4px; }
.about__stat-value { display: flex; align-items: baseline; }
.about__stat-number {
  font-family: var(--font-display); font-size: clamp(40px, 5vw, 56px);
  font-weight: 700; line-height: 1;
}
.about__stat-suffix {
  font-family: var(--font-display); font-size: clamp(40px, 5vw, 56px);
  font-weight: 700; line-height: 1;
}
.about__stat:last-child .about__stat-number { color: var(--accent); }
.about__stat:last-child .about__stat-suffix { color: var(--accent); }
.about__stat-label { font-size: 14px; color: var(--text-muted); line-height: 1.4; }

/* --- Marquee Band --- */
.marquee-band {
  overflow: hidden; padding: 14px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.marquee-band__inner {
  display: flex; width: max-content;
  animation: marquee-band 40s linear infinite;
}
.marquee-band__text {
  font-family: var(--font-display); font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 700; color: var(--text); opacity: 0.06;
  white-space: nowrap; padding-right: 0;
  letter-spacing: 6px; text-transform: uppercase;
}
@keyframes marquee-band {
  0% { transform: translateX(0); } 100% { transform: translateX(-50%); }
}

/* --- Process --- */
.process { padding: clamp(80px, 10vh, 120px) 0; background: var(--navy); }
.process__header { margin-bottom: 64px; }
.process__title {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px);
  font-weight: 700; line-height: 1.1; margin: 16px 0;
}
.process__desc { font-size: 16px; color: var(--text-muted); line-height: 1.6; max-width: 600px; }
.process__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.process__card {
  background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border);
  overflow: hidden; opacity: 0;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.process__card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 8px 32px rgba(232, 115, 42, 0.06); }

/* Terminal header */
.terminal__header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: #111214;
}
.terminal__dots { display: flex; gap: 6px; }
.terminal__dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.terminal__dots span:nth-child(1) { background: #ff5f57; }
.terminal__dots span:nth-child(2) { background: #febc2e; }
.terminal__dots span:nth-child(3) { background: #28c840; }
.terminal__title { font-size: 11px; color: var(--text-muted); }

.process__card-body { padding: 24px; }
.process__card-num {
  font-size: 48px; font-weight: 700; color: var(--accent); opacity: 0.15;
  line-height: 1; display: block; margin-bottom: 8px;
}
.process__card-body h3 {
  font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 12px;
}
.process__card-body p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* --- Section Divider --- */
.section-divider {
  height: 1px; max-width: 600px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  opacity: 0.2;
}

/* --- Services --- */
.services { padding: clamp(80px, 10vh, 120px) 0; }
.services__header { margin-bottom: 64px; }
.services__title {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px);
  font-weight: 700; line-height: 1.1; margin-top: 16px;
}
.services__bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.services__card {
  --card-accent: 232, 115, 42;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px; display: flex; flex-direction: column; gap: 16px;
  justify-content: flex-end; min-height: 280px; opacity: 0;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}
.services__card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--card-accent), 0.4);
  box-shadow: 0 8px 40px rgba(var(--card-accent), 0.08);
  background: linear-gradient(180deg, rgba(var(--card-accent), 0.03) 0%, var(--bg-card) 60%);
}
.services__card-icon { margin-bottom: auto; color: rgb(var(--card-accent)); }
.services__card h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.services__card p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.services__card-tag { font-size: 11px; font-weight: 500; color: rgb(var(--card-accent)); }

/* --- Projects --- */
.projects { padding: clamp(80px, 10vh, 120px) 0; overflow: hidden; }
.projects__header { margin-bottom: 48px; }
.projects__title {
  font-family: var(--font-display); font-size: clamp(32px, 4vw, 48px);
  font-weight: 700; line-height: 1.1; margin-top: 16px;
}
.projects__wrap { overflow: visible; }
.projects__track {
  display: flex; gap: 24px; padding: 0 clamp(24px, 5vw, 120px);
  will-change: transform;
}
.projects__card {
  flex: 0 0 400px; height: 320px; padding: 32px; border-radius: 14px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background: var(--cg); position: relative; overflow: hidden;
  transition: transform 0.4s var(--ease);
}
.projects__card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, transparent 70%);
  z-index: 1;
}
.projects__card > * { position: relative; z-index: 2; }
.projects__card:hover { transform: translateY(-6px); }
.projects__card-art {
  position: absolute; top: 0; right: 0; width: 200px; height: 200px;
  z-index: 0; opacity: 1; transition: opacity 0.4s var(--ease), transform 0.6s var(--ease);
}
.projects__card:hover .projects__card-art { opacity: 1; transform: scale(1.1) rotate(3deg); }
.projects__card-tag { font-size: 11px; font-weight: 500; color: var(--secondary); margin-bottom: auto; }
.projects__card h3 { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.projects__card-loc { font-size: 13px; color: var(--text-secondary); }
.projects__card-scope { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* Projects progress bar */
.projects__progress {
  max-width: 300px; height: 2px; background: var(--border);
  margin: 32px auto 0; border-radius: 1px; overflow: hidden;
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.projects__progress--visible { opacity: 1; }
.projects__progress-bar {
  width: 0%; height: 100%; background: var(--accent); border-radius: 1px;
  transition: width 0.1s linear;
}

/* --- Partners --- */
.partners { padding: 60px 0; overflow: hidden; }
.partners .section-label { margin-bottom: 32px; }
.partners__marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.partners__track {
  display: flex; gap: 60px; animation: marquee 50s linear infinite;
  width: max-content;
}
.partners__logo {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--text-muted); white-space: nowrap; opacity: 0.4;
  letter-spacing: 2px; text-transform: uppercase;
  transition: color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.partners__logo:hover { color: var(--text-secondary); opacity: 0.7; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* --- CTA --- */
.cta { padding: clamp(80px, 10vh, 120px) 0; background: var(--navy); }
.cta__content { text-align: center; max-width: 800px; margin: 0 auto; }
.cta__title {
  font-family: var(--font-display); font-size: clamp(32px, 5vw, 56px);
  font-weight: 700; line-height: 1.1; margin: 16px 0 24px;
}
.cta__desc { font-size: 18px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 48px; }
.cta__terminal {
  max-width: 640px; margin: 0 auto; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-align: left;
}
.cta__form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.cta__form-line { display: flex; align-items: center; gap: 8px; }
.cta__form-line--textarea { align-items: flex-start; }
.cta__prompt {
  font-size: 13px; font-weight: 500; color: var(--secondary); white-space: nowrap; min-width: 110px;
}
.cta__cursor {
  animation: blink 1s step-end infinite; margin-left: 2px;
}
.cta__form-line:focus-within .cta__cursor { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.cta__input {
  flex: 1; height: 40px; padding: 0 8px;
  background: transparent; border-bottom: 1px solid var(--border-muted);
  border-radius: 0; font-family: var(--font-mono); font-size: 13px; color: var(--text);
  caret-color: var(--secondary);
  transition: border-color 0.3s var(--ease);
}
.cta__textarea { height: auto; min-height: 80px; padding: 8px; line-height: 1.5; }
.cta__input::placeholder { color: var(--text-muted); }
.cta__input:focus { border-color: var(--accent); }
.cta__submit { align-self: flex-start; }

/* --- Footer --- */
.footer { padding: 60px 0; border-top: 1px solid var(--border); }
.footer__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 40px;
}
.footer__logo { height: 32px; width: auto; margin-bottom: 12px; }
.footer__address { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.footer__links { display: flex; gap: 40px; }
.footer__links a {
  font-size: 14px; color: var(--text-secondary);
  transition: color 0.3s var(--ease);
}
.footer__links a:hover { color: var(--text); }
.footer__bottom { font-size: 11px; color: var(--text-muted); }

/* --- Animation base states --- */
.fade-up { opacity: 0; transform: translateY(30px); }
.reveal-text { clip-path: inset(0 0 100% 0); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .process__grid { grid-template-columns: repeat(2, 1fr); }
  .services__bento { grid-template-columns: repeat(2, 1fr); }
  .about__grid { grid-template-columns: 1fr; }
  .about__stats { grid-template-columns: repeat(2, 1fr); }
  .projects__card { flex: 0 0 340px; height: 280px; }
}

@media (max-width: 768px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .hero { padding: 120px 24px 80px; }
  .hero__line-inner { font-size: clamp(32px, 10vw, 48px); }
  .hero__scroll { display: none; }
  .about__grid { gap: 40px; }
  .about__stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .process__grid { grid-template-columns: 1fr; }
  .services__bento { grid-template-columns: 1fr; }
  .services__card { min-height: 220px; }
  .projects__wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .projects__wrap::-webkit-scrollbar { display: none; }
  .projects__card { flex: 0 0 300px; height: 260px; }
  .projects__progress { display: none; }
  .marquee-band__text { font-size: 16px; }
  .cta__form-line { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cta__prompt { font-size: 12px; }
  .cta__input { width: 100%; }
  .footer__top { flex-direction: column; gap: 32px; }
  .footer__links { flex-wrap: wrap; gap: 20px; }
}
