/* =========================================================
   Harry Tomasco — Portfolio styles
   Change the variables below to restyle the whole site.
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #081f3a;            /* page background */
  --bg-2: #0b3560;          /* glow at the top of the page */
  --card: #10325a;          /* card / panel color */
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --text-dim: #a9bbd1;
  --accent: #f2b544;        /* buttons, subtitle */
  --on-accent: #1a1408;     /* text on buttons */
  --accent-2: #4fd1c5;      /* tags */
  --radius: 12px;
  --max-width: 1100px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  background: radial-gradient(ellipse 120% 900px at top, var(--bg-2) 0%, var(--bg) 70%) no-repeat var(--bg);
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; }

a { color: var(--accent); }

img { max-width: 100%; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-name {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 5rem 0 3rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0.5rem 0 0;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--accent);
  font-weight: 500;
}
.hero-blurb {
  max-width: 600px;
  margin: 1rem auto 0;
  color: var(--text-dim);
}
.hero-blurb:empty { display: none; }

.hero-media {
  margin: 3rem auto 0;
  max-width: 900px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45),
              0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent);
  background: var(--card);
  aspect-ratio: 16 / 9;
}
.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== FunRug Studio blurb ===== */
.studio-blurb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  max-width: 800px;
  padding-top: 3.5rem;
  padding-bottom: 1rem;
}
.studio-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  flex-shrink: 0;
}
.studio-blurb p { margin: 0 0 0.5rem; color: var(--text-dim); font-size: 1.05rem; }
.studio-blurb .studio-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

/* Plain text link instead of a button */
.text-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}
.text-link:hover { color: var(--accent); border-color: var(--accent); }

/* ===== Section headings ===== */
.section { padding: 3rem 0 4rem; }
.section-title {
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 2rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== Project cards ===== */
.project-grid {
  display: grid;
  gap: 3.5rem;   /* space between project cards */
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1.15fr;   /* text a bit narrower than media */
  gap: 2.5rem;
  align-items: center;                 /* media sits centered next to the text */
  padding: 2.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.project-media {
  display: block;
  order: 2;          /* puts media on the right; delete this line to move it left */
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.project-card:hover .project-media img { transform: scale(1.03); }

.project-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-logo {
  /* Every logo fits inside the same 300 x 150 box, so wide AND tall
     logos come out about the same visual size. */
  width: 300px;
  height: 150px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  align-self: flex-start;
  margin-bottom: 1.25rem;
}
.project-logo.large { width: 360px; height: 180px; }
.project-logo.small { width: 240px; height: 120px; }

/* Keeps pixel art crisp when scaled up */
.pixel-art,
.pixelart { image-rendering: pixelated; }
.project-body h3 { margin: 0 0 1rem; font-size: 1.8rem; }
.project-body p { margin: 0 0 1.25rem; color: var(--text-dim); }

/* Small labels like "Unity" or "Systems Design" */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  list-style: none;
  padding: 0;
}
.tags:empty { display: none; }
.tags li {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 25%, transparent);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

/* Role / Team / Timeframe / Tech — compact vertical list on each card */
.project-facts {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.4;
}
.project-facts li {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 0.5rem;
  padding: 0.15rem 0;
}
.project-facts span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-top: 0.2rem;
}

/* "What I did" bullets under the details list */
.project-role {
  margin: 0 0 2rem;   /* space between the bullets and the buttons */
  padding: 0.9rem 0 0 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-dim);
}
.project-role:empty { display: none; }
.project-role li { margin-bottom: 0.3rem; }
.project-role li::marker { color: var(--accent); }

/* More Info + Steam/itch.io buttons side by side */
.card-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.card-actions .button.secondary { align-self: center; }

/* "with Studio Name · Summer Internship" line under the game name */
.studio-credit {
  margin: -0.5rem 0 1rem !important;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ===== Buttons ===== */
.button {
  display: inline-block;
  align-self: flex-start;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  transition: transform 0.15s, filter 0.15s;
}
.button:hover { transform: translateY(-2px); filter: brightness(1.08); }

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.button.secondary:hover { border-color: var(--accent); }

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }

/* ===== About Me + Contact ===== */
.contact-section {
  text-align: center;
  padding: 2rem 1.5rem 5rem;
}
.contact-section h2 {
  margin: 0 0 0.75rem;
  font-size: 2.2rem;
}
.contact-section p {
  max-width: 680px;
  margin: 0 auto 1rem;
  color: var(--text-dim);
  font-size: 1.1rem;
}
.contact-buttons {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.contact-section .studio-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--text-dim); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* =========================================================
   Project pages
   ========================================================= */
.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
}
.back-link:hover { color: var(--accent); }

.project-header { padding: 1.5rem 0 1rem; }
.project-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  letter-spacing: -0.02em;
}
.project-header .subtitle:empty { display: none; }

/* Role / Engine / Team / Duration row */
.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.meta dt {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.meta dd { margin: 0.25rem 0 0; font-weight: 600; }

.media-main {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  background: var(--card);
}
.media-main img,
.media-main video { width: 100%; display: block; }

/* 16:9 YouTube embed */
.video-embed { position: relative; aspect-ratio: 16 / 9; }
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Two-column layout: writeup on the left, sidebar on the right */
.project-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* writeup left, screenshots right */
  gap: 3rem;
  margin: 3rem 0;
}
.writeup h2 { font-size: 1.5rem; margin: 2.5rem 0 0.75rem; }
.writeup h2:first-child { margin-top: 0; }
.writeup p, .writeup li { color: var(--text-dim); }

.sidebar {
  align-self: start;
  position: sticky;
  top: 88px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.sidebar h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.sidebar .button { display: block; text-align: center; margin-bottom: 0.6rem; }

/* Screenshot / GIF gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.gallery figure { margin: 0; }
.gallery img,
.gallery video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.gallery figcaption {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}
.gallery figcaption:empty { display: none; }

/* "← All Projects" button */
.back-button { margin-top: 2rem; }

/* Logo at the top of a project page — bigger and centered */
.project-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0 2rem;
}
.project-header .project-logo {
  width: 520px;
  height: 230px;
  object-position: center;
  align-self: center;
  margin-bottom: 0.5rem;
}
.project-header h1 { margin-bottom: 0.25rem; }

/* Game summary under the main video */
.project-summary {
  max-width: 760px;
  margin: 2rem auto 0;
  text-align: center;
  font-size: 1.15rem;
  color: var(--text-dim);
}

/* Store button above Overview */
.writeup .button-row { margin: 0 0 2rem; }

/* Screenshots stacked in the right column */
.shots {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.shots figure { margin: 0; }
.shots img,
.shots video {
  width: 100%;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.shots figcaption {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}
.shots figcaption:empty { display: none; }

/* Optional demo reel section */
.demo-reel { margin: 1rem 0 3rem; }
.demo-reel h2 { font-size: 1.5rem; margin: 0 0 1rem; }
.demo-reel .video-embed {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ===== Project page: stats, detail cards ===== */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
}
.stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1.2;
}
.stat span { font-size: 0.85rem; color: var(--text-dim); }

.mini-heading {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.5rem;
}
.writeup ul { padding-left: 1.2rem; }
.writeup li::marker, .detail-card li::marker { color: var(--accent); }

.detail-section { margin: 1rem 0 3.5rem; }
.detail-section h2 { font-size: 1.6rem; margin: 0 0 0.75rem; }
.section-intro { color: var(--text-dim); max-width: 820px; margin: 0 0 1.75rem; }

.section-intro + .detail-list { margin-top: -0.75rem; }
.detail-list {
  max-width: 820px;
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-dim);
}
.detail-list li { margin-bottom: 0.5rem; }
.detail-list li::marker { color: var(--accent); }

.card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.4rem;
}
.card-gif {
  width: calc(100% + 2.8rem);
  max-width: none;   /* lets the GIF reach the card edges */
  margin: -1.25rem -1.4rem 1.1rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: var(--radius) var(--radius) 0 0;
}
.detail-card h3 { margin: 0 0 0.6rem; font-size: 1.25rem; }
.detail-card ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.detail-card li { margin-bottom: 0.35rem; }

.card-tag {
  display: inline-block;
  margin: -0.25rem 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}
.pcr { margin: 0; font-size: 0.92rem; }
.pcr dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin-top: 0.8rem;
}
.pcr dt:first-child { margin-top: 0; }
.pcr dd { margin: 0.15rem 0 0; color: var(--text-dim); }

/* Two cards per row instead of three */
.card-row.two { grid-template-columns: 1fr 1fr; }
.card-lead { margin: 0 0 0.9rem; font-size: 0.92rem; color: var(--text-dim); }
.pcr dd ul { margin-top: 0.25rem; }

/* Section heading with a button beside it */
.heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
}
.heading-row h2 { margin: 0; }

/* Stats row limited to the text width */
.stats.narrow { max-width: 820px; }
.detail-list + .sound-clip { margin-top: 1.5rem; }

/* Four stats in one row */
.stats.wide { grid-template-columns: repeat(4, 1fr); }

/* Document / chart / before-after images with a caption above */
.doc-figure { margin: 1.75rem 0; max-width: 820px; }
.doc-figure figcaption { color: var(--text-dim); margin-bottom: 0.6rem; }
.doc-figure img {
  width: 100%;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.doc-figure.small { max-width: 400px; }
/* Text on the left, document on the right */
.split {
  display: grid;
  grid-template-columns: 1fr 360px;   /* width of the document */
  gap: 2.5rem;
  align-items: start;
}
.split .doc-figure { margin: 0; max-width: none; }
.split .doc-figure figcaption {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
}
.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.before-after:empty { display: none; }
.before-after .doc-figure { margin: 1.5rem 0 0; max-width: none; }
.before-after figcaption {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
/* Equal-width columns that never stretch to fit their content */
.before-after { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Same-size 16:9 box for images and videos */
.before-after img,
.before-after video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--card);
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.detail-section .mini-heading { margin-top: 1.75rem; }
.section-intro + .mini-heading { margin-top: -0.5rem; }

/* Video clip with sound and play controls */
.sound-clip {
  width: 100%;
  max-width: 820px;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.detail-card .card-lead:last-child { margin-bottom: 0; }

/* Next project link at the bottom */
.next-project {
  display: block;
  text-align: right;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-dim);
}
.next-project strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--text);
}
.next-project:hover strong { color: var(--accent); }

/* ===== Mobile ===== */
@media (max-width: 1000px) and (min-width: 801px) {
  .card-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  .project-card { grid-template-columns: 1fr; }
  .project-media { order: 0; }
  .project-card { padding: 1.5rem; gap: 1.5rem; }
  .project-logo { width: 240px; height: 120px; }
  .project-header .project-logo { width: 100%; height: 160px; }
  .card-row, .card-row.two { grid-template-columns: 1fr; }
  .stats.wide, .before-after { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .project-grid { gap: 2.5rem; }
  .project-layout { grid-template-columns: 1fr; gap: 2rem; }
  .sidebar { position: static; }
  .nav-links { gap: 1rem; }
  .hero { padding-top: 3rem; }
  .studio-blurb { flex-direction: column; text-align: center; gap: 1rem; }
}