/* ========================================
   MaxWorks.me — Brand Site
   ======================================== */

:root {
  --bg: #0a0a10;
  --bg-alt: #0f0f18;
  --surface: #151520;
  --border: #1e1e2e;
  --text: #d4d4e0;
  --text-bright: #f0f0f8;
  --text-dim: #6e6e82;
  --purple: #9b7aed;
  --purple-light: #b89cff;
  --purple-deep: #7c5cc7;
  --purple-glow: rgba(155, 122, 237, 0.12);
  --purple-glow-strong: rgba(155, 122, 237, 0.25);
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  --mono: 'IBM Plex Mono', 'Consolas', monospace;
  --radius: 10px;
  --max-w: 1080px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

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

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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: 200px;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--purple); color: #fff; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }
.purple { color: var(--purple); }

/* ---- Nav ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 16, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 32px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--sans); font-size: 1.1rem; font-weight: 700;
  color: var(--text-bright); letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-size: 0.85rem; color: var(--text-dim); transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text-bright); }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; flex-direction: column; gap: 5px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transition: 0.3s;
}

/* ---- Hero (Homepage) ---- */
.hero {
  position: relative; padding: 140px 0 80px; overflow: hidden;
}
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 30% 10%, var(--purple-glow) 0%, transparent 70%),
    radial-gradient(ellipse 30% 40% at 70% 30%, rgba(155, 122, 237, 0.05) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content {
  position: relative; max-width: 640px;
}
.hero-content h1 {
  font-size: clamp(2.4rem, 5vw, 3.5rem); font-weight: 700;
  color: var(--text-bright); letter-spacing: -0.03em;
  line-height: 1.1; margin-bottom: 20px;
}
.hero-sub {
  font-size: 1.1rem; line-height: 1.75; color: var(--text);
  max-width: 520px; margin-bottom: 32px;
}
.hero-role {
  font-family: var(--mono); font-size: 0.88rem;
  color: var(--purple); margin-bottom: 20px;
}
.hero-cta { display: flex; gap: 14px; }
.hero-numbers {
  display: flex; gap: 40px; margin-top: 48px;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.num-value {
  display: block; font-family: var(--mono); font-size: 1.8rem;
  font-weight: 700; color: var(--purple-light); letter-spacing: -0.02em;
}
.num-label {
  font-size: 0.78rem; color: var(--text-dim); margin-top: 2px;
}

/* About page hero */
.about-hero-section { padding-bottom: 60px; }
.about-hero-layout {
  display: flex; gap: 40px; align-items: center; position: relative;
}
.hero-photo { flex-shrink: 0; }
.hero-photo img {
  width: 160px; height: 200px; object-fit: cover; object-position: top;
  border-radius: 10px; border: 2px solid var(--border);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; padding: 12px 28px;
  border-radius: 8px; font-size: 0.9rem; font-weight: 500;
  cursor: pointer; border: none; transition: 0.25s;
}
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover {
  background: var(--purple-light);
  box-shadow: 0 0 20px var(--purple-glow-strong);
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--purple-deep); color: var(--purple-light);
}

/* ---- Sections ---- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-heading {
  font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700;
  color: var(--text-bright); letter-spacing: -0.02em; margin-bottom: 40px;
}

/* ---- Services ---- */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  transition: 0.25s; position: relative;
}
.service-card:hover {
  border-color: var(--purple-deep); transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.service-icon { color: var(--purple); margin-bottom: 20px; }
.service-card h3 {
  font-size: 1.2rem; font-weight: 600; color: var(--text-bright);
  margin-bottom: 12px;
}
.service-card > p {
  font-size: 0.9rem; color: var(--text); line-height: 1.7;
  margin-bottom: 16px;
}
.service-card ul {
  list-style: none;
}
.service-card ul li {
  position: relative; padding-left: 18px;
  font-size: 0.82rem; color: var(--text-dim); margin-bottom: 5px;
}
.service-card ul li::before {
  content: '>'; position: absolute; left: 0;
  color: var(--purple); font-family: var(--mono); font-weight: 700;
}

/* ---- Work ---- */
.work-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.work-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; transition: 0.25s;
}
.work-card:hover {
  border-color: var(--purple-deep); transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.work-card.featured {
  grid-column: 1 / -1; border-color: var(--purple-deep);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(155,122,237,0.03) 100%);
}
.work-top {
  display: flex; align-items: center; justify-content: flex-end; margin-bottom: 14px;
}
.work-tags { display: flex; gap: 6px; }
.work-tags span {
  font-family: var(--mono); font-size: 0.68rem; color: var(--purple);
  background: var(--purple-glow); border: 1px solid rgba(155,122,237,0.18);
  padding: 3px 9px; border-radius: 100px;
}
.work-card h3 {
  font-size: 1.35rem; font-weight: 600; color: var(--text-bright); margin-bottom: 4px;
}
.work-card h3 a {
  text-decoration: underline; text-decoration-color: var(--purple);
  text-underline-offset: 3px; text-decoration-thickness: 2px;
}
.work-card h3 a:hover { text-decoration-color: var(--purple-light); }
.work-sub {
  font-family: var(--serif); font-style: italic;
  color: var(--purple); font-size: 0.92rem; margin-bottom: 14px;
}
.work-card > p {
  color: var(--text); font-size: 0.92rem; line-height: 1.7; margin-bottom: 14px;
}
.work-tech {
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim);
  padding-top: 14px; border-top: 1px solid var(--border);
}

/* ---- Tech Grid ---- */
.tech-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.tech-group {
  padding-left: 16px; border-left: 2px solid var(--purple-deep);
}
.tech-group h4 {
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--purple); margin-bottom: 8px;
}
.tech-group p {
  font-size: 0.85rem; color: var(--text-dim); line-height: 1.6;
}

/* ---- About page grid ---- */
.about-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: start;
}
.about-text h3 {
  font-size: 1.5rem; font-weight: 700; color: var(--text-bright);
  margin-bottom: 20px; line-height: 1.2;
}
.about-text p {
  color: var(--text); line-height: 1.75; margin-bottom: 14px;
}
.about-skills-column {}
.skill-group {
  margin-bottom: 20px; padding-left: 16px;
  border-left: 2px solid var(--purple-deep);
}
.skill-group h4 {
  font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--purple); margin-bottom: 6px;
}
.skill-group p {
  font-size: 0.9rem; color: var(--text-dim); line-height: 1.6;
}

/* ---- Story ---- */
.story-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 24px; margin-bottom: 48px;
}
.story-block {
  padding-top: 16px; border-top: 2px solid var(--border);
  transition: border-color 0.3s;
}
.story-block:hover { border-top-color: var(--purple); }
.story-year {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 500;
  color: var(--purple); margin-bottom: 10px;
}
.story-block p { font-size: 0.9rem; color: var(--text); line-height: 1.65; }

/* ---- Credentials ---- */
.credentials {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
  margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--border);
}
.credential {
  display: flex; flex-direction: column; gap: 4px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.credential-type {
  font-family: var(--mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--purple);
}
.credential-name { font-size: 1rem; font-weight: 600; color: var(--text-bright); }
.credential-detail { font-size: 0.85rem; color: var(--text-dim); }

/* ---- Contact ---- */
.contact-intro {
  font-size: 1.05rem; color: var(--text); max-width: 540px; margin-bottom: 32px;
}
.contact-links { display: flex; flex-direction: column; }
.contact-links a {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--border); transition: 0.2s;
}
.contact-links a:first-child { border-top: 1px solid var(--border); }
.contact-links a:hover { padding-left: 10px; }
.contact-links a:hover .contact-label { color: var(--purple-light); }
.contact-label {
  font-weight: 600; font-size: 1.1rem; color: var(--text-bright);
  min-width: 100px; transition: color 0.2s;
}
.contact-handle {
  font-family: var(--mono); font-size: 0.82rem; color: var(--text-dim);
}
.contact-links .arrow { margin-left: auto; color: var(--text-dim); font-size: 1rem; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer-logo { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; color: var(--text-bright); }
.footer-copy { font-size: 0.78rem; color: var(--text-dim); }

/* ---- Animations ---- */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card.featured { grid-column: auto; }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .story-grid { grid-template-columns: repeat(2, 1fr); }
  .credentials { grid-template-columns: 1fr; }
  .hero-numbers { flex-wrap: wrap; gap: 24px; }
  .about-hero-layout { flex-direction: column; gap: 24px; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .nav-links {
    position: fixed; top: 60px; left: 0; right: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 20px 24px; gap: 16px;
    transform: translateY(-110%); opacity: 0; transition: 0.3s;
    z-index: 99;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; }
  .nav-links a { font-size: 1rem; color: var(--text); }
  .nav-toggle { display: flex; }
  .hero { padding: 110px 0 48px; }
  .hero-content h1 { font-size: 2rem; }
  .hero-numbers {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
  }
  .hero-cta { flex-direction: column; }
  .btn { justify-content: center; }
  .story-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .nav-inner { padding: 0 20px; }
  .hero-photo img { width: 120px; height: 150px; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}
