/* Cape Doctor Digital — original design, "wind clears the sky" motif */

:root {
  --bg: #05070c;
  --bg-2: #0a0f18;
  --surface: #0d1320;
  --text: #d7dde8;
  --text-bright: #ffffff;
  --text-dim: #6b7484;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #38d9ff;
  --accent-soft: rgba(56, 217, 255, 0.12);
  --accent-2: #ffb454;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --gap-section: clamp(4rem, 9vw, 9rem);
  --pad-inline: clamp(1.25rem, 5vw, 4rem);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #05070c;
  padding: 0.75rem 1.25rem; z-index: 1000; border-radius: 0 0 0.5rem 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* ---- Scroll progress ---- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 999; transition: width 0.1s linear;
}

/* ---- Custom cursor (fine pointers only, see JS) ---- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 998;
  border-radius: 50%; transform: translate(-50%, -50%);
  opacity: 0; transition: opacity 0.3s ease;
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.cursor-ring { width: 34px; height: 34px; border: 1px solid var(--accent); transition: opacity 0.3s ease, width 0.2s var(--ease), height 0.2s var(--ease), border-color 0.2s ease; }
body.cursor-active .cursor-dot, body.cursor-active .cursor-ring { opacity: 1; }
.cursor-ring.hovering { width: 54px; height: 54px; border-color: var(--accent-2); }

/* ---- Grain overlay ---- */
.grain-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) { .grain-overlay { opacity: 0.03; } }

/* ---- Aurora glow blobs ---- */
.aurora { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.aurora-blob {
  position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: 0.32; animation: auroraDrift 20s ease-in-out infinite alternate;
}
.blob-a { width: 26rem; height: 26rem; background: var(--accent); top: -8rem; left: -6rem; }
.blob-b { width: 22rem; height: 22rem; background: #7c5cff; top: 30%; right: -7rem; animation-duration: 24s; animation-delay: -6s; }
.blob-c { width: 20rem; height: 20rem; background: var(--accent-2); bottom: -9rem; left: 28%; animation-duration: 28s; animation-delay: -12s; }
.aurora-small .aurora-blob { opacity: 0.2; filter: blur(70px); }
@keyframes auroraDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(2.5rem, -2rem) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) { .aurora-blob { animation: none; } }

/* ---- Wind canvas ---- */
.wind-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; opacity: 0.55; pointer-events: none;
}

/* ---- Reveal-on-scroll base ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--text-bright); }
h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.08; margin-top: 0.5rem; }
h3 { font-size: 1.3rem; line-height: 1.2; }

/* ---- Buttons ---- */
.btn-pill {
  position: relative; display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.8rem; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 500;
  color: var(--text-bright); cursor: pointer; transition: background 0.25s ease, transform 0.15s ease;
  will-change: transform;
}
.btn-pill:hover { background: var(--accent); color: #05070c; }
.btn-pill.ghost { background: transparent; border-color: var(--line); }
.btn-pill.ghost:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--text-bright); }
.btn-pill.large { padding: 1.1rem 2.4rem; font-size: 1rem; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad-inline);
  background: rgba(5, 7, 12, 0.7); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled { border-color: var(--line); background: rgba(5, 7, 12, 0.92); }

.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text-bright); white-space: nowrap; }
.logo-mark { width: 1.6rem; height: 1.6rem; flex-shrink: 0; }
.logo-accent { color: var(--accent); }
.logo-suffix { color: var(--text-dim); font-weight: 400; }

.site-nav ul { display: flex; gap: 2rem; }
.site-nav a { font-size: 0.9rem; font-weight: 500; position: relative; padding-bottom: 2px; }
.site-nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 1px;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.site-nav a:hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text-bright); transition: transform 0.25s ease, opacity 0.25s ease; }

/* ---- Hero ---- */
.hero {
  position: relative; z-index: 1;
  min-height: 92vh; display: flex; align-items: center;
  padding: var(--gap-section) var(--pad-inline);
}
.hero-inner { max-width: 900px; }

.hero-headline { font-size: clamp(2.6rem, 8vw, 5.5rem); line-height: 0.98; margin: 1rem 0 1.5rem; }
.hero-headline .line { display: block; overflow: hidden; }
.hero-headline .line span.char { display: inline-block; }
.hero-headline .accent { color: var(--accent); }

.hero-sub { max-width: 46ch; font-size: 1.05rem; color: var(--text); margin-bottom: 2rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.scroll-cue { position: absolute; bottom: 2rem; left: var(--pad-inline); }
.scroll-cue span {
  display: block; width: 1px; height: 40px; background: linear-gradient(var(--accent), transparent);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(10px); opacity: 0.4; } }

/* ---- Marquee ---- */
.marquee { position: relative; z-index: 1; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.25rem 0; }
.marquee-track { display: flex; gap: 1.5rem; width: max-content; animation: marquee 26s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-dim); white-space: nowrap; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- About ---- */
.about { position: relative; z-index: 1; padding: var(--gap-section) var(--pad-inline); }
.about-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; }
.about-copy p { margin-bottom: 1rem; max-width: 60ch; }

/* ---- Services ---- */
.services { position: relative; z-index: 1; padding: var(--gap-section) var(--pad-inline); }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin-top: 2.5rem; perspective: 1000px; }

.tilt-card { border-radius: 1rem; }
.tilt-card-inner {
  border: 1px solid var(--line); border-radius: 1rem; padding: 1.9rem;
  background: linear-gradient(160deg, var(--surface), rgba(13, 19, 32, 0.4));
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  transform-style: preserve-3d; height: 100%;
}
.tilt-card:hover .tilt-card-inner { border-color: var(--accent); box-shadow: 0 20px 60px -20px rgba(56, 217, 255, 0.25); }
.service-icon { font-size: 1.6rem; color: var(--accent); display: inline-block; margin-bottom: 0.75rem; }
.tilt-card-inner p { color: var(--text-dim); margin-top: 0.5rem; font-size: 0.95rem; }

.more-services { margin-top: 3rem; }
.more-services ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; margin-top: 1.25rem; }
.more-services li { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.9rem 1.1rem; font-size: 0.92rem; }

/* ---- Playground ---- */
.playground { position: relative; z-index: 1; padding: var(--gap-section) var(--pad-inline); text-align: center; }
.playground-sub { max-width: 50ch; margin: 0.75rem auto 2.5rem; color: var(--text-dim); }
.playground-panel {
  position: relative; max-width: 900px; margin: 0 auto; height: min(50vh, 420px);
  border: 1px solid var(--line); border-radius: 1.25rem; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(56, 217, 255, 0.06), transparent 70%);
}
.playground-panel canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.playground-hint {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim); pointer-events: none;
}

/* ---- Process ---- */
.process { position: relative; z-index: 1; padding: var(--gap-section) var(--pad-inline); background: var(--bg-2); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2.5rem; margin-top: 3rem; }
.step-number { font-family: var(--font-display); color: var(--accent); font-size: 0.85rem; }
.step h3 { margin-top: 0.5rem; }
.step p { color: var(--text-dim); margin-top: 0.5rem; font-size: 0.95rem; }

/* ---- Work / concepts ---- */
.work { position: relative; z-index: 1; padding: var(--gap-section) var(--pad-inline); }
.work-sub { max-width: 55ch; color: var(--text-dim); margin-top: 0.5rem; }
.concept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.75rem; margin-top: 2.5rem; perspective: 1000px; }
.concept-card { border: 1px solid var(--line); border-radius: 1rem; padding: 1.5rem; background: var(--surface); }
.concept-card h3 { margin-top: 1rem; }
.concept-card p { color: var(--text-dim); font-size: 0.92rem; margin-top: 0.35rem; }

.concept-visual { position: relative; height: 180px; border-radius: 0.75rem; overflow: hidden; background: #080c14; }
.concept-ecommerce { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; }
.c-block { border-radius: 6px; }
.c-1 { background: linear-gradient(135deg, var(--accent), transparent); grid-row: span 2; }
.c-2 { background: linear-gradient(135deg, var(--accent-2), transparent); opacity: 0.7; }
.c-3 { background: linear-gradient(135deg, #7c5cff, transparent); opacity: 0.5; }

.concept-saas { padding: 1.25rem; display: flex; flex-direction: column; justify-content: center; gap: 0.6rem; }
.c-line { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), transparent); }
.l-1 { width: 80%; } .l-2 { width: 55%; opacity: 0.7; } .l-3 { width: 65%; opacity: 0.5; }
.c-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent-2); margin-top: 0.5rem; }

.concept-portfolio { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.c-circle { width: 70px; height: 70px; border-radius: 50%; background: conic-gradient(var(--accent), var(--accent-2), var(--accent)); }
.c-bar { width: 4px; height: 100px; background: var(--line); }

/* ---- Values ---- */
.values { position: relative; z-index: 1; padding: var(--gap-section) var(--pad-inline); background: var(--bg-2); }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; margin-top: 2.5rem; }
.value-item { border-left: 2px solid var(--accent); padding-left: 1.25rem; }
.value-item p { color: var(--text-dim); margin-top: 0.4rem; font-size: 0.95rem; }

/* ---- CTA banner ---- */
.cta-banner { position: relative; z-index: 1; padding: var(--gap-section) var(--pad-inline); border-top: 1px solid var(--line); }
.cta-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: start; max-width: 1100px; margin: 0 auto; }
.cta-copy h2 { max-width: 20ch; }
.cta-sub { color: var(--text-dim); margin-top: 1rem; max-width: 40ch; }

.project-form {
  display: flex; flex-direction: column; gap: 1.25rem;
  border: 1px solid var(--line); border-radius: 1rem; padding: 2rem;
  background: var(--surface);
}
.form-row { display: flex; flex-direction: column; gap: 0.5rem; }
.form-row label { font-family: var(--font-mono, var(--font-display)); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.form-row input, .form-row textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: 0.5rem;
  padding: 0.75rem 1rem; color: var(--text-bright); font-family: var(--font-body); font-size: 0.95rem;
  resize: vertical; transition: border-color 0.2s ease;
}
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--accent); }
.project-form .btn-pill { align-self: flex-start; border: none; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 0.9rem; min-height: 1.2em; }
.form-status.success { color: var(--accent); }
.form-status.error { color: #ff8a5c; }
.project-form.submitting .btn-pill { opacity: 0.6; pointer-events: none; }

@media (max-width: 900px) {
  .cta-inner { grid-template-columns: 1fr; }
}

/* ---- Footer ---- */
.site-footer { position: relative; z-index: 1; padding: var(--gap-section) var(--pad-inline) 2rem; background: var(--bg-2); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-tagline { color: var(--text-dim); margin-top: 0.5rem; font-size: 0.9rem; }
.footer-nav ul, .footer-social { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-contact p { margin-top: 0.4rem; }
.social-links { display: flex; gap: 1rem; margin-top: 0.5rem; }
.todo-note { color: var(--accent-2); opacity: 0.75; font-size: 0.78rem; margin-top: 0.5rem; }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--text-dim); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .site-nav { position: fixed; inset: 72px 0 0 0; background: rgba(5, 7, 12, 0.98); backdrop-filter: blur(10px);
    display: flex; flex-direction: column; padding: 2rem var(--pad-inline); transform: translateX(100%);
    transition: transform 0.35s var(--ease); z-index: 90; }
  .site-nav.open { transform: translateX(0); }
  .site-nav ul { flex-direction: column; gap: 1.5rem; font-size: 1.25rem; }
  .nav-toggle { display: flex; }
  .btn-pill.primary:not(.large) { display: none; }
}

@media (max-width: 640px) {
  :root { --gap-section: 4rem; }
  .cursor-dot, .cursor-ring { display: none; }
}
