/* ============================================
   Baker Technology — tokens
   ============================================ */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #131311;
  --bg-elevated-2: #17160f;
  --line: #262620;
  --text: #f2f1ea;
  --text-dim: #a6a49a;
  --gold: #dfc05f;
  --gold-bright: #ebc752;
  --gold-dim: #8a7638;

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'Manrope', sans-serif;

  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #0a0a0a;
  padding: 12px 20px;
  z-index: 1000;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ============================================
   Header / Nav
   ============================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  height: 30px;
  width: auto;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.main-nav a {
  color: var(--text-dim);
  transition: color 0.2s ease;
  padding: 6px 0;
}
.main-nav a:hover { color: var(--gold-bright); }

.nav-cta {
  border: 1px solid var(--gold-dim);
  padding: 8px 16px !important;
  border-radius: 2px;
  color: var(--gold) !important;
}
.nav-cta:hover {
  background: var(--gold);
  color: #0a0a0a !important;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px 24px 20px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  border-top: 1px solid var(--line);
}
.mobile-nav a {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}
.mobile-nav a:last-child { border-bottom: none; }

.site-header.nav-open .mobile-nav {
  display: flex;
}

/* ============================================
   Full-screen intro splash + glitch/assemble animation
   ============================================ */
.intro-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease;
}

.intro-splash.splash-fade {
  opacity: 0;
}

.intro-splash.splash-hidden {
  display: none;
}

.trace-wrap {
  position: relative;
  width: min(60vw, 60vh, 420px);
  height: min(60vw, 60vh, 420px);
  aspect-ratio: 886 / 771;
}

.trace-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-mask-image: conic-gradient(#000 0deg, #000 0deg, transparent 0deg, transparent 360deg);
  mask-image: conic-gradient(#000 0deg, #000 0deg, transparent 0deg, transparent 360deg);
}

.trace-tip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
}

.tip-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 14px 4px rgba(235, 199, 82, 0.9), 0 0 28px 10px rgba(223, 192, 95, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.spark-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
}

.spark-burst span {
  position: absolute;
  top: 0;
  left: -1px;
  width: 2px;
  height: 0;
  background: linear-gradient(to top, transparent, var(--gold-bright) 60%, #fff);
  transform-origin: center bottom;
  opacity: 0;
  border-radius: 2px;
}

.spark-burst span:nth-child(1) { transform: rotate(0deg); }
.spark-burst span:nth-child(2) { transform: rotate(45deg); }
.spark-burst span:nth-child(3) { transform: rotate(90deg); }
.spark-burst span:nth-child(4) { transform: rotate(135deg); }
.spark-burst span:nth-child(5) { transform: rotate(180deg); }
.spark-burst span:nth-child(6) { transform: rotate(225deg); }
.spark-burst span:nth-child(7) { transform: rotate(270deg); }
.spark-burst span:nth-child(8) { transform: rotate(315deg); }

.spark-active .spark-burst span {
  animation: sparkRay 0.5s ease-out forwards;
}

.spark-active .spark-burst span:nth-child(2n) {
  animation-duration: 0.42s;
}

@keyframes sparkRay {
  0%   { height: 0; opacity: 0; }
  25%  { height: 18px; opacity: 1; }
  100% { height: 26px; opacity: 0; }
}

.trace-logo.trace-flash {
  animation: traceFlash 0.4s ease-out;
}

@keyframes traceFlash {
  0%   { filter: brightness(1); }
  25%  { filter: brightness(2.1); }
  100% { filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  .intro-splash { display: none; }
}

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, rgba(223, 192, 95, 0.08), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 720px;
  text-align: center;
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.12;
  margin-bottom: 20px;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  padding: 14px 28px;
  border-radius: 2px;
  display: inline-block;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--gold);
  color: #0a0a0a;
  border: 1px solid var(--gold);
}
.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 100px 24px;
}

.section-alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-inner-narrow {
  max-width: 720px;
}

.section h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 600;
  margin-bottom: 20px;
}

.trace-line {
  height: 1px;
  width: 100%;
  max-width: 220px;
  background: var(--line);
  margin-bottom: 56px;
  position: relative;
  overflow: hidden;
}

.trace-line::after {
  content: "";
  position: absolute;
  top: 0; left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transition: left 1.1s ease;
}

.trace-line.in-view::after {
  left: 100%;
}

/* ============================================
   Services
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 28px 24px;
  border-radius: 3px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.service-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.service-featured {
  grid-column: span 3;
  background: linear-gradient(135deg, var(--bg-elevated-2), var(--bg-elevated));
  border: 1px solid var(--gold-dim);
  padding: 32px 28px;
}

.service-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.service-featured h3 { font-size: 1.35rem; }

/* ============================================
   Work / Case studies
   ============================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.work-card {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 26px 24px;
  border-radius: 3px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.section-alt .work-card { background: var(--bg-elevated-2); }

.work-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}

.work-featured {
  grid-column: span 2;
  border-color: var(--gold-dim);
}

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

.work-tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  padding: 4px 9px;
  border-radius: 2px;
}

.work-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.work-card p {
  color: var(--text-dim);
  font-size: 0.94rem;
  margin-bottom: 10px;
}

.work-outcome {
  color: var(--text) !important;
  font-size: 0.9rem !important;
}

.work-link {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gold);
  border-bottom: 1px solid var(--gold-dim);
}
.work-link:hover { color: var(--gold-bright); border-color: var(--gold-bright); }

/* ============================================
   About
   ============================================ */
.about-copy {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cert-list span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 2px;
}

/* ============================================
   Contact
   ============================================ */
.contact-intro {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 40px;
}

.hidden-field { display: none; }

.contact-form label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 14px;
}

.contact-form input,
.contact-form textarea {
  background: var(--bg-elevated-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: 2px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--gold-dim);
}

.contact-form button {
  margin-top: 22px;
  border: none;
  cursor: pointer;
  align-self: flex-start;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  padding: 32px 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ============================================
   Scroll reveal
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 860px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-featured { grid-column: span 2; }
  .work-grid { grid-template-columns: 1fr; }
  .work-featured { grid-column: span 1; }
}

@media (max-width: 700px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }

  .services-grid { grid-template-columns: 1fr; }
  .service-featured { grid-column: span 1; }

  .section { padding: 72px 20px; }
  .hero { padding: 120px 20px 60px; }
}
