/* ---------- Theme variables ---------- */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --chip-bg: #f1f1f1;
  --chip-border: #dddddd;
  --link-hover: #0a7d6b;
  --card-border: #cccccc;
}

[data-theme="dark"] {
  --bg: #141414;
  --text: #eeeeee;
  --muted: #9a9a9a;
  --nav-bg: rgba(20, 20, 20, 0.85);
  --chip-bg: #1d1d1d;
  --chip-border: #2c2c2c;
  --link-hover: #7fffd4;
  --card-border: #333333;
}

/* ---------- Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 80px;
}

body {
  font-family: "Times New Roman", Times, serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
}

h1 {
  font-size: 44px;
  color: var(--text);
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* ---------- Navbar ---------- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  transition: background 0.3s;
}

.sidebar h1 {
  font-size: 30px;
  margin: 0;
}

.navbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.navbar a {
  font-family: sans-serif;
  color: var(--text);
  font-size: 18px;
  text-decoration: none;
  padding: 10px 12px;
}

.navbar a:hover {
  color: var(--link-hover);
}

#theme-toggle {
  background: none;
  border: 1px solid var(--chip-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  margin-left: 10px;
}

/* ---------- Hero ---------- */
.about-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  padding: 120px 8% 40px;
}

.text {
  flex: 1;
  min-width: 280px;
  color: var(--text);
}

.text h1 {
  justify-content: flex-start;
  font-size: 48px;
  font-family: "Times New Roman", Times, serif;
  padding: 10px 0;
}

.text h3 {
  font-size: 22px;
  padding: 10px 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.image .imag {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 50%;
}

/* ---------- About ---------- */
.about h1 {
}

.img {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 40px;
  padding: 40px 8%;
}

.img img {
  width: 100%;
  max-width: 350px;
  height: auto;
}

.img p {
  flex: 1;
  min-width: 280px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.6;
}

/* ---------- Education ---------- */
.education {
  padding: 20px 8%;
}

.education h1 {
}

.section-sub {
  text-align: center;
  color: var(--muted);
  margin: 8px 0 30px;
  font-size: 20px;
}

.edu-card {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 12px;
}

.edu-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.edu-head h3 {
  font-size: 26px;
}

.edu-date {
  color: var(--muted);
  font-size: 18px;
}

.edu-school {
  margin: 6px 0 14px;
  font-size: 20px;
  font-weight: 500;
}

.edu-desc {
  line-height: 1.6;
  font-size: 20px;
}

.edu-card .chips span {
  background: var(--bg);
}

.edu-list {
  padding-left: 22px;
}

.edu-list li {
  font-size: 20px;
  line-height: 1.7;
}

/* ---------- Skills ---------- */
.skill {
  padding: 20px 8%;
}

.skill h1 {
  margin-bottom: 10px;
}

.skill-title {
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 28px 0 12px;
  font-weight: 500;
  font-size: 20px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill .chips {
  justify-content: center;
}

.skill .skill-title {
  text-align: center;
}

.chips span {
  padding: 12px 22px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 8px;
  transition: transform 0.2s;
  font-size: 20px;
}

.chips span:hover {
  transform: translateY(-2px);
}

/* ---------- Projects ---------- */
.pro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  text-align: center;
  margin-top: 20px;
}

.pro a {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  font-size: 20px;
  text-decoration: none;
}

.pro h3 {
  font-size: 20px;
  font-weight: 500;
}

.box {
  display: block;
  width: 250px;
  height: 250px;
  object-fit: cover;
  background-color: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  margin: 20px auto;
  transition: transform 0.3s;
}

.box:hover {
  transform: scale(0.92);
}

/* ---------- Contact ---------- */
.contact p {
  color: var(--text);
  font-size: 20px;
  display: flex;
  justify-content: center;
  margin: 10px;
}

.con {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.con a {
  color: var(--text);
  font-size: 28px;
  transition: transform 0.3s, color 0.3s;
}

.con a:hover {
  transform: scale(1.2);
  color: var(--muted);
}

/* ---------- Footer ---------- */
.foot {
  text-align: center;
  font-size: 18px;
  text-transform: capitalize;
  color: var(--muted);
  padding: 30px;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  nav {
    justify-content: center;
  }

  .navbar a {
    font-size: 16px;
    padding: 8px;
  }

  .about-content {
    padding-top: 150px;
    text-align: center;
  }

  .text h1 {
    justify-content: center;
    font-size: 36px;
  }

  .text h3 {
    font-size: 22px;
  }

  h1 {
    font-size: 34px;
  }

  .text h1 {
    font-size: 36px;
  }

  .chips span {
    font-size: 18px;
    padding: 10px 16px;
  }
}

/* ---------- Resume button ---------- */
.btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  border: 1px solid var(--text);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  transition: background 0.3s, color 0.3s;
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
}

.text .btn { margin-right: 10px; }

/* ---------- Tagline, about text, coffee button ---------- */
.text h3.tagline {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 520px;
}

.about-text {
  flex: 1;
  min-width: 280px;
}

.about-text p {
  margin-bottom: 16px;
}

.btn.coffee {
  background: #ffdd00;
  border-color: #ffdd00;
  color: #000000;
}

.btn.coffee:hover {
  background: #e6c700;
  border-color: #e6c700;
  color: #000000;
}

.text .btn {
  margin-bottom: 10px;
}

/* ---------- Support page ---------- */
.support-page {
  --page-bg: #f6f6f8;
  --card-bg: #ffffff;
  --field-bg: #efefef;
  --accent: #5b7cfa;
  --accent-soft: #f5f6ff;
  background: var(--page-bg);
}

[data-theme="dark"] .support-page {
  --page-bg: #101010;
  --card-bg: #1b1b1b;
  --field-bg: #262626;
  --accent: #7b95ff;
  --accent-soft: #1f2233;
}

.support-page nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--chip-border);
}

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 24px;
  font-weight: bold;
}

.profile img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.support {
  max-width: 1000px;
  margin: 0 auto;
  padding: 110px 20px 50px;
}

.support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.support .card {
  background: var(--card-bg);
  border-radius: 28px;
  padding: 32px;
}

.support .card h2 {
  font-size: 30px;
  margin-bottom: 20px;
  display: block;
}

.support .card h2.small {
  font-size: 22px;
  margin: 0 0 16px;
}

.about-line {
  font-size: 20px;
  line-height: 1.6;
}

.social {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  font-size: 26px;
}

.social a {
  color: var(--muted);
  transition: color 0.3s;
}

.social a:hover {
  color: var(--text);
}

.support hr {
  border: 0;
  border-top: 1px solid var(--chip-border);
  margin: 28px 0;
}

.supporters {
  background: var(--accent-soft);
  border-radius: 18px;
  padding: 50px 20px;
  text-align: center;
  color: var(--accent);
}

.supporters i {
  font-size: 22px;
}

.supporters p {
  font-size: 20px;
  margin-top: 12px;
}

.support .field {
  display: block;
  width: 100%;
  background: var(--field-bg);
  color: var(--text);
  border: 0;
  border-radius: 16px;
  padding: 18px 20px;
  font-size: 20px;
  font-family: inherit;
  margin-bottom: 16px;
  outline: none;
}

.support .field:focus {
  box-shadow: 0 0 0 2px var(--accent);
}

.support textarea.field {
  resize: vertical;
  min-height: 140px;
}

.support .field.amount {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}

.support .field.amount input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 20px;
  font-family: inherit;
}

.dollar {
  font-size: 22px;
  font-weight: bold;
}

.chip-btn {
  background: var(--card-bg);
  color: var(--text);
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 18px;
  cursor: pointer;
}

.monthly {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  margin-bottom: 20px;
  cursor: pointer;
}

.monthly input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.support-btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-size: 22px;
  font-weight: bold;
  padding: 18px;
  border-radius: 40px;
  transition: opacity 0.3s;
}

.support-btn:hover {
  opacity: 0.88;
}

.support .note {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  margin-top: 12px;
}

.currency {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.cur {
  flex: 1;
  background: var(--field-bg);
  color: var(--text);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 12px;
  font-size: 18px;
  font-family: inherit;
  cursor: pointer;
}

.cur.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: bold;
}

@media (max-width: 768px) {
  .support-grid {
    grid-template-columns: 1fr;
  }
  .support {
    padding-top: 100px;
  }
  .profile {
    font-size: 20px;
  }
}

/* ---------- 3D background ---------- */
#bg3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Project cards ---------- */
.project { max-width: 1200px; margin: 0 auto; padding: 0 24px 60px; }
.project .section-sub { text-align: center; margin-bottom: 28px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.proj-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; border: 1px solid var(--card-border); border-radius: 16px; background: var(--chip-bg); transition: transform .2s, border-color .2s, box-shadow .2s; }
.proj-card:hover { transform: translateY(-4px); border-color: var(--link-hover); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.proj-card.soon { border-style: dashed; opacity: .85; }
.pc-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-status, .pc-tag, .pc-tech span { font-family: "Courier New", ui-monospace, monospace; font-size: 14px; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--card-border); }
.pc-status.live { color: var(--link-hover); border-color: var(--link-hover); }
.pc-status.live::before { content: "\25CF  "; font-size: 10px; }
.pc-status.wip { color: #d9a400; border-color: #d9a400; }
.pc-tag { color: #3aa0d8; border-color: #3aa0d8; }
.proj-card h3 { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 20px; font-weight: 700; }
.proj-card p { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--muted); font-size: 16px; line-height: 1.6; }
.pc-tech { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-tech span { color: var(--muted); padding: 3px 10px; font-size: 13px; }
.pc-link { margin-top: auto; padding-top: 6px; font-family: system-ui, sans-serif; font-weight: 600; color: var(--link-hover); text-decoration: none; }
.pc-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; }
.pc-links .pc-link { margin-top: 0; }
.pc-link:hover { text-decoration: underline; }
.pc-link.muted { color: var(--muted); }
@media (max-width: 640px) { .proj-grid { grid-template-columns: 1fr; } }

/* ---------- Section polish (kicker, experience, skills) ---------- */
.kicker { text-align: center; text-transform: uppercase; letter-spacing: .16em; font-size: 13px; color: var(--link-hover); font-family: system-ui, sans-serif; margin-top: 30px; }
.education, .skill { max-width: 1000px; margin: 0 auto; padding: 0 24px 50px; }
.education .section-sub, .skill .section-sub { text-align: center; margin-bottom: 28px; }
.cred-timeline { position: relative; margin-left: 12px; padding-left: 28px; border-left: 2px solid var(--card-border); display: grid; gap: 20px; }
.cred-item { position: relative; }
.cred-dot { position: absolute; left: -37px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--link-hover); box-shadow: 0 0 12px var(--link-hover); }
.cred-card, .skill-card { padding: 22px; border: 1px solid var(--card-border); border-radius: 16px; background: var(--chip-bg); transition: transform .2s, border-color .2s, box-shadow .2s; }
.cred-card:hover, .skill-card:hover { transform: translateY(-3px); border-color: var(--link-hover); box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.cred-card h3, .skill-card h3 { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 20px; margin: 10px 0 4px; }
.cred-card h4 { font-family: system-ui, sans-serif; font-weight: 600; color: var(--link-hover); margin-bottom: 8px; }
.cred-card p { font-family: system-ui, sans-serif; color: var(--muted); line-height: 1.6; }
.cred-sub { font-family: system-ui, sans-serif; margin: 36px 0 14px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.sk-ico { font-size: 28px; }
.skill-card .chips { margin-top: 12px; justify-content: flex-start; }

.skill-card .chips span, .education .chips span { font-size: 15px; padding: 6px 14px; }
.education .chips { justify-content: flex-start; }

/* ---------- v4: dark only, about, certificates, sphere ---------- */
.avail { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--link-hover); border-radius: 999px; color: var(--link-hover); font: 14px system-ui, sans-serif; }
.avail i { width: 8px; height: 8px; border-radius: 50%; background: var(--link-hover); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(1.6); } }
.nav-cta, .btn.work { background: var(--link-hover); color: #0b0b0b !important; border-radius: 999px; font-weight: 700; }
.nav-cta { padding: 8px 18px; text-decoration: none; font-size: 16px; }
.btn.work { border: none; }
.btn.work:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border: 1px solid var(--card-border); color: var(--text); }
.about { max-width: 1100px; margin: 0 auto; padding: 0 24px 50px; }
.about > h1 { margin-bottom: 28px; text-align: center; }
.about-grid { display: grid; grid-template-columns: 260px 1fr; gap: 34px; align-items: start; }
.about-card { text-align: center; padding: 26px; border: 1px solid var(--card-border); border-radius: 18px; background: var(--chip-bg); }
.about-avatar { width: 130px; height: 130px; border-radius: 50%; object-fit: cover; border: 3px solid var(--link-hover); box-shadow: 0 0 30px rgba(127,255,212,.25); margin-bottom: 12px; }
.about-card h3 { font-family: system-ui, sans-serif; font-size: 22px; }
.about-card .role { color: var(--muted); font: 14px system-ui, sans-serif; margin: 4px 0 12px; }
.about-card a { color: var(--link-hover); text-decoration: none; font: 14px system-ui, sans-serif; }
.about-body p { font-size: 19px; line-height: 1.7; margin-bottom: 14px; color: var(--text); }
.about-btns { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.about-btns.center { justify-content: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 22px 0; }
.facts > div { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--chip-bg); }
.facts small { display: block; color: var(--muted); font: 12px system-ui, sans-serif; }
.facts b { font: 600 14px system-ui, sans-serif; }
.core-title { font: 13px system-ui, sans-serif; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; }
.chips.core { justify-content: flex-start; }
.chips.core span { font-size: 15px; padding: 6px 14px; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.cert-card { display: flex; gap: 14px; align-items: center; padding: 18px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--chip-bg); transition: transform .2s, border-color .2s; }
.cert-card:hover { transform: translateY(-3px); border-color: var(--link-hover); }
.cert-ico { font-size: 26px; }
.cert-card h4 { font: 600 16px system-ui, sans-serif; margin-bottom: 2px; }
.cert-card p { color: var(--muted); font: 14px system-ui, sans-serif; }
.count { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--link-hover); color: #0b0b0b; font-size: 13px; }
.hint { text-align: center; color: var(--muted); font: 13px "Courier New", monospace; margin: -14px 0 6px; }
#sphere { position: relative; height: min(62vh, 460px); overflow: hidden; cursor: grab; margin-bottom: 30px; }
#sphere span { position: absolute; left: 50%; top: 50%; padding: 5px 13px; border: 1px solid var(--card-border); border-radius: 999px; background: var(--chip-bg); color: var(--text); font: 600 15px system-ui, sans-serif; white-space: nowrap; will-change: transform; user-select: none; }
.contact h1 { margin-bottom: 8px; text-align: center; }
.contact p { text-align: center; }
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } .nav-cta { display: none; } }