/* ==========================================================================
   Martiangold
   Colors and type come from the old Squarespace theme.
   Section themes (.theme-*) match the Squarespace section color presets.
   ========================================================================== */

:root {
  --orange: #f48847;
  --slate: #282d30;
  --sand: #e9ceb0;
  --black: #000;
  --white: #fff;

  --font: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 6.4px;
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 400 18px/1.65 var(--font);
  background: var(--black);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--orange);
  color: var(--black);
  padding: 8px 14px;
  border-radius: var(--radius);
  z-index: 100;
}
.skip-link:focus { top: 12px; }

/* ---------- Section themes ---------- */

.section { padding: clamp(56px, 9vw, 120px) 0; }

.theme-black       { background: var(--black); color: var(--white); --heading: var(--white);  --button-bg: var(--orange); --button-fg: var(--black); }
.theme-black-bold  { background: var(--black); color: var(--white); --heading: var(--orange); --button-bg: var(--orange); --button-fg: var(--black); }
.theme-dark-bold   { background: var(--slate); color: var(--orange); --heading: var(--orange); --button-bg: var(--orange); --button-fg: var(--black); }
.theme-light       { background: var(--sand);  color: var(--black); --heading: var(--slate);  --button-bg: var(--orange); --button-fg: var(--black); }

.section h1, .section h2 { color: var(--heading); }

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

.button {
  display: inline-block;
  background: var(--button-bg, var(--orange));
  color: var(--button-fg, var(--black));
  font: 500 0.85rem/1 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1.1em 2em;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.button--outline { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5em; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}
.logo img { width: 190px; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  margin-right: -10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--white);
  margin: 6px 0;
  transition: transform 0.2s, opacity 0.2s;
}

.site-nav ul { display: flex; gap: 36px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  text-decoration: none;
  font-size: 1rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.site-nav a:hover { color: var(--orange); }
.site-nav a[aria-current="page"] { color: var(--orange); border-bottom-color: var(--orange); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--black);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
  }
  .site-header.nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 20px; }
  .site-nav a { display: block; padding: 14px 0; font-size: 1.25rem; border: 0; }
  .site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ---------- Hero (full-bleed image with title) ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(78vh, 760px);
  padding: 0 0 clamp(40px, 7vw, 90px);
  background: var(--slate) center / cover no-repeat;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0) 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--orange); max-width: 14em; margin: 0; }
.hero p { color: var(--white); max-width: 40em; margin-top: 1em; }
.hero--short { min-height: min(56vh, 520px); }

/* ---------- Two-column text + image ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.split--reverse .split-media { order: -1; }
.split-text > :last-child { margin-bottom: 0; }

.intro {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  max-width: 980px;
  margin: 0 auto;
}
.intro img { border-radius: 12px; }
.lead { font-size: 1.25rem; }

@media (max-width: 760px) {
  .split, .intro { grid-template-columns: 1fr; }
  .split--reverse .split-media { order: 0; }
  .intro img { width: 140px; }
}

/* ---------- Page intro (portfolio + gallery pages) ---------- */

.page-intro { max-width: 820px; }
.page-intro .text-links { margin-top: 1.5em; }

/* ---------- Portfolio category cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.card {
  display: block;
  text-decoration: none;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-4px); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.4s; }
.card:hover img { transform: scale(1.04); }
.card h3 { margin: 0; padding: 18px 20px; }
.card:hover h3 { color: var(--orange); }
.card .card-text { padding: 0 20px 20px; margin-top: -6px; color: rgba(255, 255, 255, 0.7); font-size: 1rem; }

/* ---------- Gallery + lightbox ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.gallery a {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
}
.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.35s, filter 0.35s;
}
.gallery--square img { aspect-ratio: 1; }
.gallery a:hover img { transform: scale(1.03); filter: brightness(1.05); }
.gallery a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

@media (max-width: 420px) {
  .gallery { grid-template-columns: 1fr; }
}

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.94);
  color: var(--white);
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lightbox button {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: var(--white);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lightbox button:hover { background: var(--orange); color: var(--black); }
.lightbox .lb-close { top: 16px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 0.9rem; opacity: 0.7; }

/* ---------- Sketchfab embed ---------- */

.embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  margin-top: 2em;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-credit { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); margin-top: 10px; }
.embed-credit a { color: var(--orange); font-weight: 500; text-decoration: none; }

/* ---------- Prev / next pagination ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 48px 0;
}
.pager a { text-decoration: none; display: block; padding: 20px 0; }
.pager a:hover h2 { color: var(--orange); }
.pager .label { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.6; }
.pager h2 { font-size: clamp(1.3rem, 3vw, 2rem); margin: 6px 0 0; transition: color 0.15s; }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- Contact form ---------- */

.form { display: grid; gap: 20px; margin-top: 2em; }
.form label { display: block; font-size: 0.95rem; margin-bottom: 6px; color: var(--white); }
.form .required { color: var(--orange); }
.form input, .form textarea {
  width: 100%;
  font: inherit;
  color: var(--white);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.form textarea { min-height: 160px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244, 136, 71, 0.25); }
.form .button { justify-self: start; }
.form-status { margin: 0; color: var(--white); }
.form-status.error { color: #ff9b9b; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Games ---------- */

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
}
.game-card .screen {
  background: #141413;
  padding: 24px;
  font: 13px/1.5 ui-monospace, Consolas, monospace;
  color: #e6e6e1;
  white-space: pre;
  overflow: hidden;
  text-decoration: none;
}
.game-card .screen .o { color: var(--orange); }
.game-card .screen .y { color: #e5c07b; }
.game-card .screen .b { color: #61afef; }
.game-card .body { padding: clamp(24px, 4vw, 40px); }
.game-card .body p { color: rgba(255, 255, 255, 0.75); }
.game-card:hover h3 { color: var(--orange); }
.game-card h3 a { text-decoration: none; }
@media (max-width: 760px) { .game-card { grid-template-columns: 1fr; } }

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

.site-footer {
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 40px 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 24px; list-style: none; margin: 0; padding: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
