/* Muwart — muwart.co.uk
   Tokens and styles ported from the approved design prototype (project-os/README.md). */

:root {
  --bg: #0D0E10;
  --bg-alt: #15171B;
  --panel: #1E2126;
  --text: #F2F3F5;
  --muted: #9AA0A9;
  --faint: #5C626C;
  --meta-text: #C9CED6;
  --hairline: rgba(255, 255, 255, 0.06);
  --focus: #5B7C99;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --grad-border: linear-gradient(135deg, rgba(91,124,153,0.4), rgba(110,100,128,0.35), rgba(200,153,106,0.4));
  --grad-text: linear-gradient(100deg, #8AB6DE, #6BC4BC, #8ACC9E);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ---------- base ---------- */

html { scroll-behavior: smooth; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(91, 124, 153, 0.35); }

img { display: block; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- shared type ---------- */

.eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 7.5vw, 92px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.grad-word {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 9px;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.btn-solid {
  color: var(--bg);
  background: var(--text);
}
.btn-solid:hover {
  box-shadow: 0 0 32px rgba(91, 124, 153, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--btn-bg, var(--bg-alt)), var(--btn-bg, var(--bg-alt))) padding-box,
    var(--grad-border) border-box;
}
.btn-ghost:hover { box-shadow: 0 0 24px rgba(91, 124, 153, 0.3); }

.btn-ghost--nav {
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 8px;
  --btn-bg: #15171B;
}
.btn-ghost--hero { --btn-bg: rgba(21, 23, 27, 0.6); }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav.is-scrolled {
  background: rgba(13, 14, 16, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.14em;
}
.wordmark--footer { font-size: 17px; }

.brand-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.14);
}

.tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 32px);
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}
.nav-link:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@keyframes mwGlowDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -2%, 0) scale(1.05); }
}

.hero-glow {
  position: absolute;
  inset: -20% -10%;
  pointer-events: none;
  opacity: 0.85;
  background: radial-gradient(ellipse 55% 42% at 50% 40%, rgba(91,124,153,0.26), rgba(110,100,128,0.13) 45%, rgba(200,153,106,0.06) 62%, transparent 74%);
  animation: mwGlowDrift 16s ease-in-out infinite;
}

.hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-art [data-layer] { transition: transform 1.4s var(--ease); }

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
  max-width: 960px;
  padding: 140px 24px 100px;
}

.hero-sub {
  margin: 0;
  max-width: 560px;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.7;
  color: var(--muted);
}

.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* ---------- sections ---------- */

.section {
  position: relative;
  scroll-margin-top: 72px;
  background: var(--bg);
  padding: clamp(80px, 10vw, 140px) clamp(24px, 5vw, 64px);
}
.section--alt { background: var(--bg-alt); }
.section--ruled { border-top: 1px solid var(--hairline); }

.section-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}
.section-inner--projects { gap: clamp(48px, 6vw, 80px); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
}

.divider {
  position: relative;
  height: 90px;
  overflow: hidden;
}
.divider--to-alt { background: linear-gradient(180deg, var(--bg), var(--bg-alt)); }
.divider--to-base { background: linear-gradient(180deg, var(--bg-alt), var(--bg)); }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(40px, 5vw, 80px);
  align-items: start;
}

.manifesto {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
}
.manifesto p { margin: 0; }

.stats {
  padding-left: clamp(28px, 4vw, 56px);
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0, rgba(255,255,255,0.08) 1px, transparent 1px, transparent 9px);
  background-size: 36px 100%;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 4vw, 56px);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- projects ---------- */

.project-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #1E2126;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.project-card:hover {
  background:
    linear-gradient(#1E2126, #1E2126) padding-box,
    var(--grad-border) border-box;
  border-color: transparent;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.4);
}

.card-media {
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.card-zoom {
  position: absolute;
  inset: 0;
  transition: transform 1.1s var(--ease);
}
.project-card:hover .card-zoom { transform: scale(1.03); }

.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 22px;
  background: linear-gradient(transparent, rgba(13, 14, 16, 0.88));
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meta-text);
  transition: opacity 0.4s ease, transform 0.4s var(--ease);
  pointer-events: none;
}
/* Metadata strip hides only where hover exists and motion is allowed;
   on touch devices and under reduced motion it stays visible. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card-meta { opacity: 0; transform: translateY(12px); }
  .project-card:hover .card-meta { opacity: 1; transform: translateY(0); }
}

.card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(28px, 4vw, 56px);
}

.card-index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- services ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 28px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  transition: border-color 0.3s ease;
}
.service-card:hover { border-color: rgba(110, 100, 128, 0.35); }

.service-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
}

.service-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- contact ---------- */

.section--contact { overflow: hidden; }

.contact-haze {
  position: absolute;
  inset: -30% -20%;
  pointer-events: none;
  background: radial-gradient(ellipse 45% 40% at 50% 55%, rgba(110,100,128,0.12), rgba(91,124,153,0.06) 50%, transparent 72%);
}

.contact-inner {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.email-link {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 153, 106, 0.4);
  padding-bottom: 3px;
  transition: border-color 0.3s ease;
}
.email-link:hover { border-color: #C8996A; }
.email-link:focus-visible { outline-offset: 4px; }

.contact-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
  text-align: left;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 13px 16px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field textarea { resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }
.field input:focus,
.field textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(91, 124, 153, 0.18);
}

/* Honeypot — visually removed, invisible to people, present for bots. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn-send {
  align-self: flex-start;
  --btn-bg: #1E2126;
}
.btn-send.is-sent {
  border-color: rgba(200, 153, 106, 0.6);
  box-shadow: 0 0 24px rgba(200, 153, 106, 0.2);
}
.btn-send:disabled { cursor: default; opacity: 0.85; }

.form-error {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #C8996A;
}
.form-error a { color: inherit; }

/* ---------- footer ---------- */

.footer {
  position: relative;
  background: var(--bg);
  border-top: 1px solid var(--hairline);
  padding: clamp(56px, 7vw, 90px) clamp(24px, 5vw, 64px) 40px;
  overflow: hidden;
}

.footer-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.footer-inner {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}
.footer-url:hover { color: var(--text); }

.footer-links {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  flex-wrap: wrap;
}

.footer-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

/* ---------- reveals (applied by JS; content is visible without JS) ---------- */

.reveal-pending {
  opacity: 0;
  transform: translateY(18px);
}
.reveal-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

/* ---------- reduced motion ---------- */

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