:root {
  --bg: #0b0d10;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.04);
  --text: #e9edf2;
  --muted: #a9b3bf;
  --muted-2: rgba(233, 237, 242, 0.78);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #5dd6ff;

  --radius: 14px;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.22);
  --max: 1040px;

  --header-h: 68px;
}

/* Anchor offset for sticky header */
section[id] {
  scroll-margin-top: calc(var(--header-h) + 18px);
}
@media (max-width: 700px) {
  section[id] {
    scroll-margin-top: 92px; /* tune if needed */
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

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

body {
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 20% 0%, rgba(93, 214, 255, 0.18), transparent 60%),
    radial-gradient(900px 520px at 90% 18%, rgba(140, 115, 255, 0.12), transparent 55%),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px;
}

.muted { color: var(--muted); }

.desktop-only { display: block; }
.mobile-only { display: none; }

/* Accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: #fff;
  color: #000;
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 999;
}
.skip-link:focus { left: 12px; }

/* Focus styles */
:focus-visible {
  outline: 2px solid rgba(93, 214, 255, 0.85);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
  background: rgba(11, 13, 16, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: 0.2px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(93, 214, 255, 0.55);
}

.nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }

.nav-cta {
  color: var(--text) !important;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(93, 214, 255, 0.35);
  background: rgba(93, 214, 255, 0.12);
  font-weight: 850;
}
.nav-cta:hover { border-color: rgba(93, 214, 255, 0.65); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 28px;
  padding-top: 28px;
  align-items: start;
}

.kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 850;
  letter-spacing: 0.2px;
}

h1 {
  margin: 0 0 12px;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.2px;
}

.lead {
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 65ch;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}

.meta { margin: 0; color: var(--muted); }

.hero-aside {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.avatar-card {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.avatar {
  width: 100%;
  max-width: 280px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.04);
}

/* Mobile profile strip */
.profile-strip {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
}

.avatar-small {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  object-fit: cover;
}

.profile-name {
  font-weight: 900;
  letter-spacing: 0.2px;
}

.profile-meta {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}

.profile-current {
  color: rgba(233, 237, 242, 0.72);
  font-size: 13.5px;
  margin-top: 4px;
}

/* Panel */
.panel {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
}

.panel-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
}

/* Sections */
.section { margin-top: 48px; }

.section-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.section-head p { margin: 0; }

/* Cards */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--shadow-soft);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.card-main h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.1px;
  font-weight: 900;
}

.card-meta {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 13.5px;
  line-height: 1.35;
}

.card-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Company logos */
.company-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 6px;
  opacity: 0.95;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
}

/* Project card accent */
.card.project {
  border-color: rgba(93, 214, 255, 0.20);
  background:
    radial-gradient(700px 280px at 15% 0%, rgba(93, 214, 255, 0.10), transparent 60%),
    rgba(255, 255, 255, 0.035);
}

/* Tool logos */
.logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
  opacity: 0.95;
}

/* Bullets */
.bullets { margin: 12px 0 0; padding-left: 18px; }
.bullets li { margin: 7px 0; color: var(--muted); }
.bullets.compact { margin-top: 8px; }
.bullets.compact li { margin: 6px 0; }

/* Skills grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.tile-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 900;
}

.tile-sub {
  margin: 0 0 10px;
  color: rgba(233, 237, 242, 0.70);
  font-size: 13.5px;
  line-height: 1.35;
}

.tile-body {
  margin: 0;
  color: var(--muted);
}

/* Projects formatting */
.project-body {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.project-label {
  font-weight: 900;
  font-size: 12.5px;
  letter-spacing: 0.28px;
  text-transform: uppercase;
  color: rgba(233, 237, 242, 0.78);
}

.impact {
  margin: 8px 0 0;
  color: rgba(233, 237, 242, 0.80);
  line-height: 1.45;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.button:active { transform: translateY(0px); }

.button.primary {
  border-color: rgba(93, 214, 255, 0.35);
  background: rgba(93, 214, 255, 0.12);
}
.button.primary:hover { border-color: rgba(93, 214, 255, 0.65); }

.button.secondary {
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.06);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  color: var(--text);
}

button.button { color: var(--text); }

.icon-button {
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.icon-button .icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Contact Form */
.contact { margin-top: 12px; }

.form {
  max-width: 760px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.field { display: grid; gap: 8px; }
.field-full { grid-column: 1 / -1; }

label {
  font-weight: 850;
  font-size: 14px;
  color: var(--muted-2);
}

input, textarea, button { font: inherit; }

input, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
}

textarea { resize: vertical; min-height: 150px; }

input:focus, textarea:focus {
  outline: none;
  border-color: rgba(93, 214, 255, 0.65);
}

/* Actions row */
.actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.form-notes {
  display: grid;
  gap: 6px;
}

.form-hint, .form-trust { margin: 0; }
.form-trust { color: rgba(233, 237, 242, 0.65); font-size: 13.5px; }

.honeypot { display: none; }

.status {
  margin: 10px 0 0;
  min-height: 22px;
  grid-column: 1 / -1;
  font-weight: 850;
}

.status.ok { color: rgba(93, 214, 255, 0.95); }
.status.error { color: #ffb4b4; }

/* Submit button: stable width, centered label, spinner never affects layout */
#submit-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 260px;
  max-width: 100%;
  padding: 10px 44px;

  white-space: nowrap;
}

#submit-btn .btn-text {
  display: inline-block;
  text-align: center;
}

#submit-btn .spinner {
  position: absolute;
  right: 16px;
  width: 14px;
  height: 14px;

  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.9);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#submit-btn.loading .spinner {
  opacity: 1;
  visibility: visible;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 56px;
  padding: 18px 0 40px;
  color: var(--muted);
}

.footer-inner {
  display: grid;
  gap: 10px;
}

.footer-nav a { color: rgba(233, 237, 242, 0.78); }
.footer-nav a:hover { color: var(--text); text-decoration: none; }

.footer-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.sep { opacity: 0.75; }

/* Subtle polish */
.card, .tile, .panel, .avatar, .company-logo {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card:hover, .tile:hover, .panel:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.40);
}

.card.project:hover { border-color: rgba(93, 214, 255, 0.35); }

.avatar:hover {
  transform: translateY(-3px) rotate(-0.2deg);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

/* Hero load-in */
.hero-copy, .hero-aside { animation: fadeUp 420ms ease both; }
.hero-aside { animation-delay: 60ms; }

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

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 420ms ease, transform 420ms ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  h1 { font-size: 34px; line-height: 1.14; }
  .grid { grid-template-columns: 1fr; }
}

/* Mobile header: keep it intentional without weird wrapping */
@media (max-width: 700px) {
  .site-header { height: auto; padding: 10px 0; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .nav a { white-space: nowrap; }
  .nav::-webkit-scrollbar { height: 0px; }

  .desktop-only { display: none; }
  .mobile-only { display: block; }

  .profile-strip { display: flex; }

  .hero-actions .button { width: 100%; }
  .container { padding: 18px; }
}

/* Mobile form stacking */
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }

  .actions {
    grid-template-columns: 1fr;
    align-items: start;
  }

  #submit-btn { width: 100%; }
}
