/* ============================================================
   Nayib Martin Goushesh — n-cryptd.github.io
   Zero-dependency stylesheet. Dark-first, auto light mode.
   ============================================================ */

:root {
  --bg: #0b0d12;
  --bg-soft: #10131a;
  --card: #141824;
  --border: #232a38;
  --text: #e7eaf1;
  --muted: #9aa4b5;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 92, 246, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fb;
    --bg-soft: #eef0f6;
    --card: #ffffff;
    --border: #e2e6ee;
    --text: #1b2334;
    --muted: #5d6878;
    --accent: #7c3aed;
    --accent-2: #0891b2;
    --accent-soft: rgba(124, 58, 237, 0.09);
    --shadow: 0 10px 24px rgba(23, 30, 55, 0.08);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

section { scroll-margin-top: 84px; }

h1, h2, h3, h4 { line-height: 1.2; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }

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

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-cta {
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent) !important;
  font-weight: 600;
}
.nav-cta:hover { background: var(--accent-soft); }

/* ---------- Hero ---------- */

.hero {
  padding: 88px 0 64px;
  background:
    radial-gradient(600px 300px at 20% -10%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 280px at 85% 0%, rgba(34, 211, 238, 0.08), transparent 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 14px;
  background: var(--bg-soft);
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  margin: 20px 0 8px;
  letter-spacing: -0.02em;
}

.hero .title-line {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 18px;
}

.hero .lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(90deg, var(--accent), #6d28d9);
  color: #fff;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.35);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-soft);
}

.hero-meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.hero-meta a { color: var(--muted); }
.hero-meta a:hover { color: var(--text); }

/* ---------- Sections ---------- */

.section { padding: 56px 0; }
.section-alt { background: var(--bg-soft); }

.section-head { margin-bottom: 30px; }

.section-head h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.section-head .kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 4px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
  max-width: 65ch;
}

/* ---------- Cards / grids ---------- */

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-2px); }

.card h3 { margin: 0 0 4px; font-size: 1.08rem; }
.card .subtitle {
  color: var(--accent-2);
  font-size: 0.83rem;
  font-weight: 600;
  margin: 0 0 10px;
}
.card p { color: var(--muted); font-size: 0.95rem; margin: 0 0 12px; }

.impact {
  font-size: 0.85rem;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  margin: 0 0 12px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-size: 0.78rem;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.service-stats {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 12px 0 0 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  position: relative;
  padding: 0 0 28px 28px;
  border-left: 2px solid var(--border);
  margin-left: 6px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}

.timeline .role { margin: 0; font-weight: 700; font-size: 1.02rem; }
.timeline .org {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 2px 0 8px;
}
.timeline .org .type {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.75rem;
  margin-left: 8px;
}
.timeline p { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* ---------- Skills ---------- */

.skill-row { margin: 0 0 16px; }
.skill-row .name {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.skill-row .name span:last-child { color: var(--muted); }

.bar {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.skill-groups h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 22px 0 10px;
}

/* ---------- Blog ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }

.post-list li {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.post-list li:last-child { border-bottom: none; }

.post-list h3 { margin: 0 0 6px; font-size: 1.15rem; }
.post-list h3 a { color: var(--text); }
.post-list h3 a:hover { color: var(--accent); text-decoration: none; }

.post-list .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.post-list p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.tag {
  display: inline-block;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
  margin-right: 4px;
  color: var(--muted);
}

/* ---------- Post page ---------- */

.post { max-width: 760px; padding-top: 48px; padding-bottom: 48px; }

.post-title { font-size: clamp(1.8rem, 4.5vw, 2.5rem); margin: 0 0 10px; letter-spacing: -0.02em; }

.post-meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 26px; }

.post-excerpt {
  color: var(--muted);
  font-size: 1.08rem;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 0 0 30px;
}

.post-content { font-size: 1.02rem; }
.post-content h2 { margin-top: 2em; font-size: 1.4rem; }
.post-content img { max-width: 100%; border-radius: var(--radius); }
.post-content pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
}
.post-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.2em 0;
  padding: 2px 0 2px 16px;
  color: var(--muted);
}

.post-nav { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ---------- Contact ---------- */

.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 36px 0;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.footer-name { margin: 0; font-weight: 700; }
.footer-sub { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-copy { margin: 0; color: var(--muted); font-size: 0.85rem; }

/* ---------- 404 ---------- */

.not-found { text-align: center; padding: 100px 24px; }
.not-found h1 { font-size: 3.4rem; margin: 0 0 8px; }
.not-found p { color: var(--muted); }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .nav { height: auto; padding-top: 12px; padding-bottom: 12px; flex-direction: column; align-items: flex-start; }
  .nav-links { gap: 14px; }
  .hero { padding: 56px 0 44px; }
  .section { padding: 40px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card { transition: none; }
  .aurora span, .flight .plane, .hero-badge .dot, .timeline li::before { animation: none !important; }
  .flight { display: none; }
}

/* ============================================================
   Design flare — aurora hero, flight path, scroll reveals,
   micro-interactions. Pure CSS, no JavaScript.
   ============================================================ */

::selection { background: var(--accent); color: #fff; }

html { scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Nav: brand dot + gradient underline on hover ---------- */

.brand::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
}

.nav-links a:not(.nav-cta) {
  position: relative;
  padding: 4px 0;
}
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: right 0.25s ease;
}
.nav-links a:not(.nav-cta):hover::after { right: 0; }

/* ---------- Hero: aurora blobs, gradient name, flight path ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.aurora {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) {
  width: 480px; height: 480px;
  left: 6%; top: -160px;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 70%);
}
.aurora span:nth-child(2) {
  width: 430px; height: 430px;
  right: 4%; top: -80px;
  background: radial-gradient(circle at 60% 40%, color-mix(in srgb, var(--accent-2) 35%, transparent), transparent 70%);
  animation-delay: -6s;
  animation-duration: 22s;
}
.aurora span:nth-child(3) {
  width: 400px; height: 400px;
  left: 42%; bottom: -200px;
  background: radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.20), transparent 70%);
  animation-delay: -12s;
  animation-duration: 26s;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(48px, 34px, 0) scale(1.16); }
}

@media (prefers-color-scheme: light) {
  .aurora span { opacity: 0.38; }
}

.hero h1 {
  background: linear-gradient(115deg, var(--text) 45%, var(--accent) 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  width: fit-content;
}

.hero-badge .dot { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.btn-primary {
  background-size: 150% 100%;
  background-position: 0% 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-position 0.4s ease;
}
.btn-primary:hover {
  background-position: 90% 0;
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.5);
}

.flight {
  position: absolute;
  top: 48px;
  right: 3%;
  width: 560px;
  height: 240px;
  pointer-events: none;
  color: color-mix(in srgb, var(--muted) 60%, transparent);
}
.flight .trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.flight .plane {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  offset-path: path("M0,190 C140,40 320,20 540,90");
  offset-rotate: auto;
  filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 45%, transparent));
  animation: fly 12s linear infinite;
}
@keyframes fly {
  0%   { offset-distance: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
@media (max-width: 1000px) {
  .flight { display: none; }
}

/* ---------- Cards: gradient top edge + glow on hover ---------- */

.card {
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.card:hover::before { transform: scaleX(1); }
.card:hover {
  box-shadow: var(--shadow);
}
.chip {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
}

/* ---------- Timeline: gradient line + soft pulse ---------- */

.timeline li:not(:last-child) {
  border-image: linear-gradient(180deg, var(--accent), var(--accent-2)) 1;
}
.timeline li::before { animation: glowdot 3.2s ease-in-out infinite; }
@keyframes glowdot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.30); }
  50%      { box-shadow: 0 0 0 7px rgba(139, 92, 246, 0); }
}

/* ---------- Section headings + footer + post accents ---------- */

.section-head .kicker { display: inline-flex; align-items: center; gap: 8px; }
.section-head .kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.site-footer {
  border-top-color: transparent;
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: 0.7;
}

.post-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ---------- Scroll-driven reveals (progressive enhancement) ---------- */

@supports (animation-timeline: view()) {
  .section-head, .card, .timeline li {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 42%;
  }
  .bar i {
    transform-origin: left;
    animation: grow linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
  @keyframes rise {
    from { opacity: 0; translate: 0 26px; }
    to   { opacity: 1; translate: 0 0; }
  }
  @keyframes grow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }
  @media (prefers-reduced-motion: reduce) {
    .section-head, .card, .timeline li, .bar i { animation: none !important; }
  }
}
