/* ---------------------------------------------------------
   DevSarfo — portfolio stylesheet
   --------------------------------------------------------- */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f5fa;
  --bg-raised: #ffffff;
  --text: #16151d;
  --text-muted: #5c5a68;
  --border: #e7e5ef;
  --accent: #6d4aff;
  --accent-strong: #5433e0;
  --accent-soft: #efeaff;
  --accent-contrast: #ffffff;
  --shadow: 0 1px 2px rgba(22, 21, 29, 0.04), 0 12px 28px -12px rgba(22, 21, 29, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container: 1120px;
  --header-h: 76px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0d13;
  --bg-soft: #15141c;
  --bg-raised: #191824;
  --text: #f3f2f8;
  --text-muted: #a6a3b6;
  --border: #29273580;
  --accent: #a394ff;
  --accent-strong: #8b78ff;
  --accent-soft: #221d3a;
  --accent-contrast: #14121f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 40px -18px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0d13;
    --bg-soft: #15141c;
    --bg-raised: #191824;
    --text: #f3f2f8;
    --text-muted: #a6a3b6;
    --border: #29273580;
    --accent: #a394ff;
    --accent-strong: #8b78ff;
    --accent-soft: #221d3a;
    --accent-contrast: #14121f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 20px 40px -18px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--accent);
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  margin-top: 10px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-head.center .eyebrow::before { display: none; }

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

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

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

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

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--accent);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.18s ease; }
.link-arrow:hover svg { transform: translate(3px, -3px); }

/* ---------------- header ---------------- */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
}

/* the blur/translucency lives on a pseudo-element rather than the header
   itself, because backdrop-filter on the header would create a new
   containing block and break position:fixed on the mobile nav panel */
header.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

header.site-header.scrolled::before {
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand .dot { color: var(--accent); }

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

.nav-links a {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 6px 0;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 40px 24px;
    gap: 6px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links a {
    width: 100%;
    padding: 14px 0;
    font-size: 1.15rem;
    border-bottom: 1px solid var(--border);
  }
  body.nav-open .nav-links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }
}

/* ---------------- hero ---------------- */
.hero {
  padding: calc(var(--header-h) + 64px) 0 80px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  margin: 14px 0 6px;
}
.hero h1 .accent { color: var(--accent); }
.hero .role-line {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  color: var(--text-muted);
  margin-bottom: 22px;
  min-height: 1.4em;
}
.hero .role-line .cursor { color: var(--accent); }
.hero p.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-photo {
  position: relative;
  justify-self: center;
  width: min(360px, 100%);
  aspect-ratio: 1 / 1;
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1.5px dashed var(--border);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

/* ---------------- about teaser / bio ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 56px;
  align-items: start;
}
.about-grid.no-photo {
  grid-template-columns: 1fr;
}
.about-grid.no-photo .about-copy {
  max-width: 680px;
}
.about-photo img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.about-copy p { color: var(--text-muted); margin-top: 16px; }
.about-copy p:first-of-type { margin-top: 18px; }

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

/* ---------------- resume band ---------------- */
.resume-band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.resume-band .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.resume-band h3 { font-size: 1.5rem; margin-bottom: 8px; }
.resume-band p { color: var(--text-muted); max-width: 52ch; }

/* ---------------- cards grid (services) ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.card .num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.card .icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card .icon-wrap svg { width: 22px; height: 22px; }
.card h4 { font-size: 1.15rem; margin: 4px 0 10px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

/* ---------------- stats ---------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat .num {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 600;
  color: var(--accent);
}
.stat p { color: var(--text-muted); margin-top: 6px; font-size: 0.95rem; }

/* ---------------- portfolio ---------------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.project-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.project-card .num { font-size: 0.8rem; font-weight: 600; color: var(--accent); letter-spacing: 0.08em; }
.project-card h4 { font-size: 1.15rem; }
.project-card p { color: var(--text-muted); font-size: 0.93rem; flex-grow: 1; }

.portfolio-grid .project-card.is-offline { opacity: 0.6; }
.link-arrow.is-disabled {
  color: var(--text-muted);
  cursor: default;
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 400;
}

.view-more-wrap { margin-top: 48px; text-align: center; }
.view-more-wrap .btn svg { width: 16px; height: 16px; }

/* ---------------- work grid (dedicated projects page) ---------------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.work-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.work-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.work-thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
  position: relative;
}
.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.work-thumb.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.work-thumb.is-placeholder svg { width: 40px; height: 40px; opacity: 0.5; }
.work-body {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}
.work-body .num { font-size: 0.8rem; font-weight: 600; color: var(--accent); letter-spacing: 0.08em; }
.work-body h4 { font-size: 1.1rem; }
.work-body p { color: var(--text-muted); font-size: 0.92rem; flex-grow: 1; }

.work-card.is-offline { opacity: 0.6; }
.work-card.is-offline .work-thumb { background: var(--bg-soft); }

/* ---------------- achievements ---------------- */
.achieve-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.achieve-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
}
.achieve-card .icon-wrap {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.achieve-card .icon-wrap svg { width: 20px; height: 20px; }
.achieve-card h4 { font-size: 1.02rem; margin-bottom: 4px; }
.achieve-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------------- CTA band ---------------- */
.cta-band {
  text-align: center;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  margin: 0 24px;
  padding: 72px 24px;
}
.cta-band h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin: 10px 0 30px; }
.cta-band .btn-row { justify-content: center; }

/* ---------------- breadcrumb / page header ---------------- */
.page-hero {
  padding: calc(var(--header-h) + 56px) 0 48px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 10px; }
.page-hero .crumbs {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.page-hero .crumbs a:hover { color: var(--accent); }
.page-hero .crumbs .sep { opacity: 0.5; }

/* ---------------- contact ---------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
}
.contact-info { display: flex; flex-direction: column; gap: 20px; }
.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
}
.contact-item .icon-wrap {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.contact-item .icon-wrap svg { width: 19px; height: 19px; }
.contact-item h6 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px; }
.contact-item a:hover { color: var(--accent); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.18s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form textarea { min-height: 140px; resize: vertical; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  display: none;
  margin: 0;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.form-status.is-visible { display: block; }
.form-status.is-success {
  background: color-mix(in srgb, #16a34a 12%, transparent);
  border-color: color-mix(in srgb, #16a34a 35%, transparent);
  color: #16a34a;
}
.form-status.is-error {
  background: color-mix(in srgb, #dc2626 12%, transparent);
  border-color: color-mix(in srgb, #dc2626 35%, transparent);
  color: #dc2626;
}

/* ---------------- footer ---------------- */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-inner p { color: var(--text-muted); font-size: 0.9rem; }
.social-icons { display: flex; gap: 10px; }

/* ---------------- back to top ---------------- */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  z-index: 90;
}
#back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
#back-to-top:hover { border-color: var(--accent); color: var(--accent); }
#back-to-top svg { width: 18px; height: 18px; }

/* ---------------- reveal animation ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 980px) {
  .card-grid, .portfolio-grid, .work-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 280px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero .btn-row { justify-content: center; }
  .hero-photo { order: -1; width: min(240px, 60vw); }
  .stats-row { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .achieve-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
}

@media (max-width: 600px) {
  .card-grid, .portfolio-grid, .work-grid { grid-template-columns: 1fr; }
  .resume-band .container { flex-direction: column; align-items: flex-start; }
  .cta-band { margin: 0 16px; padding: 52px 20px; }
}
