/* ============================================================
   reuben gorlov — stylesheet
   ------------------------------------------------------------
   Sections (Ctrl+F to jump):
     :root              — design tokens (colors, fonts, motion)
     RESET & BASE
     HOME PAGE
     INNER PAGES        — topbar + page shell
     PROJECTS PAGE
     PROJECT DETAIL
     ABOUT PAGE
     CONTACT PAGE
     FOOTER
     ANIMATIONS
     RESPONSIVE
   ============================================================ */


/* =================================================
   DESIGN TOKENS
   ================================================= */
:root {
  --bg-deep:   #0a0a0a;
  --bg-mid:    #15151a;
  --bg-light:  #1f1f25;
  --ink:       #ffffff;
  --ink-dim:   #6b6b75;
  --ink-fade:  #3a3a42;
  --accent:    #e63946;

  --font-display: 'Archivo Black', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}


/* =================================================
   RESET & BASE
   ================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, var(--bg-light) 0%, var(--bg-mid) 35%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }


/* =================================================
   HOME PAGE
   ================================================= */
.home-wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4vh 6vw;
  max-width: 1100px;
  margin: 0 auto;
  gap: 1.5rem;
}

.home-wordmark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  text-align: center;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  align-items: center;
  width: 100%;
  max-width: 720px;
}

.home-nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  padding: 0.85rem 1.25rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.2s var(--ease);
  text-align: center;
}

.nav-btn:hover,
.nav-btn:focus-visible {
  background: var(--ink);
  color: var(--bg-deep);
  outline: none;
}

.nav-btn:active { transform: scale(0.98); }

.channel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.channel-tile {
  aspect-ratio: 1.55 / 1;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.25s var(--ease), transform 0.2s var(--ease);
  padding: 0.6rem;
}

.channel-tile:hover { background: var(--ink); }

.channel-tile .tile-icon {
  width: 70%;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-tile .tile-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: filter 0.25s var(--ease);
}

.channel-tile:hover .tile-icon img {
  filter: invert(1);
}

.home-portrait {
  border: 2px solid var(--ink);
  aspect-ratio: 3 / 4;
  background: var(--bg-light);
  overflow: hidden;
}

.home-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Social row sits directly under the channel tiles in the nav column */
.home-socials {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}


/* =================================================
   INNER PAGES — topbar + page shell
   ================================================= */
.page-wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 2.5rem 6vw 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
}

.topbar-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

.topbar-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  color: var(--ink-dim);
  letter-spacing: -0.01em;
}

.topbar-nav a { transition: color 0.2s var(--ease); padding: 0.25rem 0; }
.topbar-nav a:hover,
.topbar-nav a.active { color: var(--ink); }
.topbar-nav .sep { color: var(--ink-fade); user-select: none; }

.page-content {
  flex: 1;
  padding: 3rem 6vw 5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  text-align: center;
}

.page-title .year { color: var(--ink-fade); }


/* =================================================
   PROJECTS PAGE — 3 columns
   ================================================= */
.channel-section { margin-bottom: 4rem; }
.channel-section:last-child { margin-bottom: 0; }

.channel-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.channel-divider {
  height: 2px;
  background: var(--ink);
  margin-bottom: 1.75rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  border: 2px solid var(--ink);
  padding: 1.1rem 1.1rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
  text-align: left;
  color: var(--ink);
}

.project-card:hover {
  background: var(--ink);
  color: var(--bg-deep);
  transform: translateY(-3px);
}

.project-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-mid));
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
  transition: border-color 0.25s var(--ease);
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-placeholder { opacity: 0.5; }

.project-card:hover .project-thumb { border-color: var(--bg-deep); }

.project-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.project-meta {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-dim);
  font-weight: 500;
  transition: color 0.25s var(--ease);
}

.project-card:hover .project-meta { color: var(--accent); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ink-dim);
  font-family: var(--font-body);
  font-size: 0.95rem;
}


/* =================================================
   PROJECT DETAIL PAGE
   ================================================= */
.video-embed {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255,255,255,0.15);
  background: #000;
  overflow: hidden;
}

.video-embed iframe,
.video-embed video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-meta {
  text-align: center;
  color: var(--ink-dim);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-top: 1.5rem;
  letter-spacing: 0.01em;
}

.video-meta .dot { color: var(--ink-fade); margin: 0 0.5rem; }

.writeup {
  max-width: 760px;
  margin: 3rem auto 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
}

.writeup p { margin-bottom: 1.2rem; }

.writeup p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.2rem;
  float: left;
  line-height: 0.85;
  margin: 0.2rem 0.65rem 0 0;
  letter-spacing: -0.04em;
}

.writeup h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 2rem 0 0.8rem;
  letter-spacing: -0.02em;
}

.correction {
  max-width: 760px;
  margin: 2.5rem auto 0;
  border: 2.5px solid var(--accent);
  background: rgba(230, 57, 70, 0.12);
  padding: 1.25rem 1.5rem;
}

.correction-head {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.correction-head .glyph {
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 900;
}

.correction-body {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.5;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 3.5rem auto 0;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--ink-dim);
  color: var(--ink-dim);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
  width: fit-content;
}

.back-link-wrap { display: flex; justify-content: center; }

.back-link:hover {
  border-color: var(--ink);
  color: var(--ink);
}


/* =================================================
   ABOUT PAGE — text wraps around floated portrait
   ================================================= */
.about-body {
  max-width: 880px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
}

.about-body::after {
  content: '';
  display: block;
  clear: both;
}

.about-body p { margin-bottom: 1.2rem; }

.about-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.2rem;
  float: left;
  line-height: 0.85;
  margin: 0.2rem 0.65rem 0 0;
  letter-spacing: -0.04em;
}

/* Portrait figure (image + caption together) floats right */
.about-portrait-figure {
  float: right;
  width: clamp(180px, 32%, 280px);
  margin: 0.4rem 0 1rem 1.75rem;
  shape-outside: margin-box;
}

.about-portrait-figure img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 2px solid var(--ink);
  display: block;
}

.about-portrait-figure figcaption {
  margin-top: 0.55rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
  text-align: center;
}

.about-portrait-figure figcaption a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s var(--ease);
}

.about-portrait-figure figcaption a:hover {
  color: var(--accent);
}


/* =================================================
   CONTACT PAGE
   ================================================= */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 560px;
  margin: 0 auto;
}

.contact-card {
  border: 2px solid var(--ink);
  padding: 1.25rem 1.5rem 1.4rem;
  text-align: center;
}

.contact-card-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 1rem;
}

.contact-card-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Pills (Instagram, Discord) */
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.contact-pill:hover {
  background: var(--ink);
  color: var(--bg-deep);
  transform: translateY(-2px);
}

.contact-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.contact-pill-icon svg {
  width: 16px;
  height: 16px;
}

/* Big single-link (email, LinkedIn) */
.contact-link {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.2rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
  word-break: break-word;
}

.contact-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.showreel {
  margin-top: 4.5rem;
  text-align: center;
}

.showreel-heading {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.showreel-blurb {
  font-family: var(--font-body);
  color: var(--ink-dim);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}


/* =================================================
   FOOTER
   ================================================= */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 2rem 6vw;
  text-align: center;
  color: var(--ink-dim);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.site-footer .footer-socials {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.social-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  flex-grow: 0;
  box-sizing: border-box;
  border: 1.5px solid var(--ink-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  overflow: hidden;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.social-btn:hover {
  background: var(--ink);
  color: var(--bg-deep);
  border-color: var(--ink);
  transform: translateY(-2px);
}

.social-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Variant: image-based icon (e.g. AOTY logo). Used for socials whose
   icons are PNG/JPG files rather than inline SVG. */
.social-btn-image img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  transition: filter 0.2s var(--ease);
}

.social-btn-image:hover img {
  filter: brightness(0);
}

/* Variant: channel mini-buttons — recolor channel icons to match the
   other social button colors (grey idle → black hover). */
.social-btn-channel img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* Flatten to black, then invert to white, then dim to the
     ink-dim grey. Matches the SVG icons' resting color. */
  filter: brightness(0) invert(1) opacity(0.42);
  transition: filter 0.2s var(--ease);
}

.social-btn-channel:hover img {
  filter: brightness(0);
}

.copyright-line { margin-bottom: 0.25rem; }

.builtby-line {
  font-size: 0.78rem;
  color: var(--ink-fade);
}

.builtby-line a {
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s var(--ease);
}

.builtby-line a:hover { color: var(--ink); }


/* =================================================
   ANIMATIONS
   ================================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.reveal    { animation: fadeIn 0.6s var(--ease) both; }
.reveal-1  { animation-delay: 0.05s; }
.reveal-2  { animation-delay: 0.15s; }
.reveal-3  { animation-delay: 0.25s; }
.reveal-4  { animation-delay: 0.35s; }


/* =================================================
   RESPONSIVE
   ================================================= */
@media (max-width: 960px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .home-grid       { grid-template-columns: 1fr; }
  .home-portrait   { aspect-ratio: 4 / 5; max-width: 360px; margin: 0 auto; }
  .topbar-nav      { font-size: 0.95rem; gap: 0.6rem; flex-wrap: wrap; }
  .topbar          { padding: 1.75rem 5vw 1rem; }
  .page-content    { padding: 2rem 5vw 4rem; }
  .home-wrap       { padding: 3vh 5vw; }
  .nav-btn         { padding: 0.75rem 1rem; }
  .channel-tile    { aspect-ratio: 1.6 / 1; }
  .about-portrait-figure {
    float: none;
    display: block;
    margin: 0 auto 1.5rem;
    width: min(280px, 70%);
  }
}

@media (max-width: 540px) {
  .projects-grid { grid-template-columns: 1fr; }
  .topbar-nav .sep { display: none; }
  .topbar-nav { font-size: 0.85rem; gap: 0.4rem; }
}