/* ===== VARIABLES ===== */
:root {
  --bg:          #0f0f0f;
  --bg-card:     #161616;
  --bg-nav:      rgba(15, 15, 15, 0.88);
  --border:      #222222;
  --text:        #e8e8e8;
  --text-muted:  #666666;
  --accent:      #bf5700;
  --accent-h:    #d96020;
  --font:        'DM Sans', sans-serif;
  --max-w:       1080px;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

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

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

nav.scrolled { border-bottom-color: var(--border); }

.brand {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.brand-dot {
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 0;
  position: relative;
  top: 0.05rem;
}

.nav-links { display: flex; gap: 2rem; }

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
}

.hero-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1.1rem;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 400px;
  margin-bottom: 2rem;
}

.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); }

.btn-secondary {
  display: inline-block;
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.btn-secondary:hover { border-color: #444; }

#sphere-canvas {
  width: 100%;
  aspect-ratio: 1;
  max-width: 460px;
  justify-self: center;
}

#sphere-canvas canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===== SECTION BASE ===== */
.section-wrap {
  border-top: 1px solid var(--border);
  padding: 5rem 2rem;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.section-link:hover { color: var(--text); }

/* ===== WORK ===== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.work-card:hover { border-color: #333; transform: translateY(-2px); }

.card-tags {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.card-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.card-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.card-link:hover { color: var(--text); border-color: #555; }

.work-card--muted {
  border-style: dashed;
  opacity: 0.45;
  pointer-events: none;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 4rem;
  align-items: start;
}

.about-bio p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 0.9rem;
}

.about-bio p:last-child { margin-bottom: 0; }

.about-bio .lead {
  font-size: 1.15rem;
  font-weight: 500;
}

.skills-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.skills-box-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.skills-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.skill-tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #1c1c1c;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
}

/* ===== EXPERIENCE ===== */
.exp-list { display: flex; flex-direction: column; }

.exp-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--border);
}

.exp-item:first-child { border-top: 1px solid var(--border); }

.exp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
  margin-top: 0.45rem;
}

.exp-dot.active { background: var(--accent); }

.exp-body { flex: 1; }

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.exp-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.exp-year {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.exp-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.55;
}

/* ===== WRITING ===== */
.writing-list { display: flex; flex-direction: column; }

.writing-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.writing-item:first-child { border-top: 1px solid var(--border); }

.writing-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.2s;
}

.writing-item:hover .writing-title { color: var(--accent); }

.writing-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.writing-item--placeholder {
  opacity: 0.35;
  pointer-events: none;
}

/* ===== CONTACT ===== */
.contact-inner {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.contact-inner h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.contact-inner p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* ===== FOOTER ===== */
.footer-wrap {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links { display: flex; gap: 1.5rem; align-items: center; }

.footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

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

.footer-music {
  font-size: 0.75rem;
  color: #444;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-music:hover { color: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  #hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 7rem 1.25rem 3rem;
    gap: 3rem;
  }

  #sphere-canvas {
    max-width: 260px;
    margin: 0 auto;
  }

  .section-wrap { padding: 3.5rem 1.25rem; }

  nav { padding: 1rem 1.25rem; }

  .nav-links { gap: 1.25rem; }

  .footer-wrap { padding: 1.25rem; }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .nav-links { gap: 1rem; }

  .nav-links a { font-size: 0.8rem; }

  .work-grid { grid-template-columns: 1fr; }

  .exp-header { flex-direction: column; gap: 0.1rem; }

  .writing-item {
    flex-direction: column;
    gap: 0.2rem;
  }
}
