:root {
  --bg: #0b0f16;
  --bg-alt: #121a26;
  --surface: rgba(18, 26, 38, 0.82);
  --text: #e9f0f8;
  --muted: #a8b3c2;
  --line: rgba(180, 208, 237, 0.18);
  --accent: #f7a33d;
  --accent-alt: #5ad0ff;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

html[data-theme="light"] {
  --bg: #f6f7f5;
  --bg-alt: #e6ecf2;
  --surface: rgba(255, 255, 255, 0.86);
  --text: #131926;
  --muted: #4e5a6e;
  --line: rgba(46, 62, 92, 0.18);
  --accent: #c15211;
  --accent-alt: #0f7db0;
  --shadow: 0 16px 38px rgba(33, 43, 64, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(247, 163, 61, 0.2), transparent 38%),
    radial-gradient(circle at 100% 10%, rgba(90, 208, 255, 0.2), transparent 36%),
    linear-gradient(160deg, var(--bg), var(--bg-alt));
  min-height: 100vh;
  line-height: 1.65;
  letter-spacing: 0.01em;
  transition: background 0.3s ease, color 0.3s ease;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.035'%3E%3Ccircle cx='1' cy='1' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

.hero,
main,
.footer {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0 1rem;
}

.brand {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
  color: var(--muted);
}

.theme-toggle {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.hero-content {
  padding: 3.7rem 0 2.9rem;
  animation: rise 0.7s ease both;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-alt);
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.3rem);
  margin: 0;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.subtitle {
  font-weight: 600;
  color: var(--muted);
  margin: 0.9rem 0 1.2rem;
}

.intro {
  max-width: 62ch;
  line-height: 1.8;
  margin: 0;
}

.section {
  margin: 2.4rem auto;
  padding: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: rise 0.7s ease both;
}

.section h2 {
  margin: 0 0 1.2rem;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
}

.project-grid,
.stack-grid {
  display: grid;
  gap: 1rem;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card,
.stack-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem;
  background: color-mix(in srgb, var(--surface), transparent 18%);
}

.card h3,
.stack-card h3 {
  margin: 0;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.project-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  padding: 0.6rem;
  margin-bottom: 0.9rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface), transparent 24%);
}

.project-logo {
  width: auto;
  max-width: 100%;
  max-height: 88px;
  height: auto;
  object-fit: contain;
  border-radius: 0;
}

a {
  color: var(--accent-alt);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  color: var(--accent);
}

.stack-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.icon-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.icon-row a {
  display: inline-flex;
  color: inherit;
}

.icon-row img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 5px;
  padding: 4px;
  transition: transform 0.2s ease;
}

.icon-row a:hover img {
  transform: scale(1.1);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

ul {
  padding-left: 1.25rem;
  margin: 0;
  line-height: 1.9;
}

.cta {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.footer {
  text-align: center;
  padding: 2.6rem 0 3.2rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .theme-label {
    display: none;
  }

  .hero-content {
    padding-top: 2.4rem;
  }

  .section {
    padding: 1.2rem;
  }
}
