/* ==========================================================================
   mikemarks.net: shared styles
   ========================================================================== */

/* Self-hosted variable fonts (SIL Open Font License, see assets/fonts/) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-var-latin.woff2") format("woff2-variations"), url("fonts/inter-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-var-latin.woff2") format("woff2-variations"), url("fonts/space-grotesk-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --bg: #06060a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f8;
  --muted: #a3a3b8;
  --faint: #6e6e85;

  --pink: #ff3d8b;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --grad: linear-gradient(100deg, var(--pink) 0%, var(--violet) 48%, var(--cyan) 100%);

  --radius: 22px;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--pink); color: #fff; }

/* ---------- Background: aurora glow, grid and grain ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg .orb {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  opacity: 0.85;
  will-change: transform;
}
.bg .orb-1 {
  top: -38vmax; left: -22vmax;
  background: radial-gradient(closest-side, rgba(255, 61, 139, 0.6), transparent);
  animation: drift-1 26s ease-in-out infinite alternate;
}
.bg .orb-2 {
  top: -30vmax; right: -28vmax;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.65), transparent);
  animation: drift-2 32s ease-in-out infinite alternate;
}
.bg .orb-3 {
  top: 35vh; left: 30vw;
  width: 55vmax; height: 55vmax;
  background: radial-gradient(closest-side, rgba(34, 211, 238, 0.3), transparent);
  animation: drift-3 38s ease-in-out infinite alternate;
}

.bg .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

.bg .grain {
  position: absolute;
  inset: -50%;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift-1 { to { transform: translate(14vw, 10vh) scale(1.1); } }
@keyframes drift-2 { to { transform: translate(-12vw, 14vh) scale(0.95); } }
@keyframes drift-3 { to { transform: translate(-18vw, -8vh) scale(1.15); } }

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

main { flex: 1; }

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  background: rgba(6, 6, 10, 0.6);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 24px -6px rgba(255, 61, 139, 0.6);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-hover); }
.nav-links a[aria-current="page"] { color: var(--text); }

.nav-links a { position: relative; }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  padding: 15px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s, border-color 0.2s;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 160% 100%;
  box-shadow: 0 10px 40px -10px rgba(255, 61, 139, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover {
  background-position: 100% 0;
  box-shadow: 0 14px 50px -10px rgba(139, 92, 246, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-ghost {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-hover); border-color: rgba(255, 255, 255, 0.32); }

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

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(72px, 14vh, 150px) clamp(56px, 9vh, 96px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 7px 14px 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18), 0 0 14px var(--cyan);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 8.5rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
  margin: 0 0 32px;
}

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

.lead {
  max-width: 40rem;
  margin: 0 0 40px;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.6;
}
.lead strong { color: var(--text); font-weight: 600; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Section heading ---------- */

.section { padding-block: 40px 120px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}

.section-head .count {
  font-family: var(--font-display);
  color: var(--faint);
  font-size: 0.95rem;
  white-space: nowrap;
}

/* ---------- Project cards ---------- */

.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

@media (min-width: 780px) {
  .projects { grid-template-columns: 1fr 1fr; }
  .card.featured { grid-column: 1 / -1; }
  .card.featured > a { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; }
  .card.featured .shot { margin: 14px 0 14px 14px; }
  .card.featured .body { padding: 36px 40px; }
  .card.featured h3 { font-size: 2.1rem; }
  .card.featured p { font-size: 1.05rem; }
}

.card {
  --accent: var(--violet);
  --mx: 50%;
  --my: 0%;
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.35s, background 0.3s;
  isolation: isolate;
}

/* Mouse-follow spotlight in the card's accent colour */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(600px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 16%, transparent), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--accent) 55%, transparent);
}
.card:hover::before { opacity: 1; }

.card > a {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: inherit;
}
.card > a:focus-visible { outline-offset: 4px; }

/* Screenshot in a minimal browser frame */
.shot {
  position: relative;
  margin: 12px 12px 0;
  border-radius: 14px;
  overflow: hidden;
  background: #0d0d14;
  border: 1px solid var(--border);
}

.chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
}
.chrome i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.chrome span {
  margin-left: 10px;
  font-size: 0.72rem;
  color: var(--faint);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shot-frame {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.7s var(--ease);
}
.card:hover .shot-frame img { transform: scale(1.035); }

/* Generated cover for projects without a screenshot */
.cover {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(255, 61, 139, 0.35), transparent 50%),
    #0b0912;
}
.cover::before,
.cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 30px;
  background:
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(255, 255, 255, 0.22) 14px 30px, transparent 30px 44px) center / 100% 12px no-repeat,
    rgba(0, 0, 0, 0.55);
}
.cover::before { top: 0; }
.cover::after { bottom: 0; }
.cover span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
  transition: transform 0.7s var(--ease);
}
.card:hover .cover span { transform: scale(1.04); }

.body { padding: 22px 24px 26px; }

.tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 10px;
}

.card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.visit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.visit svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  transition: transform 0.25s var(--ease);
}
.card:hover .visit svg { transform: translate(3px, -3px); }

/* ---------- Call to action band ---------- */

.cta {
  position: relative;
  overflow: hidden;
  margin-bottom: 110px;
  padding: clamp(40px, 7vw, 72px);
  border-radius: 28px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 61, 139, 0.35), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(34, 211, 238, 0.28), transparent 50%),
    rgba(255, 255, 255, 0.03);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0 0 12px;
}
.cta p { margin: 0; color: var(--muted); max-width: 32rem; }

/* ---------- Contact page ---------- */

.contact {
  display: grid;
  gap: 48px;
  padding-block: clamp(64px, 12vh, 130px) 120px;
}
@media (min-width: 900px) {
  .contact { grid-template-columns: 1fr 1.1fr; gap: 72px; align-items: start; }
}

.contact h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0 0 28px;
}

.form-card {
  position: relative;
  padding: clamp(24px, 4vw, 40px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 100px -40px rgba(139, 92, 246, 0.55);
}
.form-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: var(--grad);
  opacity: 0.35;
  filter: blur(28px);
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 13px 15px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }
.field textarea { resize: vertical; min-height: 160px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25);
}

.hp { display: none; }

.form-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.form-card .btn:disabled { opacity: 0.65; cursor: progress; }

.status { margin: 14px 0 0; min-height: 1.5em; font-size: 0.95rem; color: var(--muted); }
.status.error { color: #ff7a9c; }

.thanks { text-align: center; padding: 24px 0; }
.thanks:focus { outline: none; }
.thanks .check {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 12px 40px -8px rgba(255, 61, 139, 0.6);
}
.thanks .check svg { width: 30px; height: 30px; color: #fff; }
.thanks h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.thanks p { margin: 0; color: var(--muted); }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--faint);
  font-size: 0.88rem;
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer nav { display: flex; gap: 20px; }
.footer a { text-decoration: none; color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ---------- Scroll reveal (only when JS is running) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav .wrap { height: 60px; }
  .brand .name { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
