/* ============================================================
   MASTER STYLESHEET
   Layout, components & behaviour — theme-agnostic.
   Every color/font/radius/shadow comes from CSS variables that
   each theme-*.css file defines. Do not hardcode colors here.
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-width: thin;}
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--accent-contrast); }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: var(--bg-decoration, none);
}
body.grid-bg::after {
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: var(--grid-opacity, 0);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 40%, transparent 75%);
}

#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent-gradient, var(--accent)); z-index: 9999;
  transition: width .1s linear;
}

/* ---------- THEME PICKER ---------- */
.theme-picker {
  position: fixed; top: 16px; right: 16px; z-index: 10000;
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.theme-picker select {
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  background: transparent; border: none; outline: none; cursor: pointer;
  padding: 4px 6px;
}
.theme-picker select option { background: var(--surface); color: var(--text); }
.theme-picker .tp-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; padding-left: 4px; }

/* ---------- LAYOUT ---------- */
.app { display: grid; grid-template-columns: 420px 1fr; min-height: 100vh; position: relative; z-index: 1; }

.left {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  padding: 48px 36px; border-right: 1px solid var(--border);
  background: var(--surface-translucent, var(--surface));
  backdrop-filter: blur(12px) saturate(1.2);
}
.left::-webkit-scrollbar { width: 6px; }
.left::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.right { padding: 48px 56px; max-width: 960px; }
section { margin-bottom: 48px; }

.reveal { opacity: 0; transform: translateY(16px); transition: all .6s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- PHOTO ---------- */
.photo-wrap { width: 148px; aspect-ratio: 1; margin-bottom: 24px; }
.photo-wrap::before {
  content: ""; position: absolute; inset: -2px; border-radius: calc(var(--radius) + 2px); padding: 2px;
  background: var(--accent-gradient, var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .85;
}
.photo {
  width: 100%; height: 100%; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); position: relative;
  transform-style: preserve-3d; transition: transform .3s ease;
  border-radius: 50%;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- IDENTITY BLOCK ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .12em; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--accent); }
.name {
  font-family: var(--font-display); font-size: 32px; font-weight: var(--display-weight, 800);
  letter-spacing: var(--display-tracking, -0.02em); line-height: 1.1;
  color: var(--text-strong, var(--text)); margin-bottom: 6px;
}
.name.gradient-text {
  background: var(--accent-gradient, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.role { font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--text-muted); margin-bottom: 16px; min-height: 26px; font-family: var(--font-mono); }
.role .typed::after { content: "_"; animation: blink 1s infinite; color: var(--accent); }
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

.pitch { font-size: 14px; color: var(--text); opacity: .85; line-height: 1.7; margin-bottom: 26px; }
.pitch strong { color: var(--text-strong, var(--text)); font-weight: 600; }

.section-label {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-faint); margin: 24px 0 10px;
}

/* ---------- BUTTONS ---------- */
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--text);
  transition: all .2s ease; overflow: hidden;
}
.btn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--accent-gradient, var(--accent)); color: var(--accent-contrast); border: none; font-weight: 650; }
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-2px) scale(1.02); }

.meta { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-faint); display: flex; justify-content: space-between; }
.status { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success, #22c55e); box-shadow: 0 0 8px var(--success, #22c55e); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ---------- SECTION HEAD ---------- */
.sec-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.sec-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; position: relative; padding-left: 14px; color: var(--text-strong, var(--text)); }
.sec-title::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px; border-radius: 3px; background: var(--accent-gradient, var(--accent)); }
.sec-note { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); padding: 4px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }

/* ---------- CARDS / GRIDS ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all .25s ease; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }

.research-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.research-item { padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: all .2s; }
.research-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.research-item b { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 4px; color: var(--text-strong, var(--text)); }
.research-item span { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter { font-family: var(--font-mono); font-size: 11.5px; padding: 6px 12px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; transition: all .2s; user-select: none; }
.filter.active, .filter:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

.projects { display: grid; gap: 14px; }
.proj { position: relative; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: all .3s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.proj:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.proj-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.proj-title { font-family: var(--font-display); font-size: 16px; font-weight: 650; letter-spacing: -0.01em; color: var(--text-strong, var(--text)); }
.proj-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-family: var(--font-mono); font-size: 11px; padding: 4px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); }
.tag.accent { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.proj-links { margin-top: 10px; font-size: 13px; display: flex; gap: 14px; }
.proj-links a { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; font-weight: 550; }
.proj-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.proj-links a::after { content: "→"; transition: transform .2s; }
.proj-links a:hover::after { transform: translateX(2px); }

.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.skill h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 8px; font-weight: 700; }
.skill p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.skill strong { color: var(--text-strong, var(--text)); font-weight: 600; }

.exp-list { display: grid; gap: 10px; }
.exp-item { padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.exp-item b { color: var(--text-strong, var(--text)); font-size: 13.5px; }
.exp-item span { color: var(--text-muted); font-size: 13px; }

.certs { display: flex; flex-wrap: wrap; gap: 9px; }
.cert { padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted); transition: all .2s; }
.cert:hover { border-color: var(--accent); transform: translateY(-1px); }
.cert b { color: var(--text-strong, var(--text)); font-weight: 600; }
.cert a { color: var(--accent); }
.cert a:hover { text-decoration: underline; }

.blogs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

footer { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12.5px; text-align: center; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr; }
  .left { position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 36px 24px; }
  .right { padding: 32px 20px; }
  .research-grid, .skills-grid { grid-template-columns: 1fr; }
  .blogs-grid { grid-template-columns: 1fr 1fr; }
  .name { font-size: 28px; }
  .role { font-size: 17px; }
  .theme-picker { top: auto; bottom: 12px; right: 12px; }
}
@media (max-width: 640px) {
  .btn-grid { grid-template-columns: 1fr; }
  .blogs-grid { grid-template-columns: 1fr; }
  .exp-item { flex-direction: column; gap: 2px; }
  .right { padding: 24px 16px; }
  .left { padding: 28px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
