* {
  box-sizing: border-box;
}

:root {
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-dark: #059669;

  --bg: #0a0e0c;
  --bg-alt: #0d1310;
  --surface: #121815;
  --surface-2: #171f1b;
  --surface-soft: rgba(16, 185, 129, 0.08);

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(16, 185, 129, 0.28);

  --text-primary: #f3f6f4;
  --text-secondary: #a6b3ad;
  --text-muted: #78867f;

  --radius: 14px;
  --radius-sm: 8px;
  --gutter: clamp(20px, 4vw, 72px);
  --container: 1200px;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: "Inter", -apple-system, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  margin: 0;
}

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

a {
  color: inherit;
}

img {
  max-width: 100%;
  vertical-align: middle;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

button {
  font-family: inherit;
}

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

.section-text {
  color: var(--text-secondary);
  max-width: 640px;
  font-size: 15px;
  line-height: 1.75;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}

/* Scroll reveal, only active once JS confirms it can restore the elements */
.js-ready .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 12, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.6);
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--gutter);
}

.logo img {
  max-height: 44px;
}

.nav ul {
  display: flex;
  gap: 28px;
}

.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav a:hover {
  color: var(--text-primary);
}

.nav a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 0 auto;
  background: var(--text-primary);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #05170f;
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  background: var(--surface-soft);
}

.btn-outline:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: var(--accent);
}

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

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 13px;
}

/* Social icon row, reused in hero / contact / footer
   ========================================================================== */

.social-row {
  display: flex;
  gap: 10px;
}

.social-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.social-row a:hover {
  color: var(--accent-light);
  border-color: var(--border-strong);
  background: var(--surface-soft);
  transform: translateY(-2px);
}

/* Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: 72px 0 64px;
}

.hero-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0.05) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-glow.is-visible {
  opacity: 1;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 5vw;
}

.hero-text {
  flex: 1.15;
}

.hero-visual {
  flex: 1.05;
  max-width: 480px;
}

.eyebrow {
  font-family: var(--mono);
  color: var(--accent-light);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 12px;
}

.eyebrow-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  background: var(--accent-light);
  vertical-align: -2px;
  animation: eyebrow-blink 0.9s step-end infinite;
}

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

.hero-text h1 {
  font-size: clamp(36px, 4.6vw, 54px);
  line-height: 1.08;
  font-weight: 800;
  margin: 0 0 18px;
}

.hero-tagline {
  font-family: var(--mono);
  color: var(--text-muted);
  font-size: 13px;
  max-width: 460px;
  margin: 0 0 18px;
}

.hero-desc {
  color: var(--text-secondary);
  max-width: 460px;
  font-size: 16px;
  margin: 0 0 32px;
}

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

.hero-image {
  position: relative;
}

.hero-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
}

.hero-availability {
  margin: 18px 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}

.hero-availability-accent {
  color: var(--accent-light);
}

.hero-social {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.hero-social .social-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px;
  gap: 6px;
}

.social-row-contact,
.footer-social {
  gap: 6px;
}

.hero-social .social-row a,
.social-row-contact a,
.footer-social a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border-color: transparent;
  font-size: 18px;
}

.hero-social .social-row a:hover,
.social-row-contact a:hover,
.footer-social a:hover {
  background: var(--surface-soft);
}

/* Shared section layout
   ========================================================================== */

.about, .experience, .skills, .projects, .contact {
  padding: 80px 0;
}

.section-label {
  font-family: var(--mono);
  display: inline-block;
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 10px;
}

.about h2, .experience h2, .skills h2, .projects h2, .contact h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
}

.section-wave {
  display: block;
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 54px;
}

.section-wave--to-alt path {
  fill: var(--bg-alt);
}

.section-wave--to-base path {
  fill: var(--bg);
}

/* About
   ========================================================================== */

.about {
  position: relative;
  background: var(--bg-alt);
}

.about-inner {
  display: flex;
  align-items: center;
  gap: 7vw;
}

.about-image {
  position: relative;
  flex-shrink: 0;
  width: 380px;
}

.about-shape {
  position: absolute;
  border-radius: var(--radius);
  z-index: 0;
}

.about-shape-1 {
  width: 70px;
  height: 70px;
  border: 1px solid var(--border-strong);
  top: -16px;
  left: -20px;
}

.about-shape-2 {
  width: 90px;
  height: 90px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  bottom: -20px;
  right: -22px;
}

/* Grounds the cutout so its flat bottom edge doesn't float in empty space */
.about-image-card {
  position: absolute;
  z-index: 1;
  left: 5%;
  right: 5%;
  top: 48%;
  bottom: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.about-image img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: block;
}

.about-content {
  flex: 1;
  max-width: 660px;
}

/* Experience & Education
   ========================================================================== */

.experience {
  background: var(--bg);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 32px;
}

.timeline-item {
  position: relative;
  padding-left: 22px;
  border-left: 1px solid var(--border);
  transition: border-color 1.1s ease;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 1s ease, transform 1s ease, box-shadow 1s ease;
}

.timeline-item.is-active {
  border-left-color: var(--accent);
}

.timeline-item.is-active::before {
  background: var(--accent);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--surface-soft);
}

.timeline-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.timeline-title {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 6px;
}

.timeline-company {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 14px;
}

.timeline-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0;
}

.timeline-bullets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 620px;
}

.timeline-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.timeline-bullets li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.timeline-divider {
  margin-top: 56px;
}

/* Skills
   ========================================================================== */

.skills {
  position: relative;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 48px;
  margin-top: 28px;
}

.skills-cell {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 17px 0;
  border-bottom: 1px solid var(--border);
}

.skills-cell-label {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
}

.skills-cell-values {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--accent-light);
  text-align: right;
  margin: 0;
}

/* Projects
   ========================================================================== */

.projects {
  position: relative;
  background: var(--bg-alt);
}

.projects-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
}

.carousel-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.carousel-btn svg {
  width: 18px;
  height: 18px;
}

.carousel-btn:hover {
  background: var(--accent);
  color: #05170f;
}

.projects-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.projects-track::-webkit-scrollbar {
  display: none;
}

.project-item {
  scroll-snap-align: start;
  flex: 0 0 calc((100% - 40px) / 3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.project-item:hover {
  border-color: var(--border-strong);
}

.project-thumb {
  position: relative;
  height: 170px;
}

.project-thumb picture {
  display: block;
  height: 100%;
}

.project-thumb-empty {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  background: linear-gradient(180deg, rgba(5, 8, 7, 0) 45%, rgba(5, 8, 7, 0.7) 100%);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-item:hover .project-overlay {
  opacity: 1;
}

.project-overlay-chip {
  background: var(--accent);
  color: #05170f;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.project-body {
  flex: 1;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.project-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
}

.project-name a {
  text-decoration: none;
}

.project-name a:hover {
  color: var(--accent-light);
}

.project-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  min-height: 110px;
}

.tech-tag {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--accent-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.project-disclaimer {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 10.5px;
  font-style: italic;
  line-height: 1.5;
  color: var(--text-muted);
  min-height: 60px;
}

/* Contact
   ========================================================================== */

.contact-inner {
  display: flex;
  align-items: flex-start;
  gap: 6vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 56px);
}

.contact-content {
  flex: 1;
  max-width: 420px;
}

.contact-content .social-row {
  margin-top: 24px;
}

.contact-form {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form[hidden] {
  display: none;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-row input,
.form-row textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--border-strong);
}

/* Honeypot field, kept off-screen for real users, visible to simple bots */
.form-row-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-submit {
  margin-top: 4px;
}

.form-recaptcha-note {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 0;
}

.form-recaptcha-note a {
  color: var(--text-secondary);
}

.form-success {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.form-success[hidden] {
  display: none;
}

.form-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 0 18px;
}

.form-success-eyebrow {
  font-family: var(--mono);
  color: var(--accent-light);
  font-size: 12px;
  margin: 0 0 8px;
}

.form-success h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px;
}

.form-success p {
  color: var(--text-secondary);
  font-size: 13.5px;
  max-width: 320px;
  margin: 0 0 22px;
}

.toast[hidden] {
  display: none;
}

.toast {
  position: fixed;
  z-index: 300;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 48px));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast:not([hidden]).is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast.is-success .toast-icon {
  color: var(--accent-light);
}

.toast.is-error .toast-icon {
  color: #f87171;
}

.back-to-top {
  position: fixed;
  z-index: 200;
  left: 24px;
  bottom: 24px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.25s ease, color 0.2s ease;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  color: var(--accent-light);
}

/* CV preview modal
   ========================================================================== */

.cv-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cv-modal[hidden] {
  display: none;
}

.cv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 7, 0.8);
}

.cv-modal-panel {
  position: relative;
  width: min(760px, 100%);
  height: min(85vh, 900px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cv-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}

.cv-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv-modal-actions .btn-sm {
  height: 36px;
  padding: 0 16px;
}

.cv-modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-modal-close:hover {
  border-color: var(--border-strong);
}

.cv-modal-panel iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
}

/* Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-alt);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 24px var(--gutter);
}

.footer-brand {
  justify-self: start;
}

.footer-brand img {
  max-height: 28px;
}

.footer-social {
  justify-self: center;
}

.copyright {
  justify-self: end;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
}

/* 404 page
   ========================================================================== */

.not-found {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px;
}

.not-found .eyebrow {
  margin-bottom: 6px;
}

.not-found h1 {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 800;
  margin-bottom: 12px;
}

.not-found p {
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 0 28px;
}
