:root {
  --bg: #07070b;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --muted: #a3a3ae;

  --c-cyan: #22d3ee;
  --c-blue: #3b82f6;
  --c-amber: #fbbf24;
  --c-rose: #f43f5e;
  --c-fuchsia: #e879f9;
  --c-purple: #8b5cf6;
  --c-sky: #38bdf8;
  --c-indigo: #6366f1;
  --c-copper: #e0993d;
  --c-schematic: #8b90c9;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* ---- corner illustrations: PCB traces + a scan flip-flop schematic ---- */

.corner {
  position: fixed;
  z-index: 0;
  width: 40vmin;
  height: 40vmin;
  pointer-events: none;
}

@media (max-width: 640px) {
  .corner {
    width: 46vw;
    height: 46vw;
  }
}

.corner svg {
  width: 100%;
  height: 100%;
  display: block;
}

.corner-pcb {
  top: 0;
  left: 0;
  background: radial-gradient(circle at 12% 12%, rgba(224, 153, 61, 0.14), transparent 60%);
  mask-image: radial-gradient(circle at top left, black 0%, black 38%, transparent 76%);
  -webkit-mask-image: radial-gradient(circle at top left, black 0%, black 38%, transparent 76%);
}

.corner-scan {
  top: 0;
  right: 0;
  background: radial-gradient(circle at 88% 12%, rgba(139, 144, 201, 0.16), transparent 60%);
  mask-image: radial-gradient(circle at top right, black 0%, black 38%, transparent 76%);
  -webkit-mask-image: radial-gradient(circle at top right, black 0%, black 38%, transparent 76%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---- content ---- */

main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  padding: 6rem 1.5rem 4rem;
}

.intro {
  text-align: center;
  margin-bottom: 3.25rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.led {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 12px;
  border-radius: 50%;
  background: var(--c-cyan);
  box-shadow: 0 0 10px 2px var(--c-cyan);
  vertical-align: middle;
  animation: blink 2.6s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
  .led {
    animation: none;
  }
}

.role {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
}

.linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 1.6rem;
  border-radius: 14px;
  background: #0a66c2;
  box-shadow: 0 8px 22px -8px rgba(10, 102, 194, 0.65);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.linkedin svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.linkedin:hover,
.linkedin:focus-visible {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 28px -8px rgba(10, 102, 194, 0.8);
}

.tagline {
  margin: 0 auto;
  max-width: 440px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.card:focus-visible {
  background: var(--surface-hover);
  border-color: color-mix(in srgb, var(--hue-a) 55%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -14px var(--hue-a);
}

.card-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--hue-a), var(--hue-b));
  box-shadow: 0 6px 18px -6px var(--hue-a);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.card[data-hue="vlsi"] {
  --hue-a: var(--c-cyan);
  --hue-b: var(--c-blue);
}

.card[data-hue="aihw"] {
  --hue-a: var(--c-copper);
  --hue-b: var(--c-purple);
}

.card[data-hue="scan"] {
  --hue-a: var(--c-schematic);
  --hue-b: var(--c-cyan);
}

.card[data-hue="miluim"] {
  --hue-a: var(--c-amber);
  --hue-b: var(--c-rose);
}

.card[data-hue="lab"] {
  --hue-a: var(--c-fuchsia);
  --hue-b: var(--c-purple);
}

.card[data-hue="elections"] {
  --hue-a: var(--c-sky);
  --hue-b: var(--c-indigo);
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-body h2 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  font-weight: 650;
}

.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.card-arrow {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.2rem;
  transition: transform 0.18s ease, color 0.18s ease;
}

.card:hover .card-arrow,
.card:focus-visible .card-arrow {
  color: var(--text);
  transform: translateX(3px);
}

.section-label {
  margin: 0.5rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.secondary-projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.card-sm {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
}

.card-sm .card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.card-sm .card-icon svg {
  width: 18px;
  height: 18px;
}

.card-sm .card-body h3 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.card-sm .card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.lock-badge {
  display: none;
  color: var(--muted);
}

.lock-badge svg {
  width: 12px;
  height: 12px;
  display: block;
}

.card-sm[data-locked="true"] .lock-badge {
  display: inline-flex;
}

.card-sm[data-locked="true"] {
  opacity: 0.7;
}

.card-sm[data-locked="true"]:hover,
.card-sm[data-locked="true"]:focus-visible {
  border-color: var(--border);
  box-shadow: none;
}

@media (max-width: 640px) {
  .secondary-projects {
    grid-template-columns: 1fr;
  }

  .card-sm {
    flex-direction: row;
    align-items: center;
  }
}

footer {
  margin-top: 3.5rem;
  text-align: center;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

@media (max-width: 480px) {
  h1 {
    font-size: 2.3rem;
  }

  main {
    padding: 4rem 1.25rem 3rem;
  }

  .card {
    padding: 1.1rem 1.1rem;
  }
}
