/* ===== Base ===== */
:root {
  --blue: #179ff8;
  --ink: #2f2e2e;
  --black: #000;
  --muted: #8f8f8f;
  --line: #e6e6e6;
  --bg: #fff;
  --max: 980px;
  --radius: 10px;
  --font-display: "Jockey One", sans-serif;
  --font-nav: "Overlock", sans-serif;
  --font-body: "Open Sans", Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }

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

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

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 112px;
  flex-wrap: wrap;
}

.brand { text-decoration: none; color: var(--black); }

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.1;
}

.brand-tagline {
  display: block;
  font-family: var(--font-nav);
  font-size: 18px;
  color: #afafaf;
  letter-spacing: -.5px;
}

.site-nav ul {
  display: flex;
  gap: 8px 36px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a {
  font-family: var(--font-nav);
  font-size: 16px;
  letter-spacing: 1.6px;
  color: var(--black);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.site-nav a:hover { color: var(--blue); }
.site-nav a[aria-current="page"] { color: var(--blue); border-color: var(--blue); }

/* Language switch (flags) */
.site-nav ul { align-items: center; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.site-nav .lang-switch a {
  display: block;
  padding: 0;
  border: 0;
  line-height: 0;
  border-radius: 3px;
  opacity: .4;
  filter: grayscale(.6);
  transition: opacity .2s, filter .2s, transform .2s;
}

.site-nav .lang-switch a:hover { opacity: 1; filter: none; transform: translateY(-1px); }
.site-nav .lang-switch a[aria-current="true"] { opacity: 1; filter: none; }

.lang-switch img {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}

/* ===== Projects ===== */
main { padding: 32px 0 56px; }

.project {
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 130px;
}

.project:last-child { border-bottom: 0; }

.project-head {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 28px;
  align-items: start;
}

.thumb {
  width: 160px;
  max-height: 180px;
  object-fit: contain;
  border-radius: var(--radius);
  justify-self: center;
}

.project-info h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.3;
  color: var(--blue);
}

.genre {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
}

.tagline, .desc p {
  margin: 0 0 8px;
  color: var(--muted);
}

.desc p { text-align: justify; }

.platforms {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.platforms img { width: 24px; height: 24px; }

.event {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
}

.project-extra { align-self: center; text-decoration: none; }
.project-extra img { max-width: 200px; }

.doc-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
}

.doc-link img { width: 42px; }

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 375px);
  gap: 32px;
  margin-top: 36px;
}

.project-body.full { grid-template-columns: 1fr; }

.roles h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 25px;
  color: var(--ink);
}

.roles h4 {
  margin: 18px 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--ink);
}

.roles h3 + h4 { margin-top: 4px; }

.roles ul {
  margin: 0;
  padding-left: 28px;
  color: var(--muted);
}

.roles li { margin: 2px 0; }
.roles li::marker { color: #c4c4c4; }

.gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gallery img, .gallery video, .media-row img {
  width: 100%;
  border-radius: 4px;
  cursor: zoom-in;
  background: #f4f4f4;
}

.gallery video { cursor: auto; }

.media {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 36px;
}

.media > * { flex: 1 1 420px; min-width: 0; max-width: 640px; }

.media-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 28px;
  align-items: start;
}

.media-row video { width: 100%; border-radius: 4px; }

.subproject {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 32px;
  margin-top: 36px;
}

.subproject h4.subtitle {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  color: var(--black);
}

.subproject .roles h3 { font-size: 22px; }

.works {
  margin: 4px 0 8px;
  padding-left: 28px;
  color: var(--muted);
}

/* ===== YouTube (loads on click) ===== */
.yt {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.yt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .85;
  transition: opacity .2s;
}

.yt:hover img { opacity: 1; }

.yt::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 48px;
  border-radius: 12px;
  background: #f00 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 28px no-repeat;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}

.yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt.loaded::after { display: none; }

/* ===== Lightbox ===== */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 94vh;
}

.lightbox::backdrop { background: rgba(0, 0, 0, .85); }

.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: zoom-out;
}

/* ===== Contact ===== */
.contact-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.contact-top a { color: var(--black); text-decoration: none; }
.contact-top a:hover { color: var(--blue); }

.email-link { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.email-link svg { width: 22px; height: 22px; }

.socials { display: flex; align-items: center; gap: 14px; }
.socials svg, .socials img { width: 26px; height: 26px; }

.about {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.about-photo { border-radius: var(--radius); width: 100%; }

.about p { line-height: 1.75; margin-top: 0; }

.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
  font-size: 15px;
}

.skills p { margin: 0 0 6px; }
.skills ul { margin: 0; padding-left: 20px; line-height: 1.8; }

.section-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 38px;
  color: var(--black);
  margin: 72px 0 32px;
}

.education { border-left: 0; }

.edu-item {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  font-size: 15px;
}

.edu-item > div:first-child {
  border-right: 1px solid #333;
  padding: 14px 24px 14px 0;
}

.edu-item > div:last-child { padding: 14px 0; }
.edu-item p { margin: 0 0 4px; }

/* ===== Blog ===== */
.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s;
}

.post-card:hover { box-shadow: 0 4px 20px rgba(0, 0, 0, .1); }
.post-card img { width: 100%; height: 100%; object-fit: cover; }
.post-card .post-card-body { padding: 32px; }

.post-meta { font-size: 13px; color: var(--muted); margin: 0 0 10px; }

.post-card h2, .post h1 {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--black);
  line-height: 1.25;
}

.post-card h2 { font-size: 24px; margin: 0 0 12px; }
.post-card p { margin: 0; }

.post {
  max-width: 740px;
  margin: 0 auto;
  border: 1px solid var(--line);
  padding: 48px 56px;
}

.post h1 { font-size: 34px; margin: 0 0 28px; }
.post p { line-height: 1.7; }
.post img { margin: 28px auto 0; }

.back-link { display: inline-block; margin-bottom: 24px; font-size: 14px; color: var(--black); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  font-size: 13px;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a { color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .site-header { position: static; }
  .site-header .container { min-height: 0; padding-top: 18px; padding-bottom: 14px; }
  .site-nav ul { gap: 8px 24px; }

  .desc p { text-align: left; }
  .project-head { grid-template-columns: 110px 1fr; gap: 18px; }
  .thumb { width: 110px; }
  .project-extra { grid-column: 1 / -1; justify-self: start; }
  .project-body, .subproject, .about, .post-card { grid-template-columns: minmax(0, 1fr); }
  .gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .contact-top { justify-content: flex-start; }
  .about-photo { max-width: 340px; }
  .edu-item { grid-template-columns: 1fr; gap: 0; }
  .edu-item > div:first-child { border-right: 0; padding-bottom: 0; }
  .edu-item { border-left: 2px solid #333; padding-left: 16px; margin-bottom: 12px; }
  .section-title { font-size: 30px; }
  .post { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .project-head { grid-template-columns: 1fr; }
  .thumb { justify-self: start; }
  .project-info h2 { font-size: 26px; }
  .skills { grid-template-columns: 1fr; }
}
