:root {
  --ink: #12162a;
  --panel: #1a2140;
  --violet: #9b82e8;
  --pink: #e6a3c9;
  --paper: #f2eff9;
  --muted: #8891bd;
  --hairline: rgba(155, 130, 232, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  line-height: 1.08;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* faint grain overlay for texture, avoids flat AI-gradient look */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  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>");
}

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(18, 22, 42, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: relative;
}
.mark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.mark { flex: 0 0 auto; white-space: nowrap; }
.mark-icon { display: flex; }
.mark-icon img { display: block; border-radius: 2px; }
.site-nav { display: flex; align-items: center; gap: 24px; font-size: 0.92rem; }
.site-nav a { color: var(--muted); transition: color 0.15s ease; white-space: nowrap; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--paper); }
.header-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.lang-toggle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--violet);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.lang-toggle:hover, .lang-toggle:focus-visible { border-color: var(--violet); color: var(--paper); }

/* mobile nav toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 1px;
  margin: 0 auto;
  background: var(--paper);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* eyebrow / utility label */
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--violet);
  margin: 0 0 14px;
  text-transform: lowercase;
}

/* hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  padding: 96px 24px 100px;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  color: var(--paper);
  margin-bottom: 20px;
}
.hero .lede {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 46ch;
  margin: 0 0 32px;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: var(--paper);
  border: 1px solid var(--violet);
  padding: 12px 20px;
  border-radius: 3px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta:hover { background: rgba(155, 130, 232, 0.12); transform: translateY(-1px); }
.cta span { color: var(--pink); }

/* contact form */
.contact-form { margin: 28px 0 20px; max-width: 480px; }
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-row input, .form-row textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 11px 12px;
  color: var(--paper);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--violet);
}
.form-row textarea { resize: vertical; min-height: 100px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.contact-submit {
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  cursor: pointer;
}
.contact-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.form-status {
  margin: 12px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 1.2em;
}
.form-status.ok { color: var(--violet); }
.form-status.err { color: var(--pink); }
.contact-alt { opacity: 0.85; }

.hero-bloom {
  display: flex;
  justify-content: center;
}
#bloom {
  width: 100%;
  max-width: 300px;
  height: auto;
  opacity: 0;
  transform: scale(0.92) translateY(8px);
  animation: bloom-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s;
  filter: drop-shadow(0 0 28px rgba(155, 130, 232, 0.28));
}
@keyframes bloom-in {
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #bloom { animation: none; opacity: 1; transform: none; }
}

/* sections */
section { padding: 80px 24px; position: relative; z-index: 1; }
.projects, .about, .contact { border-top: 1px solid var(--hairline); }
.projects h2, .about h2, .contact h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  color: var(--paper);
  margin-bottom: 28px;
}
.about-body { color: var(--muted); max-width: 56ch; font-size: 1.02rem; margin: 0 0 24px; }

/* stack list */
.stack-list { margin-top: 32px; }
.stack-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}
.stack-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stack-tags li {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 6px 12px;
}

/* project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 720px;
}
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.project-card.featured:hover { border-color: var(--violet); transform: translateY(-2px); }
.project-thumb {
  position: relative;
  height: 140px;
  background: linear-gradient(135deg, #2a2f57, #1a2140);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 12px;
  overflow: hidden;
}
.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-thumb .project-kicker { position: relative; z-index: 1; }
.project-thumb.ghost { background: repeating-linear-gradient(135deg, #1e2444, #1e2444 8px, #232a4d 8px, #232a4d 16px); }
.project-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: var(--pink);
  padding: 3px 8px;
  border-radius: 2px;
}
.project-body { padding: 18px 18px 22px; }
.project-body h3 {
  font-size: 1.15rem;
  color: var(--paper);
  margin-bottom: 8px;
}
.project-body p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 14px;
}
.project-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--violet);
}
.project-card.placeholder .project-body h3 { color: var(--muted); }
.project-card.placeholder { opacity: 0.7; }

/* footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 32px 24px;
  position: relative;
  z-index: 1;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer a:hover { color: var(--paper); }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 64px; }
  .hero-bloom { order: -1; max-width: 220px; margin: 0 auto 20px; }
  .project-grid { grid-template-columns: 1fr; }

  .site-header .wrap { height: 56px; }
  .mark { font-size: 0.95rem; }
  .mark-icon img { width: 20px; height: 20px; }

  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(18, 22, 42, 0.98);
    border-bottom: 1px solid var(--hairline);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.15s ease;
  }
  .site-nav.is-open { max-height: 240px; opacity: 1; }
  .site-nav a {
    width: 100%;
    padding: 14px 24px;
    border-top: 1px solid var(--hairline);
    font-size: 0.95rem;
  }

  .lang-toggle { font-size: 0.68rem; padding: 5px 8px; }
}

@media (max-width: 360px) {
  .mark { font-size: 0.85rem; }
}
