:root {
  --bg: #0f172a;
  --bg-elev: #111d34;
  --bg-soft: #18253f;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --line: #24344f;
  --accent: #facc15;
  --accent-strong: #eab308;
  --ok-bg: #113622;
  --ok-line: #1f7a40;
  --ok-text: #b7f7cc;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

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

a,
button,
input,
textarea {
  transition: all 0.2s ease;
}

h1,
h2,
h3,
h4,
p,
ul {
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.page-main {
  padding-bottom: 2rem;
}

.section {
  padding: 4.5rem 0;
}

.section-muted {
  background: var(--bg-elev);
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h1,
.section-header h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-header p,
.section p.lead {
  color: var(--muted);
  margin-top: 0.75rem;
  max-width: 760px;
}

.page-header {
  background: linear-gradient(135deg, #162540, #0f1b32);
  border-bottom: 1px solid var(--line);
  padding: 3.5rem 0;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 1.5rem;
}

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

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

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

.span-2 {
  grid-column: span 2;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
}

.card:hover {
  transform: translateY(-2px);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.28rem 0.62rem;
  font-size: 0.77rem;
  border-radius: 999px;
  background: #203355;
  color: #f0f6ff;
  border: 1px solid #2f4a76;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 10px;
  padding: 0.72rem 1rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

.btn-primary {
  background: var(--accent-strong);
  color: #201500;
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-outline {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: #2a2408;
}

.link-accent {
  color: var(--accent);
}

.link-accent:hover {
  text-decoration: underline;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #0f1b32f0;
  backdrop-filter: blur(7px);
  border-bottom: 1px solid var(--line);
}

.nav-row {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-name {
  color: var(--accent);
  font-weight: 800;
  font-size: 1.2rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.primary-nav a,
.mobile-nav a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  color: #d7e2f3;
  font-size: 0.94rem;
  border-bottom: 2px solid transparent;
}

.primary-nav a:hover,
.mobile-nav a:hover {
  color: var(--accent);
  background: #1a2a47;
}

nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.social-link {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #33496d;
  border-radius: 10px;
  color: #e6edf8;
  background: #14243f;
}

.social-link:hover {
  color: #1b1400;
  background: var(--accent);
}

.social-link svg,
.menu-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
  stroke: currentColor;
}

.menu-toggle {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid #33496d;
  border-radius: 10px;
  color: #e6edf8;
  background: #14243f;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  width: min(1120px, 92vw);
  margin: 0 auto 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #12213b;
  padding: 0.45rem;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav:not([hidden]) {
  display: block;
}

.hero {
  background: linear-gradient(135deg, #162540, #0f1b32);
  padding: 5rem 0;
}

.hero-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
  grid-template-columns: 1.1fr 1fr;
}

.hero-title {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--muted);
  margin-top: 0.8rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.typing-cursor {
  display: inline-block;
  margin-left: 0.12em;
  color: var(--accent);
  animation: blink-cursor 0.9s steps(1) infinite;
}

@keyframes blink-cursor {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.hero-image-zone {
  display: flex;
  justify-content: center;
}

.hero-image-wrap {
  position: relative;
}

.hero-image-wrap::before {
  content: "";
  position: absolute;
  inset: -0.7rem;
  border-radius: 1.8rem;
  background: rgba(250, 204, 21, 0.2);
  filter: blur(24px);
}

.hero-image-frame {
  position: relative;
  width: min(340px, 72vw);
  aspect-ratio: 4 / 5;
  border-radius: 1.5rem;
  overflow: hidden;
  background: #101c34;
}

.animated-glow-border {
  border: 2px solid rgba(250, 204, 21, 0.75);
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.35) inset,
    0 0 18px rgba(234, 179, 8, 0.45),
    0 0 34px rgba(234, 179, 8, 0.28);
  animation: glow-line-pulse 2.6s ease-in-out infinite;
}

@keyframes glow-line-pulse {
  0%,
  100% {
    border-color: rgba(250, 204, 21, 0.55);
    box-shadow:
      0 0 0 1px rgba(250, 204, 21, 0.28) inset,
      0 0 14px rgba(234, 179, 8, 0.38),
      0 0 24px rgba(234, 179, 8, 0.2);
  }
  50% {
    border-color: rgba(250, 204, 21, 0.95);
    box-shadow:
      0 0 0 1px rgba(250, 204, 21, 0.48) inset,
      0 0 24px rgba(234, 179, 8, 0.62),
      0 0 42px rgba(234, 179, 8, 0.36);
  }
}

.hero-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 2fr 1fr;
}

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

.project-card {
  overflow: hidden;
}

.project-cover {
  height: 160px;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.cover-blue {
  background: linear-gradient(135deg, #2f64b5, #214a89);
}

.cover-green {
  background: linear-gradient(135deg, #31975e, #1f6840);
}

.cover-purple {
  background: linear-gradient(135deg, #7c4ad2, #5c36a6);
}

.cover-orange {
  background: linear-gradient(135deg, #d27f36, #9f5d1f);
}

.cover-pink {
  background: linear-gradient(135deg, #cf458e, #9f2f6d);
}

.cover-teal {
  background: linear-gradient(135deg, #29959c, #186f75);
}

.timeline {
  border-left: 2px solid #36527f;
  margin-left: 0.5rem;
  padding-left: 1.5rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.05rem;
  top: 0.6rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px #1b2b48;
}

.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 2fr 1fr;
}

.form-row {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: #dbe7f8;
}

input,
textarea,
select {
  width: 100%;
  background: #101c34;
  color: var(--text);
  border: 1px solid #30486f;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #91a6c8;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18);
}

.submit-btn {
  width: 100%;
}

#success-message {
  margin-top: 0.9rem;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok-text);
}

#success-message[hidden] {
  display: none;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: #0a1326;
  padding: 2.2rem 0;
}

.footer-connect h4 {
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.75rem;
}

.connect-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem 1.2rem;
  color: var(--muted);
}

.connect-links a:hover {
  color: var(--accent);
}

.footer-legal {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  text-align: center;
  color: #9fb2d0;
  font-size: 0.92rem;
}

#download-resume,
#scroll-to-top {
  position: fixed;
  z-index: 70;
  border: 1px solid #334d78;
  background: #0c1730;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

#download-resume {
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 600;
}

#download-resume svg,
#scroll-to-top svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

#download-resume span {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
}

#download-resume:hover {
  background: var(--accent-strong);
  color: #221700;
}

#download-resume:hover span {
  max-width: 12rem;
  opacity: 1;
}

#scroll-to-top {
  right: 1rem;
  bottom: 1rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#scroll-to-top:hover {
  background: var(--accent-strong);
  color: #221700;
}

@media (max-width: 980px) {
  .primary-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero-grid,
  .preview-grid,
  .contact-grid,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

  .hero-image-zone {
    order: -1;
  }
}

@media (max-width: 720px) {
  .social-link {
    display: none;
  }

  .grid-2,
  .grid-3,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .section {
    padding: 3rem 0;
  }

  .page-header {
    padding: 2.6rem 0;
  }
}
