/* Replace top of file with these variables and Codehal-inspired tweaks */
:root {
  --logo-size: 88px;     /* change once to resize logo everywhere */
  --avatar-size: 120px;  /* change once to resize avatar everywhere */
  --nav-height: 44px;
  --nav-gap: 8px;
  --bg: #071025;
  --card: #0b1220;
  --accent: #06b6d4;       /* neon cyan */
  --accent-2: #7c3aed;     /* secondary purple */
  --text: #e6eef8;         /* default text (dark theme) */
  --muted: #94a3b8;
  --glass: rgba(255,255,255,0.04);
  --radius: 12px;
  --max-w: 1000px;
  --transition: 220ms;
  --panel-border: rgba(255,255,255,0.03);
}

/* Global */
* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, var(--bg) 0%, #0b1320 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  padding: 24px;
  display: flex;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

/* brand / codehal feel */
.brand {
  display:flex;
  gap:12px;
  align-items:center;
  font-weight:700;
  color:var(--accent);
  font-size:20px;
}
.brand .brand-title {
  margin-left:10px;
  font-family: "Fira Code", "Courier New", Courier, monospace;
  letter-spacing:0.6px;
  font-size:20px;
  color:var(--accent);
  white-space: nowrap;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

/* logo */
.brand img.logo-img {
  width: var(--logo-size) !important;
  height: var(--logo-size) !important;
  max-width: var(--logo-size) !important;
  max-height: var(--logo-size) !important;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.brand:hover img.logo-img { transform: scale(1.03); }

/* nav links */
.nav { display:flex; gap:8px; align-items:center; flex-wrap: wrap; }
.nav-link {
  min-height: var(--nav-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  box-sizing: border-box;
  border-radius:8px;
  color: var(--text);
  background: transparent;
  transition: all var(--transition) ease;
  border: 1px solid transparent;
  font-weight:600;
  text-decoration:none;
  font-family: "Fira Code", monospace;
  font-size:13px;
}
.nav-link:hover {
  transform: translateY(-3px);
  background: linear-gradient(90deg, rgba(6,182,212,0.06), rgba(124,58,237,0.03));
  border-color: rgba(6,182,212,0.12);
  color: var(--accent);
}

/* hero / panels with a code-panel accent */
.hero {
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(2,6,23,0.6);
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.section {
  margin-top: 20px;
  background: var(--card);
  padding: 18px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
}
h1, h2, h3 {
  font-family: "Fira Code", "Courier New", monospace;
  letter-spacing: 0.6px;
  color: var(--text);
}

/* projects, profile and small UI polish */
.project { padding:12px; background: var(--glass); border-radius:10px; border:1px solid rgba(255,255,255,0.02); cursor:pointer; transition: transform var(--transition) ease, box-shadow var(--transition) ease; }
.project:hover, .project:focus { transform: translateY(-6px); box-shadow: 0 10px 30px rgba(3,10,20,0.6); background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005)); color:var(--text); }
.profile { background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00)); padding:18px; border-radius:10px; border:1px solid var(--panel-border); text-align:center; }

/* avatar spin & waveform */
.avatar.spin { animation: spin 6s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
#waveform { border-radius:8px; display:block; width:100%; height:48px; }

/* audio controls responsive */
.audio-control { width: 100%; max-width: 320px; }

/* focus states */
a:focus, button:focus, .project:focus { outline: 3px solid rgba(6,182,212,0.14); outline-offset: 3px; }

/* --- layout normalization: enforce consistent sizes across all pages --- */
/* container: single source of truth for page width */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px; /* consistent side gutters */
  box-sizing: border-box;
}

/* header / main layout consistent width and spacing */
header {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* keep main content area consistent */
main {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  box-sizing: border-box;
}

/* hero should always fill container and not exceed it */
.hero {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  grid-template-columns: 1fr 320px; /* consistent layout by default */
}

/* if a page explicitly forces a single-column hero, keep the same container width */
.hero[style*="grid-template-columns: 1fr"] {
  grid-template-columns: 1fr;
}

/* normalize section widths so panels match across pages */
.section {
  width: 100%;
  box-sizing: border-box;
}

/* make sure any inline width/height attributes on images are ignored */
img {
  max-width: 100%;
  height: auto !important;
  width: auto !important;
  box-sizing: border-box;
}

/* logo and avatar enforced earlier with variables; ensure nav doesn't grow */
.nav {
  gap: var(--nav-gap);
  align-items: center;
  flex-wrap: nowrap;
}

/* prevent page zoom/shift when logo or avatar changes */
.brand, .profile {
  min-height: calc(var(--logo-size) + 8px);
}

/* small screens keep proportions but still consistent */
@media (max-width: 600px) {
  body { padding: 16px 0; }
  .container { padding: 0 8px; max-width: none; }
  header { padding: 10px 8px; max-width: none; }
  .hero { grid-template-columns: 1fr; }
  :root { --logo-size: 52px; --avatar-size: 88px; }
}

/* tablet adjustments */
@media (max-width: 768px) {
  .container { padding: 0 12px; max-width: none; }
  header { padding: 12px 12px; max-width: none; }
  .hero { grid-template-columns: 1fr; gap: 16px; }
  :root { --logo-size: 70px; --avatar-size: 100px; }
}

/* Light theme: override variables so every element using vars stays legible */
.light-theme {
  --bg: #f7fbff;
  --card: #ffffff;
  --accent: #0b6bff;
  --accent-2: #7c3aed;
  --text: #071024;    /* main text for light theme */
  --muted: #5b6670;
  --glass: rgba(0,0,0,0.03);
  --panel-border: rgba(10,20,40,0.06);
}
.light-theme body { background: linear-gradient(180deg, var(--bg) 0%, #eef3ff 100%); }
.light-theme .nav-link { color: var(--text); }
.light-theme .brand .brand-title { color: var(--accent); }
.light-theme .modal { background: rgba(10,20,40,0.04); }

/* ensure any previously hardcoded body color is replaced */
body, p, li, input, textarea { color: var(--text); }