/* ==========================================================================
   Luca Obwegs – engineering / hexagon theme
   ========================================================================== */
:root {
  --bg: #070b14;
  --bg-2: #0b1220;
  --surface: rgba(13, 21, 38, .78);
  --surface-solid: #0d1526;
  --surface-hi: #13203a;
  --line: rgba(148, 163, 184, .14);
  --line-strong: rgba(56, 189, 248, .4);
  --text: #e6edf7;
  --muted: #8d9bb3;
  --accent: #38bdf8;
  --accent-deep: #0ea5e9;
  --accent-2: #f5a524;
  --ok: #34d399;
  --radius: 14px;
  --header-h: 68px;
  --container: 1160px;
  --hex: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  --chamfer: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 50% -10%, #10213d 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
::selection { background: rgba(56, 189, 248, .35); color: #fff; }

.mono { font-family: var(--font-mono); }
.container { width: 100%; max-width: var(--container); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }

/* Blueprint grid + particles */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(56, 189, 248, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, .045) 1px, transparent 1px),
    linear-gradient(rgba(56, 189, 248, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, .02) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 80%);
}
#particles-js { position: fixed; inset: 0; z-index: 0; }
main, .site-footer { position: relative; z-index: 1; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #001018;
  padding: 8px 12px;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(24px, calc((100% - var(--container)) / 2 + 24px));
  background: rgba(7, 11, 20, .72);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-hex {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 46px;
  clip-path: var(--hex);
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  transition: transform .4s;
}
.brand-hex::before {
  content: "";
  position: absolute;
  width: 36px;
  height: 42px;
  clip-path: var(--hex);
  background: var(--bg);
}
.brand-letter {
  position: relative;
  z-index: 1;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  transition: transform .4s;
}
.brand:hover .brand-hex { transform: rotate(60deg); }
.brand:hover .brand-letter { transform: rotate(-60deg); }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 20px; letter-spacing: .01em; }
.brand:hover { color: #fff; }

.primary-nav > ul { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.primary-nav a {
  position: relative;
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .25s;
}
.primary-nav a:hover { color: var(--text); }
.primary-nav a:hover::after { transform: scaleX(1); }
.primary-nav .nav-cta {
  margin-left: 8px;
  color: var(--bg);
  background: var(--accent);
  clip-path: var(--chamfer);
  padding: 8px 18px;
}
.primary-nav .nav-cta::after { display: none; }
.primary-nav .nav-cta:hover { color: var(--bg); background: #7dd3fc; }

.nav-toggle { display: none; background: none; border: 0; width: 42px; height: 42px; cursor: pointer; padding: 9px; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 5px 0; transition: .25s; }
.nav-toggle span:nth-child(2) { width: 70%; margin-left: auto; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .primary-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(7, 11, 20, .97);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s;
  }
  .primary-nav.open { max-height: 420px; }
  .primary-nav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 20px; }
  .primary-nav a { font-size: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .primary-nav a::after { display: none; }
  .primary-nav .nav-cta { margin: 14px 0 0; text-align: center; border: 0; }
}

/* ---------- Shared building blocks ---------- */
.overline { color: var(--accent); font-size: 13px; letter-spacing: .06em; margin: 0 0 10px; }

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  opacity: .7;
  pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }
.panel-label {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-label::before { content: "\25B8  "; color: var(--accent); }

.chips, .tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chips li, .tags li {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #bae6fd;
  background: rgba(56, 189, 248, .06);
}
.tags li { font-size: 11px; padding: 5px 8px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent-2);
}
.status::before {
  content: "";
  width: 9px;
  height: 10px;
  clip-path: var(--hex);
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.btn, .btn-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #031522;
  border: 0;
  clip-path: var(--chamfer);
  padding: 14px 26px;
  font: 600 15px/1 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: filter .2s, transform .2s;
}
.btn:hover, .btn-link:hover { color: #031522; filter: brightness(1.15); transform: translateY(-1px); }

.section-head { text-align: center; margin-bottom: 44px; }
.section-head .mono { color: var(--accent); font-size: 13px; letter-spacing: .08em; margin: 0 0 6px; }
.section-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}
.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
}

.social-icons { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 22px 0 0; }
.social-icons a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 50px;
  clip-path: var(--hex);
  background: var(--surface-hi);
  color: var(--text);
  font-size: 19px;
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
}
.social-icons a:hover { background: var(--accent); color: var(--bg); transform: translateY(-3px); }

/* ---------- Hero with honeycomb ---------- */
.hero { overflow: clip; padding: 64px 16px 30px; text-align: center; }
.hero-head h1 {
  font-family: var(--font-head);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0;
  background: linear-gradient(120deg, #fff 30%, #bae6fd 60%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-head .role { color: var(--muted); font-size: clamp(15px, 2vw, 18px); margin: 14px 0 0; }
.hero-head .positioning {
  max-width: 700px;
  margin: 14px auto 0;
  color: #d8e7f2;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}
.hero-actions .btn { min-width: 150px; justify-content: center; }
.btn-secondary {
  background: rgba(11, 31, 48, .78);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, .45);
}
.btn-secondary:hover {
  color: #fff;
  border-color: var(--accent);
  background: rgba(16, 50, 72, .94);
}
.hero-proof {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 18px 0 0;
  color: #bae6fd;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.hero-proof span { display: inline-flex; align-items: center; gap: 7px; }
.hero-proof i { color: var(--accent-2); }
.hero-hint { color: var(--muted); font-size: 12px; margin: 28px 0 0; opacity: .8; }
.project-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 26px auto 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.project-legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend-hex {
  display: inline-block;
  width: 16px;
  height: 18px;
  clip-path: var(--hex);
}
.legend-personal {
  background: linear-gradient(160deg, #7dd3fc, var(--accent) 48%, var(--accent-2));
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, .7));
}
.legend-university { background: linear-gradient(160deg, #64748b, #26344a); }

.honeycomb {
  --w: clamp(96px, 15.5vw, 176px);
  --g: 10px;
  --h: calc(var(--w) * 1.1547);
  --cols: 5;
  --rows: 3;
  position: relative;
  width: calc(var(--cols) * var(--w) + (var(--cols) - 1) * var(--g));
  height: calc(var(--h) + (var(--rows) - 1) * (var(--h) * .75 + var(--g) * .866));
  margin: 48px auto 0;
}
.hex-cell {
  position: absolute;
  width: var(--w);
  height: var(--h);
  left: calc(var(--x) * (var(--w) + var(--g)));
  top: calc(var(--y) * (var(--h) * .75 + var(--g) * .866));
  color: var(--text);
  text-decoration: none;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .35s;
}
.hex-cell.no-desk { display: none; }
.hex { width: 100%; height: 100%; padding: 3px; clip-path: var(--hex); background: linear-gradient(160deg, #7dd3fc, var(--accent) 45%, var(--accent-2)); transition: background .35s; }
.hex-inner { position: relative; width: 100%; height: 100%; clip-path: var(--hex); background: var(--bg-2); overflow: hidden; }
.hex-inner img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s, filter .35s; }

.hex-project .hex-inner img { filter: saturate(.8) brightness(.62); }
.hex-project .hex-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0) 25%, rgba(7, 11, 20, .85) 100%);
}
.hex-label {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 21%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.hex-num { font-family: var(--font-mono); font-size: clamp(8px, .8vw, 10px); color: var(--accent); letter-spacing: .06em; }
.hex-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(10px, 1.15vw, 15px);
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}
.hex-project { filter: drop-shadow(0 0 10px rgba(56, 189, 248, .18)); }
.hex-project:hover, .hex-project:focus-visible { transform: translateY(-5px) scale(1.05); filter: drop-shadow(0 0 25px rgba(56, 189, 248, .7)); z-index: 3; outline: 0; }
.hex-project:hover .hex, .hex-project:focus-visible .hex { background: linear-gradient(160deg, var(--accent), var(--accent-2)); }
.hex-project:hover img, .hex-project:focus-visible img { filter: saturate(1) brightness(.8); transform: scale(1.08); }
.hex-course .hex {
  padding: 2px;
  background: linear-gradient(160deg, #64748b, rgba(100, 116, 139, .22) 58%, #26344a);
}
.hex-course .hex-inner {
  background: linear-gradient(145deg, rgba(100, 116, 139, .1), var(--bg-2));
}
.hex-course .project-placeholder-icon {
  color: #94a3b8;
  background: radial-gradient(circle, rgba(100, 116, 139, .16), transparent 68%);
}
.hex-course:hover, .hex-course:focus-visible {
  filter: drop-shadow(0 0 16px rgba(148, 163, 184, .38));
}
.hex-course:hover .hex, .hex-course:focus-visible .hex {
  background: linear-gradient(160deg, #94a3b8, #475569);
}

.hex-center { z-index: 2; filter: drop-shadow(0 0 30px rgba(56, 189, 248, .35)); }
.hex-center .hex { padding: 4px; background: conic-gradient(from var(--spin, 0deg), var(--accent), var(--accent-2), var(--accent), #0ea5e9, var(--accent)); animation: spin 8s linear infinite; }
.hex-center img { object-position: 50% 30%; }

.hex-decor { opacity: .5; }
.hex-decor .hex { background: rgba(148, 163, 184, .16); }
.hex-decor .hex-inner {
  background:
    repeating-linear-gradient(135deg, rgba(56, 189, 248, .06) 0 2px, transparent 2px 10px),
    var(--bg);
}

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }

.honeycomb.is-assembling .hex-cell {
  opacity: 0;
  transform: translate(var(--fly-x), var(--fly-y)) rotate(var(--fly-rotate)) scale(.35);
  transition: filter .35s;
  will-change: transform, opacity;
}
.honeycomb.is-assembling.is-assembled .hex-cell {
  animation: hexAssemble 1.05s cubic-bezier(.16, 1, .3, 1) var(--assemble-delay) both;
}
@keyframes hexAssemble {
  from {
    opacity: 0;
    transform: translate(var(--fly-x), var(--fly-y)) rotate(var(--fly-rotate)) scale(.35);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
  }
}

/* Elements receive this class only when JavaScript can reveal them safely. */
.scroll-reveal {
  opacity: 0;
  transform: translate3d(var(--reveal-x, 0), 34px, 0) scale(.985);
  transition:
    opacity .7s ease var(--reveal-delay, 0ms),
    transform .85s cubic-bezier(.16, 1, .3, 1) var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@media (max-width: 720px) {
  .hero-actions { gap: 9px; }
  .hero-actions .btn { min-width: 0; padding: 12px 17px; font-size: 14px; }
  .honeycomb { --cols: 3; --rows: 6; --w: clamp(90px, 29vw, 150px); --g: 6px; }
  .hex-cell { left: calc(var(--mx) * (var(--w) + var(--g))); top: calc(var(--my) * (var(--h) * .75 + var(--g) * .866)); }
  .hex-cell.no-desk { display: block; }
  .hex-cell.no-mob { display: none; }
  .hex-title { font-size: 12px; }
  .hex-num { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .hex-cell,
  .scroll-reveal,
  .scroll-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-top: 50px; }
.about .el-text { font-size: 17px; }
.about .el-text p { margin: 0 0 12px; }
.about .chips { margin-top: 18px; }
.languages { margin-top: 22px; }
.languages .panel-label { margin-bottom: 10px; }
.lang-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .lang-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lang-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  background: rgba(56, 189, 248, .04);
}
.lang-name { font-weight: 600; font-size: 15px; color: var(--text); }
.lang-level { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); }
.stats { list-style: none; margin: 0; display: grid; align-content: center; gap: 22px; }
.stats li { display: flex; flex-direction: column; }
.stats .stat-num {
  display: block;
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(120deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 4px; }
@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); text-align: center; }
  .stats li { align-items: center; }
  .stats .stat-num { font-size: 34px; }
  .stat-label { font-size: 10px; }
}

.home-section { padding: 100px 24px 20px; }
.timeline-section { padding-top: 78px; }

/* ---------- Skills ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 980px) { .skill-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .skill-grid { grid-template-columns: 1fr; } }
.skill-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.skill-head { display: flex; align-items: center; gap: 12px; }
.skill-head h3 { margin: 0; font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text); }
.skill-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 44px;
  clip-path: var(--hex);
  background: linear-gradient(150deg, rgba(56, 189, 248, .25), rgba(245, 165, 36, .18));
  color: var(--accent);
  font-size: 16px;
}
.skill-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.skill-card .tags { margin-top: auto; }

/* ---------- Project grid ---------- */
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project-grid + .project-grid { margin-top: 20px; }
@media (max-width: 860px) { .project-grid { grid-template-columns: 1fr; } }
.section-intro {
  max-width: 720px;
  margin: -14px auto 34px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}
.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 22px;
  align-items: start;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color .3s, transform .3s, background .3s;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--accent), var(--accent-2));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .35s;
}
.project-card:hover { color: var(--text); border-color: var(--line-strong); background: rgba(19, 32, 58, .85); transform: translateY(-3px); }
.project-card:hover::before { transform: scaleY(1); }
.project-thumb { width: 132px; height: 152px; padding: 2px; clip-path: var(--hex); background: linear-gradient(160deg, var(--accent), rgba(56, 189, 248, .1), var(--accent-2)); }
.hex-mask { width: 100%; height: 100%; clip-path: var(--hex); background: var(--bg-2); overflow: hidden; }
.hex-mask img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.project-placeholder-icon { display: grid; place-items: center; width: 100%; height: 100%; color: var(--accent); font-size: 34px; background: radial-gradient(circle, rgba(56, 189, 248, .12), transparent 70%); }
.project-card:hover .hex-mask img { transform: scale(1.08); }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.project-card h3 { font-family: var(--font-head); font-size: 20px; font-weight: 600; line-height: 1.25; margin: 0 0 8px; }
.project-summary { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 14px; }
.project-card .more { display: inline-flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--accent); }
.project-card .more i { transition: transform .25s; }
.project-card:hover .more i { transform: translateX(4px); }
.university-projects {
  position: relative;
}
.course-project-card {
  border-color: rgba(148, 163, 184, .18);
  cursor: default;
}
.course-project-card:hover { transform: none; background: var(--surface); border-color: rgba(148, 163, 184, .28); }
.course-project-card::before {
  background: #64748b;
}
.course-project-card .project-thumb {
  background: linear-gradient(160deg, #64748b, rgba(100, 116, 139, .1), #26344a);
}
.course-project-card .project-placeholder-icon {
  color: #94a3b8;
  background: radial-gradient(circle, rgba(100, 116, 139, .12), transparent 70%);
}
.course-project-card .status { color: #94a3b8; }
.course-project-card .status::before { background: #64748b; }
.course-project-card {
  scroll-margin-top: 92px;
}
.course-project-card:target {
  border-color: #94a3b8;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, .2), 0 0 25px rgba(148, 163, 184, .1);
}
.project-disclaimer {
  max-width: 820px;
  margin: -12px auto 36px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}
.project-disclaimer p { margin: 0; }
.project-disclaimer p + p { margin-top: 8px; }
@media (max-width: 520px) {
  .project-card { grid-template-columns: 1fr; }
  .project-thumb { width: 120px; height: 138px; }
  .project-figure .hardware-diagram-scroll > img { width: 760px; max-width: none; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 1000px; margin: 0 auto; padding: 10px 0; }
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(var(--accent), rgba(56, 189, 248, .15) 85%, transparent);
}
.tl-item { position: relative; width: 50%; padding: 0 54px 34px 0; }
.tl-item.tl-right { margin-left: 50%; padding: 0 0 34px 54px; }
.tl-icon {
  position: absolute;
  top: 6px;
  right: -24px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 55px;
  clip-path: var(--hex);
  background: var(--c, var(--accent));
  font-size: 17px;
  color: #fff;
}
.tl-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  clip-path: var(--hex);
  background: var(--bg-2);
  z-index: -1;
}
.tl-icon { isolation: isolate; }
.tl-icon i { color: var(--c, var(--accent)); filter: brightness(1.5) saturate(1.2); }
.tl-right .tl-icon { right: auto; left: -24px; }
.tl-card {
  position: relative;
  display: block;
  padding: 22px 24px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: transform .25s, border-color .25s, background .25s;
}
.tl-card:hover { color: var(--text); border-color: var(--line-strong); background: rgba(19, 32, 58, .85); transform: translateY(-3px); }
.tl-card h3 { margin: 0; font-family: var(--font-head); font-size: 20px; font-weight: 600; line-height: 1.3; }
.tl-card time { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin: 8px 0 10px; }
.tl-card p { margin: 0 0 10px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.tl-card .tl-skills-label { margin: 14px 0 6px; color: var(--text); font-size: 12px; font-weight: 600; }
.tl-card .tl-skills { margin-bottom: 12px; }
.tl-card .read-more { font-size: 13px; font-weight: 600; color: var(--accent); }
.tl-card .read-more::after { content: " \2192"; }
.tl-earlier .tl-card { cursor: default; }
.tl-earlier .tl-card:hover { transform: none; background: var(--surface); border-color: var(--line); }
.tl-earlier .tl-skills { margin-top: 14px; }
.ann-skills { max-width: 760px; margin: 24px auto 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ann-skills h2 { margin: 0 0 12px; font: 600 20px/1.3 var(--font-head); }
@media (max-width: 800px) {
  .timeline::before { left: 24px; }
  .tl-item, .tl-item.tl-right { width: 100%; margin-left: 0; padding: 0 0 26px 66px; }
  .tl-icon, .tl-right .tl-icon { left: 0; right: auto; }
}

/* ---------- Publications ---------- */
.publication-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 1100px; margin: 0 auto; }
.pub-card { display: flex; gap: 22px; align-items: flex-start; margin: 0; }
.pub-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 60px;
  clip-path: var(--hex);
  background: rgba(56, 189, 248, .12);
  color: var(--accent);
  font-size: 22px;
}
.pub-card .el-text h3 { margin: 0 0 10px; font: 600 19px/1.3 var(--font-head); color: var(--text); }
.pub-card .el-text p { margin: 0; }
.personal-links { max-width: 760px; margin: 50px auto 0; }
.personal-links > p:not(.panel-label) { color: var(--muted); }
.pub-card .el-text p + p { margin-top: 10px; }
@media (max-width: 760px) { .publication-grid { grid-template-columns: 1fr; } }

/* ---------- Project page ---------- */
.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 36px;
}
.project-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 16px;
}
.lead { font-size: 18px; color: #c3cfe0; margin: 0 0 20px; max-width: 680px; }
.hero-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.project-hero-img { display: block; width: 300px; height: 346px; padding: 3px; clip-path: var(--hex); background: linear-gradient(160deg, var(--accent), rgba(56, 189, 248, .1), var(--accent-2)); filter: drop-shadow(0 0 30px rgba(56, 189, 248, .25)); }
.project-hero-img img { transition: transform .6s; }
.project-hero-img:hover img { transform: scale(1.05); }
.project-hero-placeholder .project-placeholder-icon { font-size: 64px; }
.breadcrumbs { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { color: var(--text); }

.project-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; align-items: start; }
.project-layout > * { min-width: 0; }
.project-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 18px; }
.project-aside .panel { padding: 22px; }
.spec dl { display: grid; grid-template-columns: 1fr; margin: 0; }
.spec dt { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.spec dd { margin: 2px 0 12px; padding-bottom: 12px; font-size: 14.5px; line-height: 1.5; border-bottom: 1px dashed var(--line); }
.spec dd:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.milestones ol { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.milestones ol::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.milestones li { position: relative; margin-bottom: 12px; font-size: 14px; line-height: 1.5; }
.milestones li:last-child { margin-bottom: 0; }
.milestones li::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 4px;
  width: 12px;
  height: 14px;
  clip-path: var(--hex);
  background: var(--ok);
}
.milestones li.todo::before { background: var(--accent-2); }
.milestones li .mono { display: block; font-size: 11px; color: var(--muted); }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.related a { font-size: 14px; text-decoration: none; }
.related i { font-size: 11px; opacity: .7; margin-right: 4px; }

@media (max-width: 1000px) {
  .project-hero { grid-template-columns: 1fr; gap: 30px; }
  .project-hero-img { width: 220px; height: 254px; order: -1; }
  .project-layout { grid-template-columns: 1fr; }
  .project-aside { position: static; order: -1; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

.post-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin: 60px 0 0; padding-top: 26px; border-top: 1px solid var(--line); }
.post-nav > a:not(.nav-all) { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; font-family: var(--font-head); font-size: 17px; line-height: 1.3; }
.post-nav .next { flex-direction: row-reverse; text-align: right; }
.post-nav .nav-text .mono { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.nav-hex { flex: 0 0 auto; width: 56px; height: 64px; clip-path: var(--hex); overflow: hidden; background: var(--bg-2); }
.nav-hex img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-nav > a:hover { color: var(--accent); }
.post-nav > a:hover .nav-hex img { transform: scale(1.1); }
.nav-all { display: grid; place-items: center; width: 48px; height: 55px; clip-path: var(--hex); background: var(--surface-hi); color: var(--text); text-decoration: none; transition: background .2s; }
.nav-all:hover { background: var(--accent); color: var(--bg); }
@media (max-width: 600px) {
  .post-nav { grid-template-columns: 1fr 1fr; }
  .nav-all { display: none; }
  .nav-hex { display: none; }
  .post-nav > a:not(.nav-all) { font-size: 15px; }
}

/* ---------- Generic pages ---------- */
.entry { max-width: 1000px; margin: 0 auto; padding: 56px 24px 40px; }
.entry-header { margin: 0 auto 40px; max-width: 760px; }
.entry-header h1, .page .el-heading:first-child {
  font-family: var(--font-head);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  margin: 6px 0;
}
.entry-meta { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin: 8px 0 0; }
.single-announcement .entry-header { text-align: center; }
.ann-icon {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 72px;
  height: 83px;
  margin: 20px auto 14px;
  clip-path: var(--hex);
  background: var(--c, var(--accent));
  font-size: 26px;
}
.ann-icon::before { content: ""; position: absolute; inset: 3px; clip-path: var(--hex); background: var(--bg-2); z-index: -1; }
.ann-icon i { color: var(--c, var(--accent)); filter: brightness(1.5) saturate(1.2); }
.single-announcement .entry-content, .page-publications .entry-content { max-width: 760px; margin: 0 auto; }
.single-announcement .entry-content { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }

.back-link { max-width: 760px; margin: 36px auto 0; }
.back-link a { color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link a:hover { color: var(--accent); }

/* ---------- Article content ---------- */
.entry-content { font-size: 16.5px; color: #d3dceb; }
.el-section { margin: 0 auto 24px; }
.el-section .el-section { margin-bottom: 0; }
.el-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.el-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 700px) { .el-cols-2, .el-cols-3 { grid-template-columns: 1fr; } }
.el-col > * + * { margin-top: 18px; }

.el-heading, .el-text h2 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin: 40px 0 14px;
  padding-left: 18px;
  position: relative;
}
.el-heading::before, .el-text h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: .3em;
  width: 10px;
  height: 12px;
  clip-path: var(--hex);
  background: var(--accent);
}
.page .el-heading:first-child { padding-left: 0; margin-top: 0; }
.page .el-heading:first-child::before { display: none; }
.el-text h3 { font-family: var(--font-head); font-size: 21px; font-weight: 600; color: var(--text); margin: 30px 0 10px; }
.el-text h4 { font-family: var(--font-head); font-size: 17px; font-weight: 600; color: #bae6fd; margin: 24px 0 8px; }
.el-text p { margin: 0 0 14px; }
.el-text ul, .el-text ol { padding-left: 1.3em; margin: 0 0 16px; }
.el-text li { margin-bottom: 7px; }
.el-text li p { margin: 0; }
.el-text ul li::marker { color: var(--accent); }
.el-text ol li::marker { color: var(--accent); font-family: var(--font-mono); font-size: .9em; }
.el-text strong { color: var(--text); }
.media-credit {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
.media-credit i { color: var(--accent); }
.el-text del { color: var(--muted); text-decoration-color: var(--ok); text-decoration-thickness: 2px; }
.el-text del hr { display: none; }
.el-text code {
  font-family: var(--font-mono);
  font-size: .86em;
  color: #bae6fd;
  background: rgba(56, 189, 248, .08);
  border: 1px solid rgba(56, 189, 248, .15);
  padding: 1px 6px;
  border-radius: 5px;
}
.project-figure {
  margin: 22px 0 28px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.project-figure img {
  display: block;
  width: min(100%, 520px);
  max-height: 420px;
  object-fit: contain;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
}
.project-figure-wide img { width: 100%; max-height: none; background: #09111f; }
.hardware-diagram-scroll { overflow-x: auto; }
.hardware-diagram-scroll > img { display: block; width: 100%; margin: 0; }
.project-figure figcaption { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.equation-block {
  margin: 16px 0 22px;
  padding: 14px 18px;
  overflow-x: auto;
  color: #e0f2fe;
  background: #050912;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  text-align: center;
}
.equation-row {
  margin: 0;
  color: #e0f2fe;
  font: 16px/1.8 "Cambria Math", Cambria, Georgia, serif;
  white-space: nowrap;
}
.equation-row + .equation-row { margin-top: 2px; }
.equation-note { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.equation-scroll { text-align: left; }
.equation-scroll .equation-row { text-align: center; }
.el-text pre {
  position: relative;
  background: #050912;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  line-height: 1.55;
}
.el-text pre code { background: none; border: 0; padding: 0; font-size: 13px; color: #cbd5e1; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 10px; }
.el-text table, .routes-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.table-wrap > table { margin: 0; }
.el-text th, .el-text td, .routes-table th, .routes-table td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.el-text th, .routes-table th {
  background: rgba(56, 189, 248, .08);
  color: #bae6fd;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.el-text tbody tr:hover, .routes-table tbody tr:hover { background: rgba(56, 189, 248, .04); }
.topo-table td:nth-child(-n+3) { white-space: nowrap; font-family: var(--font-mono); font-size: 13px; color: #bae6fd; }
.topo-table small { color: var(--muted); }
.el-text img { display: block; margin: 12px auto; border-radius: 10px; }

.el-image { margin: 0; text-align: center; }
.el-image img, .el-video video, .el-video iframe, .gallery a { border-radius: 12px; border: 1px solid var(--line); }
.el-image img { display: block; margin: 0 auto; }
.el-video { margin: 0; }
.el-video video, .el-video iframe { display: block; width: 100%; background: #000; }
.el-video iframe { aspect-ratio: 16 / 9; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gallery a { overflow: hidden; display: block; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .4s; }
.gallery a:hover img { transform: scale(1.06); }
a.lightbox { cursor: zoom-in; }

/* ---------- Impossible list ---------- */
.page-impossible-list .entry-content { max-width: 1000px; margin: 0 auto; }
.el-counter { text-align: center; margin: 10px 0; }
.counter-number { display: block; font-family: var(--font-head); font-size: 72px; font-weight: 700; line-height: 1.05; background: linear-gradient(120deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.counter-title { display: block; font-family: var(--font-mono); font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-2); }
.travel-map-wrap { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.map-desc { color: var(--muted); font-size: 14px; }
.travel-map, .travel-map.jvm-container { width: 100%; height: 480px; }
@media (max-width: 700px) { .travel-map, .travel-map.jvm-container { height: 260px; } }
.jvm-tooltip { font-family: var(--font-body) !important; background: var(--surface-hi) !important; border: 1px solid var(--line-strong); }
.jvm-zoom-btn { background: var(--surface-hi) !important; color: var(--text) !important; }
.routes-table tbody tr:nth-child(odd) { background: rgba(255, 255, 255, .02); }
.routes-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.routes-table th::after { content: " \2195"; opacity: .4; font-size: 11px; }
.routes-table th[aria-sort="ascending"]::after { content: " \2191"; opacity: 1; }
.routes-table th[aria-sort="descending"]::after { content: " \2193"; opacity: 1; }
.route-popup-btn { background: none; border: 0; color: var(--accent); font: inherit; padding: 0; cursor: pointer; text-align: left; }
.route-popup-btn:hover { color: #fff; }

/* ---------- Contact form ---------- */
.contact-form { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.form-block { margin-bottom: 26px; }
.contact-form h2 { font-family: var(--font-head); font-size: 22px; font-weight: 600; margin: 0; }
.form-sub { color: var(--muted); margin: 4px 0 14px; }
.contact-form hr { border: 0; border-top: 1px solid var(--line); margin: 0 0 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } .contact-form { padding: 22px; } }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 7px; }
.form-field .req { color: var(--accent-2); }
.form-field input, .form-field textarea {
  width: 100%;
  background: rgba(5, 9, 18, .8);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.form-field input:focus, .form-field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, .15); }
.form-field input::placeholder, .form-field textarea::placeholder { color: #5b6b85; }
.form-field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.form-field.invalid input, .form-field.invalid textarea { border-color: #f87171; }
.form-status { min-height: 1.5em; }
.form-status.error { color: #fca5a5; }
.form-status.ok { color: var(--ok); }

/* ---------- Footer / misc ---------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: rgba(7, 11, 20, .6); }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 26px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.footer-inner p { margin: 0; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.footer-brand .mono { color: var(--muted); font-size: 12px; }
.hex-dot { width: 12px; height: 14px; clip-path: var(--hex); background: linear-gradient(160deg, var(--accent), var(--accent-2)); }

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 46px;
  height: 53px;
  border: 0;
  clip-path: var(--hex);
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: .3s;
}
.to-top.show { opacity: .9; visibility: visible; }
.to-top:hover { opacity: 1; background: #7dd3fc; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 6, 12, .94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.lightbox-overlay[hidden] { display: none; }
.lb-content { max-width: 100%; max-height: 100%; overflow: auto; text-align: center; }
.lb-content > img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 10px; }
.lb-content .popup-card { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; max-width: 480px; }
.lb-content .popup-card img { max-height: 55vh; width: auto; }
.lb-close { position: absolute; top: 12px; right: 18px; background: none; border: 0; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; }
.lb-close:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.done-date { color: var(--ok); font-family: var(--font-mono); font-size: .88em; }
