/* ===========================
   BERKMINSTER — MAIN STYLESHEET
   =========================== */

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

:root {
  --color-bg: #0a0a0f;
  --color-bg2: #0f0f18;
  --color-bg3: #13131e;
  --color-surface: #16161f;
  --color-border: rgba(255,255,255,0.07);
  --color-text: #e8e8f0;
  --color-muted: #8888a0;
  --color-accent: #6366f1;
  --color-accent2: #8b5cf6;
  --color-accent3: #06b6d4;
  --color-green: #10b981;
  --gradient-accent: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-text: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #06b6d4 100%);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 64px rgba(0,0,0,0.6);
}

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

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---- TYPOGRAPHY ---- */

h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.75rem); }
h3 { font-size: 1.2rem; font-weight: 600; }

p { color: var(--color-muted); }

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.muted { color: var(--color-muted); }

/* ---- BUTTONS ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
}

.btn-arrow { transition: transform var(--transition); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ---- NAVBAR ---- */

.nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all var(--transition);
}

.nav-wrapper.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--gradient-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--color-muted);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--color-text); }
.nav-links .btn { color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ---- HERO ---- */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,0.15) 0%, transparent 70%),
              radial-gradient(ellipse 40% 40% at 80% 60%, rgba(139,92,246,0.08) 0%, transparent 60%);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 0%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--color-green);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 28px;
}
.hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-title {
  margin-bottom: 24px;
  color: var(--color-text);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 580px;
  margin-bottom: 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

@keyframes scrollDown {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---- SECTIONS ---- */

.section {
  padding: 100px 0;
}

.section-dark {
  background: var(--color-bg2);
}

.section-tinted {
  background: var(--color-bg3);
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.section-title {
  color: var(--color-text);
  margin-bottom: 16px;
}

.section-sub {
  color: var(--color-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---- SERVICES ---- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: inherit;
}

.service-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.service-card.featured {
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, var(--color-surface) 60%);
}

.service-icon {
  width: 48px;
  height: 48px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.service-icon svg {
  width: 22px;
  height: 22px;
  color: var(--color-accent);
}

.service-card h3 {
  color: var(--color-text);
  margin-bottom: 12px;
}

.service-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.service-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-list li {
  font-size: 0.88rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* ---- WORK ---- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.work-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.work-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.work-thumb {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.thumb-1 { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.thumb-2 { background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0a3622 100%); }
.thumb-3 { background: linear-gradient(135deg, #1c0533 0%, #2d0a50 50%, #0a1628 100%); }
.thumb-4 { background: linear-gradient(135deg, #1a0a00 0%, #3d1a00 50%, #1a0a14 100%); }

.thumb-1::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='50' cy='50' r='40' stroke='%236366f1' stroke-width='0.5' fill='none' opacity='0.3'/%3E%3Ccircle cx='50' cy='50' r='25' stroke='%236366f1' stroke-width='0.5' fill='none' opacity='0.2'/%3E%3C/svg%3E") center/cover; }
.thumb-2::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='80'%3E%3Crect x='10' y='10' width='100' height='60' rx='4' stroke='%2310b981' stroke-width='0.5' fill='none' opacity='0.3'/%3E%3Cline x1='10' y1='30' x2='110' y2='30' stroke='%2310b981' stroke-width='0.3' opacity='0.2'/%3E%3C/svg%3E") center/contain repeat; }

.work-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
}

.work-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.1);
}

.work-info { padding: 24px; }

.work-info h3 {
  color: var(--color-text);
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.work-info p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.work-tags span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.15);
  padding: 3px 10px;
  border-radius: 100px;
  font-family: var(--font-mono);
}

/* ---- PROCESS ---- */

.process-steps {
  max-width: 700px;
  margin: 0 auto;
}

.process-step {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.process-connector {
  width: 2px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-accent), rgba(99,102,241,0.1));
  margin-left: 28px;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content { padding-top: 12px; }

.step-content h3 {
  color: var(--color-text);
  margin-bottom: 8px;
}

.step-content p { font-size: 0.95rem; line-height: 1.7; }

/* ---- TECH STACK ---- */

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.tech-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--color-muted);
  transition: all var(--transition);
}

.tech-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--color-text);
  background: rgba(99, 102, 241, 0.05);
}

/* ---- ABOUT ---- */

.about-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 64px;
  align-items: start;
}

.about-text .section-tag { display: inline-block; }
.about-text .section-title { text-align: left; margin-top: 8px; }

.about-text p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.about-values {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.value {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--color-text);
  font-weight: 500;
}

.value-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-accent);
  flex-shrink: 0;
}

.about-card {
  position: sticky;
  top: 100px;
}

.about-card-inner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.about-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
}

.about-card-inner h3 {
  color: var(--color-text);
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.about-card-inner p {
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.about-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--color-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 12px;
}

.badge::before {
  content: '✓';
  color: var(--color-green);
  font-size: 0.7rem;
  font-weight: 700;
}

/* ---- CONTACT ---- */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--color-text);
  font-family: var(--font-sans);
  transition: border-color var(--transition);
  width: 100%;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238888a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.form-group select option { background: var(--color-bg2); }

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

.form-note { text-align: center; font-size: 0.82rem; color: var(--color-muted); }

.contact-aside {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 8px;
}

.contact-info-block h3 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 500;
  transition: color var(--transition);
}

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

.contact-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.contact-info-block .muted {
  font-size: 0.9rem;
  line-height: 1.6;
}

.availability-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-green);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  padding: 8px 14px;
}

.avail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

/* ---- FOOTER ---- */

.footer {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-brand p {
  font-size: 0.9rem;
  margin-top: 8px;
}

.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--color-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--color-text); }

.footer-copy {
  font-size: 0.82rem;
}

/* ---- TOAST ---- */

.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 24px;
  font-size: 0.9rem;
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--transition);
  max-width: 320px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16, 185, 129, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }

/* ---- ANIMATIONS ---- */

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

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- RESPONSIVE ---- */

@media (max-width: 900px) {
  .services-grid,
  .work-grid { grid-template-columns: 1fr; }

  .about-layout,
  .contact-layout { grid-template-columns: 1fr; }

  .about-card { position: static; }

  .form-row { grid-template-columns: 1fr; }

  .contact-aside { display: none; }

  .hero-stats { gap: 28px; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(16px);
    padding: 80px 24px 32px;
    gap: 24px;
    z-index: 99;
    align-items: flex-start;
  }

  .nav-links.open li a {
    font-size: 1.2rem;
  }

  .hero-actions { flex-direction: column; }

  .hero-actions .btn { width: 100%; justify-content: center; }

  .hero-stats { flex-direction: column; gap: 16px; }

  .process-connector { margin-left: 28px; }
}
