/* ==========================================================================
   Web Profile — public site theme
   Custom design layer that replaces the stock template styling.
   ========================================================================== */

:root {
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --accent-strong: #4f46e5;

  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --border: #e4e6ef;
  --border-strong: #d3d6e4;

  --text: #12151f;
  --text-muted: #5b6178;
  --text-faint: #878da3;

  --shadow-sm: 0 1px 2px rgba(16, 20, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 20, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 20, 40, 0.14);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --sidebar-w: 104px;
  --header-h: 64px;

  --font-sans: 'Plus Jakarta Sans', 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme='dark'] {
  --bg: #0a0c14;
  --bg-alt: #10131f;
  --bg-elevated: #161a29;
  --surface: #141826;
  --border: #242938;
  --border-strong: #333a4d;

  --text: #eef0f6;
  --text-muted: #9aa1b8;
  --text-faint: #6b7288;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

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

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.5em;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Reading progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #ec4899);
  z-index: 2000;
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.site-main {
  margin-left: var(--sidebar-w);
  transition: margin-left 0.3s ease;
}

.section {
  padding: 96px 0;
  position: relative;
}
.section--alt { background: var(--bg-alt); }

.container-narrow {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-head {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  margin-bottom: 14px;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Sidebar navigation
   -------------------------------------------------------------------------- */

.site-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0;
  z-index: 1000;
  gap: 8px;
}

.site-nav__brand {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #ec4899);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.site-nav__brand:hover { color: #fff; }

.site-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: none;
}
.site-nav__list::-webkit-scrollbar { display: none; }

.site-nav__link {
  width: 58px;
  padding: 9px 0 7px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  transition: all 0.2s ease;
}
.site-nav__link i { font-size: 1.15rem; }
.site-nav__link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.site-nav__link.is-active {
  color: #fff;
  background: var(--accent);
}

.site-nav__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Mobile nav */
.nav-toggle {
  display: none;
  position: fixed;
  top: 16px; right: 16px;
  z-index: 1100;
  width: 46px; height: 46px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 15, 0.55);
  backdrop-filter: blur(3px);
  z-index: 999;
}
.nav-backdrop.is-open { display: block; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn-solid, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-solid {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px var(--accent-soft);
}
.btn-solid:hover {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--accent-soft);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 100px 0;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.16;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(1000px 520px at 15% 20%, var(--accent-soft), transparent 65%);
  z-index: 0;
}
.hero > .container-narrow { position: relative; z-index: 1; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 26px;
}
.hero__badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.hero__title {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.05;
  margin-bottom: 20px;
}
.hero__title .accent {
  background: linear-gradient(120deg, var(--accent), #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__typed {
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 22px;
  min-height: 1.6em;
}
.hero__typed .typed-cursor { color: var(--accent); }
.hero__lead {
  font-size: 1.04rem;
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 34px;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.social-row { display: flex; gap: 10px; flex-wrap: wrap; }
.social-row a {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all 0.22s ease;
}
.social-row a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   Cards / About
   -------------------------------------------------------------------------- */

.card-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.about-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  aspect-ratio: 3 / 4;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }

.about-facts {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.about-facts li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.92rem;
}
.about-facts strong { color: var(--text); font-weight: 600; }
.about-facts span { color: var(--text-muted); word-break: break-word; }

/* --------------------------------------------------------------------------
   Facts / counters
   -------------------------------------------------------------------------- */

.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.fact-card {
  text-align: center;
  padding: 34px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.fact-card i {
  font-size: 1.7rem;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}
.fact-card .value {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.fact-card .label {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Skills
   -------------------------------------------------------------------------- */

.skill-group + .skill-group { margin-top: 40px; }
.skill-group__title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.skill-group__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 14px 18px;
  text-align: center;
  transition: all 0.25s ease;
}
.skill-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.skill-card__logo {
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}
.skill-card__logo img { max-height: 52px; max-width: 60px; object-fit: contain; }
.skill-card__name { font-weight: 600; font-size: 0.9rem; }
.skill-card__bar {
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin-top: 10px;
  overflow: hidden;
}
.skill-card__bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #ec4899);
}

/* --------------------------------------------------------------------------
   Resume / timeline
   -------------------------------------------------------------------------- */

.resume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 48px;
}
.resume-col__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  margin-bottom: 26px;
}
.resume-col__title i { color: var(--accent); }

.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid var(--border);
}
.timeline__item {
  position: relative;
  padding-bottom: 30px;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: -37px;
  top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}
.timeline__item--current::before {
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.timeline__period {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.timeline__role { font-size: 1.04rem; margin-bottom: 4px; }
.timeline__org {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.timeline__desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 8px; }
.timeline__list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.timeline__list li { margin-bottom: 4px; }

/* "Show more" collapse used when the list gets long */
.collapsible { position: relative; }
.collapsible[data-collapsed='true'] .collapsible__overflow { display: none; }
.collapsible__toggle {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.collapsible__toggle:hover { border-color: var(--accent); color: var(--accent); }
.collapsible__toggle i { transition: transform 0.25s ease; }
.collapsible[data-collapsed='false'] .collapsible__toggle i { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   Portfolio — the main event
   -------------------------------------------------------------------------- */

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}
.portfolio-filter {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.portfolio-filter:hover { border-color: var(--accent); color: var(--accent); }
.portfolio-filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.portfolio-filter .count {
  opacity: 0.65;
  font-size: 0.78rem;
  margin-left: 4px;
}

/* Larger cards than the old 3-up grid: min 340px per card. */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}
.project-card.is-hidden { display: none; }

.project-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
}
.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .project-card__media img { transform: scale(1.06); }

.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 10, 18, 0.86), rgba(8, 10, 18, 0.1) 55%, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  gap: 10px;
}
.project-card:hover .project-card__overlay { opacity: 1; }
.project-card__overlay a {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 1.1rem;
  transform: translateY(12px);
  transition: all 0.28s ease;
}
.project-card:hover .project-card__overlay a { transform: translateY(0); }
.project-card__overlay a:hover { background: var(--accent); border-color: var(--accent); }

.project-card__flag {
  position: absolute;
  top: 14px; left: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #12151f;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.project-card__body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.project-card__meta {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.project-card__title { font-size: 1.2rem; margin-bottom: 8px; }
.project-card__title a { color: var(--text); }
.project-card__title a:hover { color: var(--accent); }
.project-card__desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.tech-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.portfolio-more { text-align: center; margin-top: 40px; }

/* --------------------------------------------------------------------------
   Certificates
   -------------------------------------------------------------------------- */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.cert-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}
.cert-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cert-card__icon {
  width: 52px; height: 52px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  overflow: hidden;
}
.cert-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.cert-card__name { font-size: 1rem; margin-bottom: 3px; }
.cert-card__issuer { color: var(--text-muted); font-size: 0.86rem; }
.cert-card__date { color: var(--text-faint); font-size: 0.78rem; margin-top: 6px; }

/* --------------------------------------------------------------------------
   Services
   -------------------------------------------------------------------------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.service-card {
  padding: 32px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.28s ease;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ec4899);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.service-card__icon {
  width: 54px; height: 54px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.service-card__title { font-size: 1.1rem; margin-bottom: 8px; }
.service-card__desc { color: var(--text-muted); font-size: 0.93rem; margin: 0; }

/* --------------------------------------------------------------------------
   Testimonials
   -------------------------------------------------------------------------- */

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  height: auto;
}
.testimonial-card__stars { color: #f59e0b; margin-bottom: 12px; font-size: 0.92rem; }
.testimonial-card__quote {
  color: var(--text-muted);
  font-size: 0.97rem;
  font-style: italic;
  margin-bottom: 20px;
}
.testimonial-card__person { display: flex; align-items: center; gap: 12px; }
.testimonial-card__avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ec4899);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}
.testimonial-card__name { font-weight: 600; font-size: 0.95rem; }
.testimonial-card__role { color: var(--text-faint); font-size: 0.82rem; }

.swiper-pagination-bullet-active { background: var(--accent) !important; }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.contact-info { display: flex; flex-direction: column; gap: 14px; }
.contact-info__item {
  display: flex;
  gap: 15px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.22s ease;
}
.contact-info__item:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-info__item i {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.contact-info__label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact-info__value { color: var(--text); font-size: 0.94rem; word-break: break-word; }

.contact-form {
  padding: 30px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-muted);
}
.field input, .field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  transition: all 0.2s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 130px; }
.field .error {
  display: none;
  color: #ef4444;
  font-size: 0.82rem;
  margin-top: 6px;
}
.field.has-error input, .field.has-error textarea { border-color: #ef4444; }
.field.has-error .error { display: block; }

/* Honeypot — hidden from humans, visible to naive bots. */
.hp-field {
  position: absolute !important;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

.form-alert {
  display: none;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.form-alert.is-success {
  display: block;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.28);
}
.form-alert.is-error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

/* --------------------------------------------------------------------------
   Footer + misc
   -------------------------------------------------------------------------- */

.site-footer {
  margin-left: var(--sidebar-w);
  padding: 44px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  text-align: center;
}
.site-footer__name { font-size: 1.25rem; margin-bottom: 6px; }
.site-footer__tag { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 20px; }
.site-footer__social { justify-content: center; margin-bottom: 22px; }
.site-footer__copy { color: var(--text-faint); font-size: 0.84rem; }

.back-to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s ease;
  z-index: 900;
  border: none;
  cursor: pointer;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent-strong); color: #fff; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: 12px; opacity: 0.5; }

/* --------------------------------------------------------------------------
   Project detail page
   -------------------------------------------------------------------------- */

.detail-header { padding: 60px 0 30px; }
.breadcrumb-nav {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumb-nav a { color: var(--text-muted); }
.breadcrumb-nav a:hover { color: var(--accent); }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.detail-gallery {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.detail-gallery img { width: 100%; display: block; aspect-ratio: 16/10; object-fit: cover; }

.detail-panel {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.detail-panel + .detail-panel { margin-top: 20px; }
.detail-meta { list-style: none; padding: 0; margin: 0; }
.detail-meta li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.91rem;
}
.detail-meta li:last-child { border-bottom: none; }
.detail-meta .k { color: var(--text-faint); font-weight: 600; }
.detail-meta .v { color: var(--text); text-align: right; word-break: break-word; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 340px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
  :root { --sidebar-w: 0px; }

  .nav-toggle { display: grid; place-items: center; }

  .site-nav {
    width: 264px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    align-items: stretch;
    padding: 22px 16px;
  }
  .site-nav.is-open { transform: translateX(0); }
  .site-nav__brand { margin: 0 auto 20px; }
  .site-nav__list { align-items: stretch; }
  .site-nav__link {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    font-size: 0.92rem;
  }
  .site-nav__footer { flex-direction: row; justify-content: center; }

  .site-main, .site-footer { margin-left: 0; }
  .section { padding: 72px 0; }
  .portfolio-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 576px) {
  .container-narrow { padding: 0 18px; }
  .section { padding: 56px 0; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .btn-solid, .btn-ghost { justify-content: center; }
  .contact-form { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-nav, .nav-toggle, .back-to-top, .theme-toggle, .hero__actions { display: none !important; }
  .site-main, .site-footer { margin-left: 0; }
  .section { padding: 20px 0; page-break-inside: avoid; }
}
