/* ============================================================
   Brad Korman — bradkorman.co
   Shared stylesheet for all pages
   Fonts: Special Elite (display), Courier Prime (body)
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Variables --- */
:root {
  --bg:       #f0ebe0;  /* warm paper background */
  --ink:      #2a2620;  /* near-black ink */
  --ink-mid:  #4a4438;  /* mid-tone ink — darker for contrast */
  --ink-faint:#8a8275;  /* faint/muted ink — darker for contrast */
  --rule:     #b8af9d;  /* borders and rules — slightly darker */
}

/* --- Base --- */
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Courier Prime', monospace;
  font-size: 14px;
  line-height: 1.75;
  overflow-x: hidden;
}

/* Paper grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='6' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23paper)' opacity='0.09'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  pointer-events: none;
  z-index: 998;
}

/* Ruled lines removed */

/* --- Page wrapper --- */
.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 52px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

/* --- Header --- */
header {
  padding: 36px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
}

.site-id {
  font-family: 'Special Elite', cursive;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

/* Top nav (interior pages) */
nav.top-nav {
  display: flex;
  gap: 28px;
}

nav.top-nav a {
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s;
}

nav.top-nav a:hover    { color: var(--ink-mid); }
nav.top-nav a.active   { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 1px; }

/* Header tag (homepage) */
.header-tag {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
  text-align: right;
  line-height: 1.6;
}

/* --- Footer --- */
footer {
  padding: 20px 0 32px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--ink); }

/* --- Shared typography --- */
.page-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 40px;
  display: block;
}

.page-title {
  font-family: 'Special Elite', cursive;
  font-size: 48px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* --- Shared components --- */

/* Tags */
.tag {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mid);
  border: 1px solid var(--rule);
  padding: 3px 8px;
  font-family: 'Courier Prime', monospace;
}

/* External link with underline */
.visit-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}

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

/* Page fade-in animation */
@keyframes fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fadein {
  animation: fadein 0.35s ease-out forwards;
}

/* ============================================================
   RESPONSIVE — Mobile styles
   Breakpoint: 768px and below
   ============================================================ */

@media (max-width: 768px) {

  /* --- Page padding --- */
  .page {
    padding: 0 24px;
  }

  /* --- Header --- */
  header {
    padding: 24px 0 16px;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  /* Nav wraps and uses smaller text */
  nav.top-nav {
    gap: 16px;
    flex-wrap: wrap;
  }

  nav.top-nav a {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  /* --- Page title --- */
  .page-title {
    font-size: 36px;
  }

  /* --- Footer --- */
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0 28px;
  }

  .footer-links {
    gap: 16px;
  }
}

/* ============================================================
   RESPONSIVE — Homepage (index.html)
   ============================================================ */

@media (max-width: 768px) {

  /* Stack two columns */
  main.home-main {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 0 60px;
  }

  /* Scale down the big name */
  .headline {
    font-size: clamp(52px, 16vw, 80px);
    margin-bottom: 24px;
  }

  .tagline {
    font-size: 13px;
    max-width: 100%;
  }

  /* Nav list tighter on mobile */
  .nav-list a {
    padding: 16px 0;
  }

  .nav-label {
    font-size: 24px;
  }

  .nav-desc {
    display: none; /* hide side hints on small screens */
  }

  /* Hide stamp on mobile */
  .stamp {
    display: none;
  }
}

/* ============================================================
   RESPONSIVE — About (about.html)
   ============================================================ */

@media (max-width: 768px) {

  /* Stack two columns */
  main.about-main {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 0 60px;
  }

  /* Photo block shorter on mobile */
  .photo-block {
    aspect-ratio: 4 / 3;
    margin-top: 0;
  }

  .bio {
    margin-bottom: 40px;
  }

  /* Hide coffee stain on mobile */
  .stain {
    display: none;
  }
}

/* ============================================================
   RESPONSIVE — Animation (animation.html)
   ============================================================ */

@media (max-width: 768px) {

  main.animation-main {
    padding: 48px 0 60px;
  }

  /* Stack info + video vertically */
  .video-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
  }

  .video-layout > * {
    width: 100%;
    min-width: 0;
  }

  /* Vertical video: cap the height so it doesn't take the whole screen */
  .video-wrap-vertical {
    padding-top: 0;
    height: 480px;
  }

  .project-header {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .project-name {
    font-size: 26px;
  }

  .more-section {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* ============================================================
   RESPONSIVE — Music (music.html)
   ============================================================ */

@media (max-width: 768px) {

  main.music-main {
    padding: 48px 0 60px;
  }

  .content-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-width: 0;
  }

  .content-layout > * {
    min-width: 0;
    width: 100%;
  }

  /* On mobile: Spotify embed (second child) appears first, text second */
  .content-layout > *:first-child { order: 2; }
  .content-layout > *:last-child  { order: 1; }

  .more-section {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

/* ============================================================
   RESPONSIVE — Photo (photo.html)
   ============================================================ */

@media (max-width: 768px) {

  main.photo-main {
    padding: 48px 0 60px;
  }

  .page-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .page-context {
    text-align: left;
  }

  /* 2-column grid on mobile */
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
  }

  /* Wide items still span 2 on mobile (works fine at 2-col) */
  .photo-item.wide {
    grid-column: span 2;
  }

  /* Lightbox nav arrows closer to center on small screens */
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ============================================================
   RESPONSIVE — Video (video.html)
   ============================================================ */

@media (max-width: 768px) {

  main.video-main {
    padding: 48px 0 60px;
  }

  /* Stack video entries, disable the flip alternation */
  .video-entry,
  .video-entry.flip {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 24px;
    padding: 32px 0;
  }

  .video-entry .video-info,
  .video-entry.flip .video-info {
    direction: ltr;
  }

  .video-title {
    font-size: 18px;
  }

  .archive-note {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}
