/* =========================================================
   badtechart site styles
   1. Tokens   2. Base   3. Shared pieces   4. Header/footer
   5. Home     6. Portfolio + blog lists   7. Article pages
   8. Responsive
   Change the tokens first; most visual tweaks live there.
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --bg:        #121212;
  --bg-2:      #181818;
  --text:      #EAE6DF;   /* headings, links */
  --text-2:    #9C978F;   /* body copy */
  --line:      rgba(255,255,255,0.09);
  --btn:       #E8E2D9;
  --btn-text:  #121212;

  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --maxw:   1360px;                         /* content width cap */
  --gutter: clamp(20px, 6vw, 92px);         /* side margin */
  --side:   max(var(--gutter), (100% - var(--maxw)) / 2);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body {
  color: var(--text-2);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { color: var(--text); font-weight: 300; }

.wrap { width: 100%; padding-inline: var(--side); }

/* ---------- 3. Shared pieces ---------- */
.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 18px;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid currentColor;
  transition: opacity .2s;
}
.link:hover { opacity: .7; }
.link::after { content: "\2192"; font-size: 14px; }
.link--plain::after { content: none; }
.link--back::after { content: none; }
.link--back::before { content: "\2190"; font-size: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  padding: 11px 26px;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn::after { content: "\2192"; }

/* Image frame: the gradient shows until a real image loads */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #2a3140 0%, #1b2029 55%, #2d2a33 100%);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
a:hover > .media img, .media:hover img { transform: scale(1.03); }

.play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 36px; height: 36px;
  translate: -50% -50%;
  border-radius: 50%;
  background: rgba(30,30,30,.75);
}
.play::before {
  content: "";
  position: absolute;
  left: 14px; top: 11px;
  border-left: 10px solid #fff;
  border-block: 7px solid transparent;
}

/* Filter tabs (portfolio + blog) */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.tabs button {
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  padding: 0 0 12px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .2s;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--text); }

/* ---------- 4. Header / footer ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.logo {
  font-family: var(--mono);
  font-size: 21px;
  color: var(--text);
  text-decoration: none;
}
.nav { display: flex; gap: 34px; }
.nav a {
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }

.menu { display: none; position: relative; }
.menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.menu summary::-webkit-details-marker { display: none; }
.menu nav {
  position: absolute;
  right: 0; top: 32px;
  display: grid;
  gap: 14px;
  padding: 18px 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  z-index: 10;
}
.menu nav a { color: var(--text); text-decoration: none; font-size: 14px; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 28px;
  font-size: 12px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer a { text-decoration: none; color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

/* ---------- 5. Home ---------- */
.hero {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) minmax(0, 1.69fr);
  border-bottom: 1px solid var(--line);
}
.hero__text {
  grid-column: 2;
  align-self: center;
  padding: 40px clamp(24px, 4vw, 80px) 40px 0;
}
.hero h1 {
  font-size: clamp(36px, 3.3vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 30px;
  text-wrap: balance;
}
.hero__intro {
  font-size: 14.5px;
  line-height: 1.4;
  max-width: 40ch;
  margin: 0 0 32px;
}
.hero__intro strong { color: var(--text); font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 34px; }
.hero__media { grid-column: 3; aspect-ratio: 2.25 / 1; min-height: 100%; }

.home-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px clamp(32px, 5vw, 76px);
  padding-block: 38px 30px;
}
.card__media { aspect-ratio: 2.17 / 1; margin-bottom: 20px; }
.card h3 { font-size: 15.5px; font-weight: 400; margin: 0 0 12px; }
.card h3 a { text-decoration: none; }
.card__text {
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 42ch;
  margin: 0 0 20px;
}
.about__text {
  font-size: 17px;
  line-height: 1.68;
  color: var(--text);
  max-width: 30ch;
  margin: 2px 0 36px;
}
.about__text p { margin: 0 0 24px; }

.home-work { padding-block: 28px 40px; }
.home-work__inner { border-top: 1px solid var(--line); padding-top: 26px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head .label { margin: 0; }
.section-head .link { font-size: 11px; }
.work-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.work-strip .media { aspect-ratio: 4 / 3; }

/* ---------- 6. Portfolio + blog lists ---------- */
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 32px clamp(32px, 5vw, 80px);
  align-items: end;
  padding-block: 56px 40px;
}
.page-head h1 {
  font-size: clamp(32px, 3vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.page-head p { font-size: 14.5px; line-height: 1.5; max-width: 52ch; margin: 0; }

/* ArtStation-style grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 32px 14px;
  padding-bottom: 40px;
}
.tile { text-decoration: none; display: block; }
.tile .media { aspect-ratio: 16 / 10; margin-bottom: 14px; }
.tile__title { color: var(--text); font-size: 14px; font-weight: 400; margin: 0 0 6px; }
.tile__meta {
  font-size: 11.5px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.tile__meta::after { content: "\2192"; color: var(--text); }
.grid [hidden] { display: none; }
.grid__empty { grid-column: 1 / -1; font-size: 14px; }

/* Blog list */
.post-list { list-style: none; margin: 0; padding: 0 0 40px; }
.post-row {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}
.post-row:first-child { padding-top: 0; }
.post-row a { text-decoration: none; }
.post-row .media { aspect-ratio: 16 / 9; }
.post-row h2 { font-size: 20px; font-weight: 400; margin: 6px 0 10px; }
.post-row p { font-size: 13px; line-height: 1.55; max-width: 60ch; margin: 0; }
.meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

/* ---------- 7. Article pages (posts, projects, about) ---------- */
.article { padding-block: 40px; }
.article__head { max-width: 760px; margin-bottom: 32px; }
.article__head h1 {
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 18px 0 16px;
  text-wrap: balance;
}
.article__lead { font-size: 16px; line-height: 1.6; margin: 0 0 18px; }
.article__cover { aspect-ratio: 2.2 / 1; margin-bottom: 40px; }
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin-bottom: 40px;
  background: #000;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.article__layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(0, 1fr);
  gap: 40px clamp(32px, 6vw, 96px);
  align-items: start;
}
.article__aside { position: sticky; top: 32px; }

/* Body text written in Markdown */
.prose { font-size: 16px; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 26px; line-height: 1.25; margin: 48px 0 16px; }
.prose h3 { font-size: 19px; font-weight: 400; margin: 36px 0 12px; }
.prose p, .prose ul, .prose ol { margin: 0 0 20px; }
.prose a { color: var(--text); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.prose strong { color: var(--text); font-weight: 500; }
.prose img { width: 100%; height: auto; margin: 32px 0; background: var(--bg-2); }
.prose blockquote {
  margin: 28px 0;
  padding-left: 20px;
  border-left: 1px solid var(--text-2);
  color: var(--text);
}
.prose code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--bg-2);
  padding: .15em .4em;
}
.prose pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 28px 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* Series box */
.series {
  border: 1px solid var(--line);
  padding: 22px 24px;
  font-size: 13px;
}
.series ol { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.series a { text-decoration: none; }
.series a:hover { color: var(--text); }
.series [aria-current="page"] { color: var(--text); }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding-top: 24px;
}
.pager a { text-decoration: none; display: grid; gap: 6px; max-width: 45%; }
.pager span { color: var(--text); font-size: 14px; }
.pager .next { text-align: right; margin-left: auto; }

.facts { display: grid; gap: 18px; font-size: 13px; }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--text); margin-bottom: 4px; }
.facts dd { margin: 0; }

/* ---------- 8. Responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: var(--side) minmax(0, 1fr); }
  .hero__text { padding-right: var(--side); }
  .hero__media { grid-column: 1 / -1; aspect-ratio: 16 / 9; min-height: 0; }
  .home-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-column: 1 / -1; }
  .about__text { max-width: 46ch; }
  .work-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { grid-template-columns: 1fr; }
  .article__layout { grid-template-columns: 1fr; }
  .article__aside { position: static; }
}

@media (max-width: 640px) {
  .site-header { height: 68px; }
  .logo { font-size: 18px; }
  .site-header > .nav { display: none; }
  .menu { display: block; }
  .hero__text { padding-top: 32px; }
  .home-row { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr; gap: 16px; }
  .page-head { padding-top: 32px; }
  .prose { font-size: 15.5px; }
}
