:root {
  --bg: #f8f5ef;
  --surface: #ffffff;
  --surface-2: #eef6f4;
  --text: #18201f;
  --muted: #5d6a67;
  --line: #dfe5df;
  --accent: #0d7c66;
  --accent-2: #c04c2f;
  --ink: #111827;
  --shadow: 0 24px 70px rgba(24, 32, 31, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

body.dark {
  --bg: #101615;
  --surface: #17211f;
  --surface-2: #1f2b28;
  --text: #f4f7f5;
  --muted: #aebbb7;
  --line: #2e3b37;
  --accent: #4fc3a5;
  --accent-2: #ff956f;
  --ink: #f6f7f8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a,
.theme-toggle,
.nav-toggle,
.filters button,
.card-actions button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.site-nav a {
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.site-nav a.active,
.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.theme-toggle,
.nav-toggle {
  width: 42px;
  height: 42px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav-toggle {
  display: none;
}

main {
  overflow: hidden;
}

.hero {
  min-height: calc(100vh - 79px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
  padding: clamp(34px, 6vw, 82px) clamp(18px, 6vw, 88px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  font-size: 1.2rem;
  letter-spacing: 0;
}

.lead,
.page-hero p,
.section-copy p,
.project-card p,
.document-card p,
.profile-panel p,
.timeline p {
  color: var(--muted);
  line-height: 1.75;
}

.lead {
  max-width: 780px;
  font-size: 1.12rem;
}

.hero-actions,
.social-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-weight: 800;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button.ghost {
  background: var(--surface);
}

.social-row {
  margin-top: 26px;
}

.social-row a,
.text-link {
  color: var(--accent);
  font-weight: 800;
}

.hero-visual {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: min(78vw, 510px);
  aspect-ratio: 1;
  border-radius: 42% 58% 44% 56%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: rotate(-8deg);
}

.hero-visual img {
  position: relative;
  width: min(78vw, 430px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 10px solid var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.status-card {
  position: absolute;
  left: 4%;
  bottom: 12%;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 270px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.pulse {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 clamp(18px, 6vw, 88px) 74px;
  border: 1px solid var(--line);
  background: var(--line);
}

.stats-band div {
  padding: 26px;
  background: var(--surface);
}

.stats-band strong {
  display: block;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.stats-band span {
  color: var(--muted);
  font-weight: 700;
}

.section-grid,
.timeline-section,
.contact-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(24px, 4vw, 58px);
  padding: 0 clamp(18px, 6vw, 88px) 86px;
}

.section-copy {
  max-width: 560px;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: center;
}

.skill-cloud span,
.tag-row span,
.modal-tags span,
.info-list span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.featured-section,
.document-section,
.skills-section {
  padding: 0 clamp(18px, 6vw, 88px) 86px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 540ms ease;
}

.carousel-track .project-card {
  min-width: 100%;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  transform: translateY(-50%);
}

.carousel-btn.prev {
  left: 14px;
}

.carousel-btn.next {
  right: 14px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.carousel-dots button {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
}

.carousel-dots button.active {
  background: var(--accent);
}

.project-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(24, 32, 31, 0.06);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.document-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(24, 32, 31, 0.06);
}

.project-card:hover {
  transform: translateY(-4px);
  transition: transform 220ms ease, box-shadow 220ms ease;
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 800;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.card-actions a,
.card-actions button {
  color: var(--accent);
  font-weight: 800;
}

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 clamp(18px, 6vw, 88px) 82px;
  padding: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
}

.cta-band .eyebrow {
  color: var(--accent-2);
}

.page-hero {
  padding: clamp(46px, 8vw, 100px) clamp(18px, 6vw, 88px) 54px;
  max-width: 1060px;
}

.page-hero h1 {
  font-size: clamp(2.7rem, 6vw, 5.7rem);
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline article,
.profile-panel,
.contact-form,
.contact-cards a {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.timeline span {
  color: var(--accent-2);
  font-weight: 800;
}

.profile-panel img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 18px;
}

.info-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.skill-bars {
  display: grid;
  gap: 18px;
}

.skill-bars div {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.skill-bars b {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.skill-bars i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.project-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 0 clamp(18px, 6vw, 88px) 28px;
}

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

.filters button {
  min-height: 42px;
  padding: 0 14px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 800;
}

.filters button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.search-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.search-box input,
.admin-editor input,
.admin-editor textarea,
.admin-panel input,
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.search-box input {
  min-height: 42px;
  padding: 0 14px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 0 clamp(18px, 6vw, 88px) 86px;
}

.loading {
  color: var(--muted);
  font-weight: 800;
}

.contact-layout {
  align-items: start;
  padding-top: 34px;
}

.contact-layout .page-hero {
  padding: 0;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 30px;
}

.contact-cards a {
  display: grid;
  gap: 8px;
}

.contact-cards span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.contact-form input,
.contact-form select {
  min-height: 48px;
  padding: 0 14px;
}

.contact-form textarea {
  padding: 14px;
  resize: vertical;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 0 clamp(18px, 6vw, 88px) 86px;
}

.admin-login-layout {
  display: grid;
  place-items: start center;
  padding: 0 clamp(18px, 6vw, 88px) 86px;
}

.login-panel {
  width: min(520px, 100%);
}

.admin-panel,
.admin-section,
.project-editor,
.admin-save-bar {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-panel {
  position: sticky;
  top: 96px;
}

.admin-editor {
  display: grid;
  gap: 18px;
}

.admin-section {
  display: grid;
  gap: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-editor label,
.admin-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.admin-editor input,
.admin-panel input {
  min-height: 46px;
  padding: 0 14px;
}

.admin-editor textarea {
  padding: 14px;
  resize: vertical;
  min-height: 110px;
}

.project-editor {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.project-editor .card-top button {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-weight: 800;
  cursor: pointer;
}

.check-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.admin-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
}

.admin-actions {
  margin-top: 16px;
}

.compact-heading {
  margin-bottom: 0;
}

.form-status {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 13, 12, 0.72);
}

.modal-panel {
  width: min(680px, 100%);
  padding: 30px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal-close {
  float: right;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 24px;
}

.modal-open {
  overflow: hidden;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 6vw, 88px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer a {
  color: var(--accent);
  font-weight: 800;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .section-grid,
  .timeline-section,
  .admin-shell,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 480px;
  }

  .stats-band,
  .document-grid,
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 72px;
    left: 18px;
    right: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-visual {
    min-height: 380px;
  }

  .hero-visual img {
    width: min(78vw, 320px);
  }

  .status-card {
    left: 0;
    right: 0;
    margin: auto;
    bottom: 4%;
  }

  .stats-band,
  .admin-grid,
  .document-grid,
  .project-grid,
  .contact-cards {
    grid-template-columns: 1fr;
  }

  .cta-band,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .carousel-btn {
    display: none;
  }
}
