/* =========================================================
   Pixel Homepage — styles
   Theme tokens via CSS custom properties.
   Light is default; [data-theme="dark"] overrides.
   Responsive via intrinsic grids (auto-fit) — no JS needed.
   ========================================================= */

:root {
  --bg:      #e9eaf0;
  --bg2:     #dfe1ea;
  --panel:   #ffffff;
  --head:    #eef0f6;
  --ink:     #1d2330;
  --dim:     #69707f;
  --border:  #1d2330;
  --accent:  #2f8f5b;
  --accent2: #2a6fdb;
  --shadow:  #c9cdd9;
}

[data-theme="dark"] {
  --bg:      #14161c;
  --bg2:     #0f1116;
  --panel:   #1d212a;
  --head:    #262b36;
  --ink:     #e7eaf2;
  --dim:     #9aa2b3;
  --border:  #05070b;
  --accent:  #4fd488;
  --accent2: #5b9dff;
  --shadow:  #000000;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg2) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg2) 1px, transparent 1px);
  background-size: 26px 26px;
}

img { image-rendering: pixelated; }

a { color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--head);
  border-bottom: 3px solid var(--border);
  font-family: 'Silkscreen', monospace;
}
.topbar__left  { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar__right { display: flex; align-items: center; gap: 11px; }

.brand { display: flex; align-items: center; gap: 8px; }
.brand__chip {
  width: 16px; height: 16px;
  background: var(--accent);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow);
}
.brand__name { font-weight: 700; font-size: 13px; letter-spacing: 1px; }

.nav { display: flex; gap: 12px; font-size: 11px; color: var(--dim); }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--ink); }

.clock { font-size: 11px; color: var(--dim); }

.btn {
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow);
  padding: 5px 9px;
}
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn--icon { width: 34px; font-size: 12px; }

/* ---------- Layout grid ---------- */
.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  padding: 22px;
  max-width: 1180px;
  margin: 0 auto;
}
.span-full { grid-column: 1 / -1; }

/* Skills | (education + contact) pair */
.pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  align-items: stretch;
}
.stack { display: flex; flex-direction: column; gap: 22px; }

/* ---------- Window panels ---------- */
.win {
  scroll-margin-top: 64px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 3px solid var(--border);
  box-shadow: 7px 7px 0 var(--shadow);
}
.win__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--head);
  border-bottom: 3px solid var(--border);
  font-family: 'Silkscreen', monospace;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.win__dots { display: flex; gap: 5px; }
.win__dots i {
  width: 11px; height: 11px;
  border: 2px solid var(--border);
}
.win__dots i:nth-child(1) { background: var(--accent); }
.win__dots i:nth-child(2) { background: var(--accent2); }
.win__dots i:nth-child(3) { background: var(--dim); }
.win__title { flex: 1; }
.win__file  { color: var(--dim); font-weight: 400; }
.win__body  { padding: 16px; }

/* ---------- Profile ---------- */
.profile__body {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
  padding: 22px;
}
.avatar {
  flex: none;
  padding: 5px;
  background: var(--head);
  border: 3px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow);
}
.profile__info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 10px; }
.name {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(20px, 4.4vw, 38px);
  line-height: 1.25;
  text-shadow: 3px 3px 0 var(--accent);
}
.role {
  margin: 0;
  font-family: 'Silkscreen', monospace;
  font-size: 13px;
  color: var(--accent2);
}
.meta { display: flex; gap: 10px; flex-wrap: wrap; font-family: 'Silkscreen', monospace; font-size: 11px; }
.meta span {
  padding: 4px 8px;
  background: var(--head);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow);
}
.bio { margin: 4px 0 0; font-size: 14px; line-height: 1.65; max-width: 54ch; }

/* ---------- Media / image slots ---------- */
.media {
  position: relative;
  display: block;
  background: var(--head);
  overflow: hidden;
}
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.is-empty::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  color: var(--dim);
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(127,127,127,.08) 8px 16px),
    var(--head);
}
.avatar .media { width: 118px; height: 118px; }

/* ---------- Skills ---------- */
.skills__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 11px;
}
.skill__head {
  display: flex;
  justify-content: space-between;
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  margin-bottom: 5px;
}
.skill__head .lvl { color: var(--dim); }
.skill__blocks { display: flex; gap: 3px; }
.blk { flex: 1; height: 13px; border: 2px solid var(--border); }
.blk.on { background: var(--accent); }

/* ---------- Education ---------- */
.edu__body { padding: 11px 14px; display: flex; flex-direction: column; gap: 7px; }
.edu {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}
.edu__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.edu__top strong { font-size: 13px; }
.edu__top time { font-family: 'Silkscreen', monospace; font-size: 9px; color: var(--dim); }
.edu__degree { font-size: 12px; color: var(--accent2); }
.edu__note   { font-size: 12px; color: var(--dim); }

/* ---------- Contact ---------- */
.contact { flex: 1; }
.contact__body {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.contact__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  padding: 9px;
  background: var(--head);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
}
.contact__item:hover { box-shadow: 1px 1px 0 var(--shadow); transform: translate(2px, 2px); }
.contact__label { font-family: 'Silkscreen', monospace; font-size: 10px; color: var(--accent2); }
.contact__value { font-size: 12px; word-break: break-all; }

/* ---------- Work ---------- */
.work__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.job {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px;
  background: var(--head);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
}
.job__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.job__top strong { font-size: 15px; }
.job__top time { font-family: 'Silkscreen', monospace; font-size: 10px; color: var(--dim); }
.job__title { font-size: 13px; color: var(--accent2); font-weight: 500; }
.job ul { margin: 4px 0 0; padding-left: 17px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; line-height: 1.5; }

/* ---------- Projects ---------- */
.projects__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--head);
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow);
}
.card__media { aspect-ratio: 16 / 9; border-bottom: 2px solid var(--border); }
.card__media.media { display: block; }
.card__media iframe { width: 100%; height: 100%; border: 0; display: block; }

.ytbtn {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000 center / cover no-repeat;
}
.ytbtn span {
  font-family: 'Silkscreen', monospace;
  font-size: 12px;
  color: #fff;
  background: var(--accent);
  border: 2px solid #000;
  box-shadow: 2px 2px 0 #000;
  padding: 6px 11px;
}

.gh-art {
  aspect-ratio: 16 / 9;
  border-bottom: 2px solid var(--border);
  background: var(--panel);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  font-family: 'Silkscreen', monospace;
}
.gh-art .prompt { font-size: 11px; color: var(--dim); }
.gh-art i { height: 9px; display: block; }
.gh-art i:nth-child(2) { width: 78%; background: var(--accent); }
.gh-art i:nth-child(3) { width: 54%; background: var(--dim); }
.gh-art i:nth-child(4) { width: 66%; background: var(--accent2); }
.gh-art i:nth-child(5) { width: 40%; background: var(--dim); }

.card__body { padding: 13px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__head { display: flex; align-items: center; gap: 7px; }
.badge {
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  color: #fff;
  background: var(--accent2);
  border: 2px solid var(--border);
  padding: 2px 6px;
}
.card__title { font-family: 'Silkscreen', monospace; font-size: 13px; }
.card__desc { margin: 0; font-size: 13px; line-height: 1.55; flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: 'Silkscreen', monospace;
  font-size: 9px;
  color: var(--dim);
  border: 2px solid var(--dim);
  padding: 2px 5px;
}
.gh-link {
  align-self: flex-start;
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow);
  padding: 6px 10px;
}
.gh-link:hover { box-shadow: 1px 1px 0 var(--shadow); transform: translate(1px, 1px); }

/* ---------- Other ---------- */
.other__body { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.other__item { display: flex; gap: 9px; align-items: baseline; font-size: 14px; line-height: 1.5; }
.other__item .tag {
  flex: none;
  color: var(--accent);
  border: 0;
  padding: 0;
  font-size: 11px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 18px;
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  color: var(--dim);
  border-top: 3px solid var(--border);
  background: var(--head);
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .layout { padding: 14px; gap: 16px; }
  .profile__body { padding: 16px; gap: 16px; }
  .nav { display: none; }
}
