/* ---------- Theme tokens ---------- */
:root {
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  --pad: clamp(1.25rem, 3vw, 2.5rem);
  --transition: 300ms ease;
}

html[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #f0f8ff;
  --muted: #8a8f98;
  --dim: #5c6169;
  --accent: #8bb7f0;
  --rule: rgba(240, 248, 255, 0.12);
  --art-bg: #0d0d0d;
  --art-glow: rgba(139, 183, 240, 0.18);
}

html[data-theme="light"] {
  --bg: #f7f7f4;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --dim: #9a9a9a;
  --accent: #4e7ab5;
  --rule: rgba(0, 0, 0, 0.12);
  --art-bg: #efefea;
  --art-glow: rgba(78, 122, 181, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.panel {
  position: relative;
}

.panel--text {
  width: 100%;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  z-index: 2;
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
}

.panel--art {
  width: 100%;
  flex: 1;
  min-height: 45vh;
  background: var(--art-bg);
  overflow: hidden;
  position: relative;
  transition: background var(--transition);
}

#lionCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

@media (min-width: 1024px) {
  .layout {
    flex-direction: row;
  }
  .panel--text {
    width: 50%;
    height: 100vh;
    overflow-y: auto;
  }
  .panel--art {
    width: 50%;
    height: 100vh;
    min-height: 0;
  }
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.theme-toggle:hover {
  background: var(--rule);
}

.theme-toggle .icon {
  position: absolute;
  transition: opacity var(--transition), transform var(--transition);
}

html[data-theme="dark"] .icon--sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
html[data-theme="dark"] .icon--moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}
html[data-theme="light"] .icon--sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}
html[data-theme="light"] .icon--moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ---------- Header ---------- */
.head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.site {
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 400;
  margin: 0 0 clamp(1.5rem, 3vw, 2rem);
  color: var(--fg);
}

.identity {
  margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

.name {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 0.35rem;
}

.role {
  font-size: clamp(0.95rem, 1.7vw, 1.1rem);
  font-weight: 400;
  margin: 0;
  color: var(--fg);
}

.tagline {
  font-size: clamp(0.78rem, 1.3vw, 0.9rem);
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
  max-width: 46ch;
}

/* ---------- Blocks ---------- */
.block {
  margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
}

.block__title {
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0 0 clamp(0.9rem, 1.8vw, 1.25rem);
  color: var(--fg);
}

/* ---------- Experience ---------- */
.exp {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.exp__row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: clamp(0.82rem, 1.4vw, 0.95rem);
}

.exp__org {
  font-weight: 500;
}

.exp__note {
  display: block;
  font-size: 0.78em;
  font-weight: 400;
  color: var(--dim);
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
}

.exp__role {
  color: var(--muted);
}

.exp__date {
  color: var(--dim);
  font-size: 0.92em;
}

@media (min-width: 640px) {
  .exp__row {
    flex-direction: row;
    align-items: baseline;
    gap: 0;
  }
  .exp__org {
    width: 15rem;
    flex-shrink: 0;
  }
  .exp__role {
    flex: 1;
  }
  .exp__date {
    margin-left: 1rem;
    white-space: nowrap;
  }
}

/* ---------- Skills ---------- */
.skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.skills__row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: clamp(0.8rem, 1.35vw, 0.92rem);
}

.skills__label {
  font-weight: 500;
  color: var(--fg);
}

.skills__value {
  color: var(--muted);
}

@media (min-width: 640px) {
  .skills__row {
    flex-direction: row;
    align-items: baseline;
  }
  .skills__label {
    width: 15rem;
    flex-shrink: 0;
  }
  .skills__value {
    flex: 1;
  }
}

/* ---------- Footer links ---------- */
.links {
  margin-top: auto;
  padding-top: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
}

.links a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

@media (min-width: 1024px) {
  .links {
    position: absolute;
    bottom: var(--pad);
    left: var(--pad);
    padding-top: 0;
  }
  .panel--text {
    padding-bottom: 5rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
