:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, #0f172a 0, transparent 55%),
    radial-gradient(circle at 100% 100%, #1e293b 0, transparent 55%),
    radial-gradient(circle at 100% 0%, #020617 0, #020617 55%);
  color: #e5e7eb;
}

a {
  color: #7dd3fc;
  text-decoration: none;
}

a:hover {
  color: #38bdf8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  body {
    animation: bgShade 36s ease-in-out infinite alternate;
  }
}

@keyframes bgShade {
  0% {
    background-position: 0% 0%, 100% 100%, 100% 0%;
  }
  50% {
    background-position: 4% 10%, 96% 90%, 100% 0%;
  }
  100% {
    background-position: 0% 6%, 100% 94%, 100% 0%;
  }
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.app-shell main {
  flex: 1;
  padding-top: 0.5rem;
  position: relative;
}

.portfolio-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: stretch;
  margin-top: 2.5rem;
}

.portfolio-rail {
  position: relative;
  align-self: stretch;
}

.rail-inner {
  border-radius: 1.5rem;
  padding: 1.75rem 1.5rem;
  background: radial-gradient(circle at 0 0, #0f172a, #020617);
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow:
    0 18px 60px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rail-inner::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    circle at 0 0,
    rgba(56, 189, 248, 0.2),
    transparent 55%
  );
  opacity: 0.6;
  mix-blend-mode: screen;
  animation: railGlow 18s linear infinite alternate;
  pointer-events: none;
}

.rail-avatar {
  width: 132px;
  height: 132px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(148, 163, 184, 0.7);
  margin-bottom: 1rem;
}

.rail-name {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-role {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.rail-tagline {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.rail-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.chip {
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
}

.rail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  color: #9ca3af;
}

.rail-meta a {
  font-weight: 500;
}

.rail-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.rail-social a {
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
}

.rail-social a:hover {
  border-bottom-color: rgba(125, 211, 252, 0.9);
  color: #e0f2fe;
}

.rail-resume {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.8);
  background: radial-gradient(circle at 0 0, #0f172a, #020617);
  color: #e5e7eb;
  cursor: pointer;
  column-gap: 0.5rem;
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease;
}

.rail-resume:hover {
  background: linear-gradient(135deg, #0369a1, #0f172a);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.portfolio-main {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-top: 1.5rem;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 50;
  background: rgba(15, 23, 42, 0.9);
}

.scroll-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #38bdf8, #6366f1);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

.section {
  border-radius: 1.5rem;
  padding: 1.75rem 1.75rem 1.85rem;
  background: radial-gradient(circle at 0 0, #1d283a, #020617);
  border: 2px solid rgba(30, 64, 175, 0.7);
  box-shadow:
    0 20px 45px rgba(15, 23, 42, 0.85),
    0 0 0 1px rgba(15, 23, 42, 0.9);
  scroll-margin-top: 5.5rem;
}

.section.with-trail {
  position: relative;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .section.with-trail::before {
    content: '';
    position: absolute;
    width: 40px;
    aspect-ratio: 2 / 1;
    background: radial-gradient(
      100% 100% at right,
      rgba(56, 189, 248, 0.9),
      transparent 55%
    );
    offset-path: border-box;
    offset-anchor: 100% 50%;
    animation: sectionTrail 22s ease-in-out infinite;
    pointer-events: none;
  }
}

.section h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}

.section-body {
  font-size: 0.95rem;
  color: #e5e7eb;
}

.section-body p {
  margin: 0 0 0.85rem;
}

.section-body p:last-child {
  margin-bottom: 0;
}

.hero {
  background: radial-gradient(circle at 0 0, #1d283a, #020617);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.2), transparent 55%);
  opacity: 0.85;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero > * {
  position: relative;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.hero h2 {
  margin: 0 0 0.75rem;
  font-size: 1.9rem;
  line-height: 1.15;
}

.lede {
  margin: 0 0 1.5rem;
  max-width: 48rem;
  font-size: 1rem;
  color: #cbd5f5;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.hero-card {
  padding: 1rem 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.92rem;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.85);
  border-color: rgba(129, 140, 248, 0.85);
}

.hero-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.hero-card p {
  margin: 0;
  color: #e5e7eb;
}

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

.skills-grid h4 {
  margin: 0 0 0.6rem;
  font-size: 0.98rem;
  color: #cbd5f5;
}

.skills-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.skills-grid li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}

.skills-grid li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #38bdf8;
}

.cards-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

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

.card-block {
  padding: 1.1rem 1.1rem 1.3rem;
  border-radius: 1rem;
  background: radial-gradient(circle at 0 0, #111827, #020617);
  border: 1px solid rgba(30, 64, 175, 0.7);
  font-size: 0.9rem;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.card-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.95);
  border-color: rgba(129, 140, 248, 0.8);
}

.card-block header {
  margin-bottom: 0.5rem;
}

.card-block h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: #e5e7eb;
}

.card-block .meta {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: #9ca3af;
}

.card-block ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.card-block li {
  margin-bottom: 0.4rem;
}

.card-block .tag {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.card-block p {
  margin: 0;
}

.contact-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.8fr);
  gap: 1.75rem;
  align-items: flex-start;
}

.contact-body p {
  margin: 0;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.field label {
  color: #9ca3af;
}

.field input,
.field textarea {
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.55rem 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 0.9rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.primary-button {
  align-self: flex-start;
  margin-top: 0.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #020617;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.primary-button.is-sending {
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.55);
}

.primary-button.is-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 10px 26px rgba(22, 163, 74, 0.6);
}

.primary-button.is-error {
  background: linear-gradient(135deg, #f97316, #ef4444);
  box-shadow: 0 10px 26px rgba(239, 68, 68, 0.6);
}

.button-spinner {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.2);
  border-top-color: #020617;
  margin-right: 0.45rem;
  background: radial-gradient(circle at 30% 0, #fee2e2, transparent 60%);
  animation: resumeSpin 0.7s linear infinite;
}

.portfolio-footer {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
  text-align: right;
}

@keyframes railGlow {
  0% {
    transform: translate3d(-10%, -10%, 0);
    opacity: 0.3;
  }
  50% {
    transform: translate3d(5%, 5%, 0);
    opacity: 0.8;
  }
  100% {
    transform: translate3d(15%, 10%, 0);
    opacity: 0.5;
  }
}

@keyframes sectionTrail {
  to {
    offset-distance: 100%;
  }
}

@keyframes resumeSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 960px) {
  .portfolio-page {
    margin-top: 2.5rem;
    padding: 1.5rem 1.25rem 2.5rem;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 1.4rem 1.25rem 1.5rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .skills-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-body {
    grid-template-columns: minmax(0, 1fr);
  }
}
