/* =============================================
   Mill-Turn Pros — styles.css
   Theme: Modern Tech (charcoal + electric blue)
   ============================================= */

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

:root {
  --bg:         #0f172a;
  --bg-surface: #1e293b;
  --bg-card:    #162032;
  --accent:     #38bdf8;
  --accent-dim: #0ea5e9;
  --accent-glow:rgba(56, 189, 248, 0.18);
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim:   #64748b;
  --border:     rgba(56, 189, 248, 0.12);
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 4px 32px rgba(0,0,0,0.45);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body:  'Inter', system-ui, sans-serif;
  --font-head:  'Space Grotesk', 'Inter', system-ui, sans-serif;
  --container:  1140px;
}

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

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

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

/* --- Sections --- */
.section { padding: 6rem 0; position: relative; }

.section-header { text-align: center; margin-bottom: 3.5rem; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn--sm { padding: 0.5rem 1.1rem; font-size: 0.875rem; }
.btn--full { width: 100%; justify-content: center; }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 0;
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 0;
  box-shadow: 0 1px 0 var(--border);
}

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

.navbar__logo {
  display: flex;
  align-items: center;
  transition: opacity var(--transition);
}
.navbar__logo:hover { opacity: 0.85; }

.logo-img {
  height: 48px;
  width: auto;
  display: block;
}

.logo-img--footer {
  height: 38px;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar__nav a:not(.btn) {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.navbar__nav a:not(.btn):hover { color: var(--text); }

/* Hamburger */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.navbar__hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile nav open state */
.navbar__hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.navbar__hamburger.open span:nth-child(2) { opacity: 0; }
.navbar__hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 768px) {
  .navbar__hamburger { display: flex; }
  .navbar__nav {
    position: fixed;
    inset: 0 0 0 30%;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 90;
  }
  .navbar__nav.open { transform: translateX(0); }
  .navbar__nav a:not(.btn) { font-size: 1.1rem; color: var(--text); }
  .navbar__nav .btn { width: 100%; justify-content: center; }
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 80px;
}

/* Canvas particle overlay */
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Grid pattern background */
.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56,189,248,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 40%, transparent 100%);
}

/* Radial glow */
.hero__glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(56,189,248,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero__headline {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero__headline .accent {
  background: linear-gradient(90deg, var(--accent) 0%, #7dd3fc 40%, var(--accent) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerText 4s linear infinite;
}

@keyframes shimmerText {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero__cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Scroll hint */
.hero__scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__scroll-hint span {
  display: block;
  width: 22px;
  height: 36px;
  border: 2px solid var(--text-dim);
  border-radius: 12px;
  position: relative;
}
.hero__scroll-hint span::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 7px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0%, 100% { top: 5px; opacity: 1; }
  80% { top: 18px; opacity: 0; }
}

/* =============================================
   SERVICES
   ============================================= */
.services {
  background: var(--bg);
}

.services::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

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

.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 var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 12px 40px rgba(56, 189, 248, 0.1);
}

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

.card__icon {
  width: 52px;
  height: 52px;
  background: var(--accent-glow);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
  padding: 10px;
}

.card__icon svg { width: 100%; height: 100%; }

.card__title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.card__body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.card__list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card__list li {
  font-size: 0.83rem;
  color: var(--text-dim);
  padding-left: 1.1rem;
  position: relative;
}
.card__list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 1px;
}

/* =============================================
   ABOUT
   ============================================= */
.about {
  background: var(--bg-surface);
}

.about__inner {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: center;
}

.about__photo-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}

.about__photo-placeholder {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3/4;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Replace placeholder with real photo by swapping this for an <img> */
.about__photo-placeholder svg {
  width: 60%;
  height: auto;
  opacity: 0.25;
}

.about__badge {
  position: absolute;
  bottom: 1.5rem;
  right: -1rem;
  background: var(--accent);
  color: #0f172a;
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.4);
  line-height: 1.2;
}
.about__badge span:first-child { font-size: 1.6rem; font-family: var(--font-head); }
.about__badge span:last-child  { font-size: 0.72rem; font-weight: 600; white-space: nowrap; }

.about__text { max-width: 720px; margin: 0 auto; }
.about__text .section-title { text-align: center; margin-bottom: 1.5rem; }
.about__text .section-label { text-align: center; }

.about__text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.97rem;
  line-height: 1.75;
}

.about__stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

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

.stat__num {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat__plus { font-size: 1.25rem; }
.stat__label { font-size: 0.78rem; color: var(--text-dim); font-weight: 500; }

@media (max-width: 768px) {
  .about__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about__badge { right: 0; bottom: 1rem; }
  .about__stats { gap: 1.5rem; }
  .stat__num { font-size: 1.6rem; }
}

/* =============================================
   CONTACT
   ============================================= */
.contact {
  background: var(--bg);
  overflow: hidden;
}

.contact__bg-glow {
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(56,189,248,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
}

.contact__info .section-title { text-align: left; margin-bottom: 1rem; }
.contact__info .section-label { text-align: left; }
.contact__info .section-sub   { text-align: left; margin: 0 0 2rem; font-size: 0.97rem; }

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

.contact__details li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact__details a { transition: color var(--transition); }
.contact__details a:hover { color: var(--accent); }

.contact__icon {
  width: 38px;
  height: 38px;
  background: var(--accent-glow);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.contact__icon svg { width: 18px; height: 18px; }

/* Form */
.contact__form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

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

@media (max-width: 540px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.93rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-group select option { background: var(--bg-surface); }

.form-group input:focus,
.form-group select: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: 110px; }

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

.form__note {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: -0.25rem;
}

/* Success / error states */
.contact__form.submitted .btn--primary {
  background: #22c55e;
  border-color: #22c55e;
  pointer-events: none;
}

@media (max-width: 900px) {
  .contact__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer__logo {
  display: flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity var(--transition);
}
.footer__logo:hover { opacity: 1; }

.footer__copy {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer__nav {
  display: flex;
  gap: 1.5rem;
}
.footer__nav a {
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: color var(--transition);
}
.footer__nav a:hover { color: var(--accent); }

@media (max-width: 600px) {
  .footer__inner { justify-content: center; text-align: center; }
}

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of grid */
.services__grid .card:nth-child(2) { transition-delay: 0.1s; }
.services__grid .card:nth-child(3) { transition-delay: 0.2s; }
.services__grid .card:nth-child(4) { transition-delay: 0.3s; }
.services__grid .card:nth-child(5) { transition-delay: 0.4s; }
.services__grid .card:nth-child(6) { transition-delay: 0.5s; }

/* =============================================
   GAME SECTION
   ============================================= */
.game-section {
  background: var(--bg-surface);
}

.game-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.game {
  max-width: 560px;
  margin: 0 auto;
}

.game__start {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.game__start p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.game__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.game__progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

#gameProgressText {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.game__progress-bar {
  height: 3px;
  background: rgba(56, 189, 248, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.game__progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s ease;
}

.game__timer-bar {
  height: 3px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.75rem;
  margin-top: 0.35rem;
}

.game__timer-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.game__explain {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: fadeSlideIn 0.2s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.game__explain p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.game__breakdown {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.25rem 0 0.5rem;
}

.game__breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  padding: 0.5rem 0.85rem;
  border-radius: 7px;
  text-align: left;
}

.game__breakdown-item.correct {
  background: rgba(34, 197, 94, 0.09);
  color: #86efac;
}

.game__breakdown-item.wrong {
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.game__bd-icon { flex-shrink: 0; font-size: 0.75rem; opacity: 0.85; }

.game__bd-code {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 2.8rem;
}

.game__bd-answer { color: inherit; opacity: 0.85; }

.game__question {
  text-align: center;
  margin-bottom: 2rem;
}

.game__code {
  font-family: var(--font-head);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.game__prompt {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.game__choices {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.game__choice {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.game__choice:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateX(4px);
}

.game__choice.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.game__choice.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.game__result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.game__score-display {
  font-family: var(--font-head);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
}

.game__score-denom {
  color: var(--text-dim);
  font-size: 2.5rem;
}

.game__score-msg {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
