/* =========================
   ROOT VARIABLES
========================= */

:root {
  --bg: #0b0c14;
  --text: #eaeaf0;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.274);
  --accent: #0e96f0;
  --teal: #08566e;
  --skill-label: #eaeaf0;
}

[data-theme="light"] {
  --bg: #f5f6fb;
  --text: #111;
  --card: rgba(0, 0, 0, 0.05);
  --border: rgba(0, 0, 0, 0.288);
  --teal: #08566e;
  --skill-label: #111;
}

/* =========================
   GLOBAL
========================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: "Open Sans", sans-serif;
  font-size: 17px;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

ul {
  list-style: none;
}

/* =========================
   STARFIELD
========================= */

.stars {
  position: fixed;
  width: 100%;
  height: 100%;
  background: url("https://www.transparenttextures.com/patterns/stardust.png");
  animation: moveStars 60s linear infinite;
  z-index: -1;
}

@keyframes moveStars {
  from { background-position: 0 0; }
  to   { background-position: 1000px 1000px; }
}

/* =========================
   GLASS EFFECT
========================= */

.glass {
  backdrop-filter: blur(14px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

/* =========================
   TOPBAR
========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  padding: 0 20px;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 20, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: 0.3s ease;
}

[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* =========================
   THEME BUTTON
========================= */

#themeBtn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.3s;
}

#themeBtn span {
  font-size: 20px;
  color: #eaeaf0;
}

[data-theme="light"] #themeBtn span {
  color: #111;
}

/* =========================
   MAIN LAYOUT
========================= */

.layout {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex: 0 1 auto;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  padding: 100px 60px;
}

.content {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1100px;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  width: 360px;
  min-width: 0;
  flex-shrink: 0;
}

/* =========================
   AVATAR
========================= */

.avatar {
  width: 260px;
  height: 260px;
  display: block;
  margin: 0 auto 20px;
  border-radius: 50%;
  object-fit: cover;
}

/* =========================
   ABOUT CARD
========================= */

.about-card {
  margin-top: 20px;
  padding: 24px;
  border-radius: 16px;
}

.about-card h3 {
  font-size: 1.2rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.about-card p {
  padding: 12px 0;
  border-bottom: 2px solid var(--border);
}

.about-list {
  margin-top: 14px;
  padding: 0;
}

.about-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 0.95rem;
  color: var(--text);
}

.about-list li span {
  width: 22px;
  display: flex;
  justify-content: center;
  font-size: 18px;
}

/* ICON COLORS */

.about-list li:nth-child(1) span { color: #ff4d6d; }
.about-list li:nth-child(2) span { color: #ff914d; }
.about-list li:nth-child(3) span { color: #4dabf7; }

/* =========================
   HERO
========================= */

.hero-text {
  margin-top: 0;
}

.subtitle {
  color: var(--teal);
}

.hero-text h1 {
  margin: 6px;
  font-size: clamp(1.8rem, 5vw, 3rem);
}

.hero-text p {
  margin-top: 25px;
  font-size: 1.05rem;
}

/* =========================
   EMAIL BUTTON
========================= */

.email-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 6px 12px;
  font-size: 0.9rem;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}

.email-btn span {
  font-size: 18px;
}

/* =========================
   TABS
========================= */

.tabs {
  position: relative;
  display: flex;
  gap: 0;
  margin-top: 50px;
  border-bottom: 2px solid var(--border);
  overflow: hidden;
}

.tab {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
}

.tab-name {
  font-size: 16px;
}

.tab.active {
  color: var(--text);
}

.indicator {
  position: absolute;
  bottom: 0;
  height: 3px;
  background: #08566e;
  transition: 0.3s;
}

[data-theme="light"] .tab {
  color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .tab.active {
  color: #111;
}

/* =========================
   TAB CONTENT
========================= */

.tabs-body {
  position: relative;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.35s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================
   PROJECT GRID
========================= */

.grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-top: 8px;
  align-items: start;
}

.grid {
  margin-bottom: 20px;
}

.second-project-row {
  margin-top: 28px;
}

.project-header {
  margin-bottom: 0;
}

/* =========================
   PROJECT CARD
========================= */

.card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  overflow: hidden;
  border-radius: 16px;
  transition: 0.3s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.card-info {
  padding: 18px;
}

.card-info span {
  font-size: 0.8rem;
  opacity: 0.7;
}

.card-info h4 {
  margin-top: 6px;
  font-size: 1.1rem;
}

/* =========================
   CONTACT FORM
========================= */

#contact {
  padding-top: 30px;
}

@media (min-width: 901px) {
  #contact.active {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
  }

  #contact .zinn-list {
    flex: 1 1 0;
  }

  #contact .form-box {
    flex: 1 1 0;
    max-width: none;
    margin-top: 0;
  }
}

.zinn-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.zinn-card,
.cert-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 520px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: 0.3s ease;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
}

.zinn-card:hover,
.cert-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.zinn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 145, 77, 0.15);
}

.zinn-icon span {
  font-size: 22px;
  color: #ff914d;
}

.zinn-info {
  flex: 1;
  min-width: 0;
}

.zinn-info span {
  font-size: 0.78rem;
  opacity: 0.6;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.zinn-info h4 {
  margin: 3px 0 0;
  font-size: 1rem;
  overflow-wrap: break-word;
}

.zinn-arrow {
  font-size: 20px;
  opacity: 0.5;
  flex-shrink: 0;
  transition: 0.3s ease;
}

.zinn-card:hover .zinn-arrow,
.cert-card:hover .zinn-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

.form-box {
  width: 100%;
  max-width: 520px;
  margin-top: 30px;
  padding: 28px;
}

.form input,
.form textarea {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: "Open Sans", sans-serif;
  font-size: 0.95rem;
}

textarea {
  height: 120px;
  padding: 16px;
  resize: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.form button {
  padding: 12px 18px;
  background: #08566e;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
}

.form button:hover {
  transform: translateY(-2px);
  opacity: 0.92;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.form button:active {
  transform: scale(0.96);
}

/* =========================
   CERTIFICATE MODAL
========================= */

.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cert-modal.active {
  opacity: 1;
  visibility: visible;
}

.cert-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.cert-modal-content {
  position: relative;
  z-index: 1;
  max-width: min(900px, 100%);
  max-height: 100%;
}

.cert-modal-content img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #fff;
}

.cert-modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cert-modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.cert-modal-close .material-symbols-outlined {
  font-size: 20px;
}

/* =========================
   RESUME
========================= */

.resume {
  margin-top: 30px;
}

.section-title-main {
  margin: 50px 0 15px;
  font-size: 1rem;
  color: var(--teal);
}

.section-title-sub {
  margin: 30px 0 0;
  font-size: 1rem;
  color: var(--skill-label);
}

.resume-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  min-width: 0;
  gap: 60px;
}

.resume-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 20px;
}

.resume-item {
  min-width: 0;
}

.resume-item h4 {
  font-size: 1rem;
  font-weight: 600;
}

.resume-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: #888;
}

.resume-item p {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #aaa;
}

.edu-name {
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.edu-name-sub {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #aaa;
}

/* =========================
   SKILLS
========================= */

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  min-width: 0;
}

.skill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-size: 0.9rem;
}

[data-theme="light"] .skill {
  background: rgba(0, 0, 0, 0.07);
}

.skill-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Astro logo swap */
.astro-light { display: none; }
.astro-dark  { display: block; }

[data-theme="light"] .astro-light { display: block; }
[data-theme="light"] .astro-dark  { display: none; }

/* =========================
   FOOTER
========================= */

footer {
  width: 100%;
  padding: 20px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer p {
  margin: 0 auto;
  opacity: 0.7;
  font-size: 0.9rem;
}

.f2 {
  padding-top: 5px;
}

/* =========================
   RESPONSIVE
========================= */

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {

  .layout {
    flex-direction: column;
    gap: 32px;
    padding: 40px 32px;
  }

  .sidebar {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
  }

  .avatar {
    width: 120px;
    height: 120px;
    margin: 0;
    flex-shrink: 0;
  }

  .about-card {
    margin-top: 0;
    flex: 1;
    min-width: 0;
  }

  .grid,
  .projects-grid,
  .resume-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Mobile (≤600px) ── */
@media (max-width: 600px) {

  .layout {
    display: grid;
    grid-template-areas:
      "pic"
      "hero"
      "about"
      "nav"
      "body";
    gap: 24px;
    padding: 28px 16px;
  }

  .sidebar,
  .content {
    display: contents;
  }

  .avatar {
    grid-area: pic;
    width: 130px;
    height: 130px;
    margin: 0 auto;
  }

  .hero-text {
    grid-area: hero;
  }

  .about-card {
    grid-area: about;
    width: 100%;
    margin-top: 0;
  }

  .tabs {
    grid-area: nav;
    margin-top: 0;
  }

  .tabs-body {
    grid-area: body;
  }

  .hero-text h1 {
    font-size: clamp(1.5rem, 8vw, 2.4rem);
  }

  .tab-name {
    font-size: 14px;
  }

  .form-box {
    padding: 20px 16px;
  }

  .logo {
    font-size: 1.1rem;
  }

  footer {
    padding: 16px;
  }
}

/* ── Small phones (≤400px) ── */
@media (max-width: 400px) {

  .layout {
    padding: 20px 12px;
  }

  .email-btn {
    font-size: 0.78rem;
    word-break: break-all;
  }

  .tab-name {
    font-size: 12px;
  }

  .tab {
    padding: 10px 6px;
  }
}