/*
  Portfolio Design System
  - Dark-first, tech-forward, lightweight
  - Tokens via CSS variables
  - Accessible focus + reduced motion
*/

:root {
  --font-sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --bg0: #070a14;
  --bg1: #0b1020;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.12);

  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --faint: rgba(255, 255, 255, 0.48);

  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --good: #34d399;

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 72px;

  --container: 1120px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.55;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(124, 92, 255, 0.25), transparent 55%),
    radial-gradient(800px 520px at 80% 20%, rgba(34, 211, 238, 0.18), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 3px solid rgba(34, 211, 238, 0.6);
  outline-offset: 3px;
  border-radius: 10px;
}

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--bg1);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 999px;
  z-index: 9999;
}

.skip-link:focus {
  left: 12px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(14px);
  background: rgba(7, 10, 20, 0.55);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 14px 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 5px rgba(124, 92, 255, 0.16);
}

.brand-text {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.nav-link.is-active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.16));
  border-color: rgba(124, 92, 255, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Dark-mode-only: remove theme toggle affordance */
[data-theme-toggle] {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(34, 211, 238, 0.85));
  color: rgba(7, 10, 20, 0.95);
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  box-shadow: 0 14px 40px rgba(124, 92, 255, 0.18);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

a[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}

.btn[aria-disabled="true"] {
  opacity: 0.6;
}

button.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
}

.icon {
  font-size: 16px;
  line-height: 1;
}

/* Typography */
h1, h2, h3 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.08;
}

h2 {
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.2;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
}

p { margin: 0 0 14px; }

.lead { font-size: 18px; color: var(--text); max-width: 70ch; }
.muted { color: var(--muted); }
.micro { font-size: 13px; color: var(--faint); }
.eyebrow {
  display: inline-block;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Layout sections */
.section {
  padding: var(--space-7) 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.section-foot {
  margin-top: var(--space-4);
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-5);
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow);
}

.panel-title {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 12px;
}

/* Hero */
.hero {
  padding: clamp(40px, 6vw, 92px) 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-6);
  align-items: center;
}

.hero-copy .lead { margin-top: 14px; }

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 18px;
}

.social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 160ms ease, background 160ms ease;
}

.pill:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
}

.hero-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: var(--space-4);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.avatar-wrap {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 22px;
  background: radial-gradient(500px 240px at 30% 20%, rgba(124, 92, 255, 0.25), transparent 60%);
  border: 1px solid var(--border);
}

.avatar {
  width: 240px;
  height: 240px;
  border-radius: 22px;
  object-fit: cover;
}

.hero-metrics {
  display: grid;
  gap: 10px;
  margin-top: var(--space-3);
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.metric-value {
  font-size: 13px;
  color: var(--text);
}

.page-hero {
  padding: clamp(26px, 4vw, 56px) 0;
}

/* Cards / grids */
.grid.cards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
}

.grid.cards > .card {
  grid-column: span 4;
}

.card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 92, 255, 0.35);
}

.card-media {
  --cover: none;
  height: 130px;
  background:
    var(--cover),
    radial-gradient(700px 140px at 10% 20%, rgba(124, 92, 255, 0.35), transparent 60%),
    radial-gradient(500px 150px at 80% 0%, rgba(34, 211, 238, 0.25), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  background-size: cover, auto, auto, auto;
  background-position: center, center, center, center;
  background-repeat: no-repeat;
}

/* Logo blocks (optional images via --logo) */
.logo {
  --logo: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    var(--logo),
    radial-gradient(60px 40px at 30% 20%, rgba(124, 92, 255, 0.30), transparent 60%),
    radial-gradient(60px 40px at 80% 20%, rgba(34, 211, 238, 0.22), transparent 60%),
    rgba(255, 255, 255, 0.04);
  background-size: cover, auto, auto, auto;
  background-position: center;
  background-repeat: no-repeat;
  flex: 0 0 auto;
}

.logo-sm {
  width: 32px;
  height: 32px;
  border-radius: 12px;
}

.t-meta {
  display: grid;
  gap: 6px;
}

.t-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-body {
  padding: var(--space-4);
}

.card-title {
  font-size: 18px;
  margin-bottom: 8px;
}

.card-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cert-viewer {
  margin-top: 12px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.cert-tools {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 10, 20, 0.25);
}

.cert-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.cert-tool:hover {
  background: var(--surface-2);
}

.cert-frame {
  width: 100%;
  height: clamp(200px, 32vh, 300px);
  border: 0;
  display: block;
  background: transparent;
}

.cert-image {
  width: 100%;
  height: auto;
  display: block;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.tag {
  font-size: 12px;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Filters */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  font-weight: 600;
}

.chip:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
}

.chip.is-active {
  border-color: rgba(34, 211, 238, 0.45);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(124, 92, 255, 0.18));
}

/* Lists */
.icon-list {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin-right: 10px;
  vertical-align: middle;
}

.bullets {
  margin: 0;
  padding-left: 18px;
}

.bullets li {
  margin-bottom: 8px;
  color: var(--muted);
}

/* Timeline */
.timeline {
  display: grid;
  gap: var(--space-4);
}

.t-item {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.t-role { font-weight: 700; }

/* Forms */
.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

input, textarea {
  width: 100%;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  transition: border-color 160ms ease, background 160ms ease;
}

input:focus, textarea:focus {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.form-status {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(7, 10, 20, 0.35);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0 var(--space-3);
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
}

.footer-links a {
  color: inherit;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  padding: 0 0 var(--space-5);
}

/* Reveal animations */
[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
}

.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 500ms ease, transform 500ms ease;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .btn, .pill, .card, .chip, .icon-btn, .nav-link { transition: none !important; }
  [data-reveal], .is-visible { transition: none !important; transform: none !important; opacity: 1 !important; }
}

/* Responsive */
@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .t-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .grid.cards > .card {
    grid-column: span 6;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: clamp(28px, 7.5vw, 40px);
    line-height: 1.12;
  }
  h2 { font-size: clamp(20px, 5.2vw, 26px); }
  .lead { font-size: 16px; }

  .grid.cards {
    gap: 16px;
  }
  .grid.cards > .card {
    grid-column: span 12;
  }

  .header-inner {
    padding: 10px 0;
    gap: 10px;
  }

  .brand { order: 1; }
  .header-actions {
    order: 2;
    width: auto;
    justify-content: flex-end;
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding-right: 42px; /* room for scroll hint */
    scroll-padding-right: 42px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  /* Mobile hint: show there's more nav items to the right */
  .site-nav.is-scrollable:not(.is-at-end)::after {
    content: '›';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: var(--muted);
    font-size: 22px;
    background: linear-gradient(90deg, transparent, var(--bg0));
    pointer-events: none;
  }

  .site-nav::-webkit-scrollbar { display: none; }
  .nav-link { white-space: nowrap; }

  .section { padding: var(--space-6) 0; }
  .panel { padding: var(--space-3); }
  .card-body { padding: var(--space-3); }
  .card-media { height: 96px; }
  .t-item { padding: var(--space-3); gap: var(--space-4); }
  .hero-inner { gap: var(--space-4); }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; }
}

/* Simple key/value list */
.kv {
  margin: 0;
}

.kv-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.kv-row:first-child {
  border-top: none;
  padding-top: 0;
}

.kv dt {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.kv dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.stack {
  display: grid;
  gap: 10px;
}
