:root {
  /* Backgrounds */
  --bg: #181a1b;
  --bg-2: #1f2223;

  /* Text */
  --text: #e4e6eb;
  --muted: #a1a6ad;

  /* Lines / borders */
  --line: rgba(255, 255, 255, 0.08);

  /* Accent */
  --accent: #8fb3c8;
  --accent-2: #6f9fb8;

  /* UI */
  --chip: rgba(143, 179, 200, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Light mode overrides */
body.light {
  --bg: #f4f5f7;
  --bg-2: #e9ebee;

  --text: #1f2933;
  --muted: #4b5563;

  --line: rgba(0, 0, 0, 0.08);

  --accent: #3b82f6;
  --accent-2: #2563eb;

  --chip: rgba(59, 130, 246, 0.14);
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 6px 18px rgba(0, 0, 0, 0.08);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
  min-height: 100dvh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: var(--text);
  line-height: 1.6;
}

body {
    transition: background-color 180ms ease, color 180ms ease;
}

.container.nav-wrap,
.card,
.skill-card,
.form-input,
.nav-link,
.theme-toggle,
.site-footer {
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

/* Paint background behind everything (prevents white bars on iOS) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
      900px 500px at 50% 30%,
      rgba(143, 179, 200, 0.06),
      transparent 60%
    ),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

/* ===============================
   Header / Navigation
   =============================== */

.site-header {
  position: sticky;
  top: 14px;
  z-index: 1000;
  overflow: visible;
}

.nav-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Outer width + page gutter (used site-wide) */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Pill navbar surface */
.container.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);

  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);

  transition: background 180ms ease, box-shadow 180ms ease,
    border-color 180ms ease, transform 180ms ease;
  transform: translateY(0);
}

/* Top-of-page state (no pill look) */
.container.nav-wrap.at-top {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: translateY(-2px);
}

/* Light mode surface for the pill */
body.light .container.nav-wrap {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* Light mode: top-of-page stays minimal */
body.light .container.nav-wrap.at-top {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.mark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--accent);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.06em;
}

.mark-brace {
  transform: translateY(-1px);
  opacity: 0.95;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.nav-link {
  text-decoration: none;
  color: rgba(215, 223, 222, 0.82);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-link.is-active {
  color: var(--accent);
  background: var(--chip);
  border-color: rgba(143, 179, 200, 0.35);
  box-shadow: none;
}

/* Focus behaviour */
.nav-link:focus:not(:focus-visible),
.nav-toggle:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
.nav-link:focus-visible,
.nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(39, 209, 139, 0.25);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

/* Hamburger lines */
.nav-toggle span {
  display: block;
  height: 2px;
  width: 18px;
  margin: 3px 0;
  background: rgba(215, 223, 222, 0.9);
  border-radius: 999px;
}

/* Theme toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  margin-left: 12px;
  border-radius: 12px;

  display: grid;
  place-items: center;

  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--text);

  cursor: pointer;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.theme-toggle .icon {
  font-size: 18px;
  line-height: 1;
}

/* Make moon icon monochrome */
.theme-toggle .moon {
  filter: grayscale(100%) brightness(0.9);
}

/* Icon switching */
body:not(.light) .moon {
  display: none;
}
body.light .sun {
  display: none;
}

/* Ensure icon switching applies everywhere (including mobile clone) */
body:not(.light) .theme-toggle .moon {
  display: none !important;
}
body.light .theme-toggle .sun {
  display: none !important;
}

/* Light mode nav + toggles */
body.light .nav-link {
  color: rgba(31, 41, 55, 0.85);
}
body.light .nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
}
body.light .nav-link.is-active {
  color: var(--accent);
}

body.light .nav-toggle {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(0, 0, 0, 0.18);
}
body.light .nav-toggle:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.25);
}
body.light .nav-toggle span {
  background: rgba(31, 41, 55, 0.9);
}

/* Mobile nav panel (hidden unless .open) */
.nav-panel {
  display: none;
  position: absolute;
  right: 22px;
  top: calc(100% + 10px);

  padding: 12px;
  border-radius: 16px;
  background: rgba(10, 14, 14, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);

  flex-direction: column;
  min-width: 220px;
  gap: 8px;
  z-index: 55;
}
.nav-panel.open {
  display: flex;
}

/* Theme toggle inside mobile dropdown — centered */
.nav-panel .theme-toggle--mobile {
  width: 100%;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;

  margin: 0;
  padding: 0;

  border: none;
  background: transparent;
}

/* Keep icons on one line */
.nav-panel .theme-toggle--mobile .icon {
  display: inline-block;
  line-height: 1;
}

/* Slightly larger text for "Theme" in mobile menu */
.nav-panel .theme-toggle--mobile span:not(.icon) {
  font-size: 15px;
}

/* Emoji optical alignment fix */
.nav-panel .theme-toggle .icon {
  display: block;
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

/* Light mode: mobile menu */
body.light .nav-panel {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
}
body.light .nav-panel .nav-link {
  color: #1f2937;
}
body.light .nav-panel .nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ===============================
   Page layout
   =============================== */

.page {
  min-height: calc(100dvh - 92px);
  display: grid;
  place-items: center;
  padding: 0 22px;
}

main {
  padding-top: 24px;
}

/* ===============================
   Hero
   =============================== */

.hero {
  width: 100%;
  display: grid;
  place-items: center;
}
.hero-inner {
  text-align: center;
  max-width: 720px;
  padding-top: 10px;
}
.kicker {
  margin: 0 0 12px;
  font-size: 18px;
  color: rgba(215, 223, 222, 0.9);
}
.hero-title {
  margin: 0 0 12px;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 900;
}
.hero-name {
  color: #f1f3f5;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.accent {
  color: var(--accent);
}
.hero-sub {
  margin: 0 0 18px;
  font-size: 28px;
  letter-spacing: -0.01em;
    font-weight: 500;
    opacity: 0.85;
  color: rgba(230, 236, 235, 0.92);
}
.hero-blurb {
  margin: 0 auto 26px;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 160ms ease,
    border-color 160ms ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #0f1416;
  box-shadow: none;
}
.btn.ghost {
  background: transparent;
  border-color: rgba(143, 179, 200, 0.4);
  color: var(--accent);
}

/* Light mode: improve hero readability */
body.light .hero-name {
  color: #111827;
  text-shadow: none;
}
body.light .hero-name.accent {
  color: var(--accent);
}
body.light .hero-sub {
  color: #1f2937;
}
body.light .kicker {
  color: #374151;
}
body.light .hero-blurb,
body.light .page-text,
body.light .card p {
  color: var(--muted);
}

/* Light mode: headings */
body.light .card h2,
body.light .page-title {
  color: #111827;
}

/* ===============================
   Generic page content
   =============================== */

.page-section {
  width: 100%;
  max-width: 960px;
}

.page-section.about {
    padding-top: 2.75rem;
}

.page-title {
  margin: 0 0 14px;
  font-size: 40px;
  letter-spacing: -0.02em;
}
.page-text {
  margin: 0 0 22px;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.7;
}
.link {
  color: var(--accent);
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}

/* ===============================
   Cards (Projects / About etc.)
   =============================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: none;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.card p {
  margin: 0;
  color: rgba(215, 223, 222, 0.75);
  line-height: 1.6;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Light mode: strengthen outlines for cards & ghost buttons */
body.light .card,
body.light .btn.ghost {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.65);
}

/* ===============================
   Contact form
   =============================== */

.form {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(215, 223, 222, 0.9);
}

body.light .form-label {
  color: #111827;
}

.form-input {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}

/* Prevent focus ring from visually "pushing" the next field */
.form-input:focus {
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 3px rgba(39, 209, 139, 0.22);
  border-color: rgba(39, 209, 139, 0.35);
}

body.light .form-input {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.14);
  color: #111827;
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

.form-status {
  margin: 10px 0 0;
  color: var(--muted);
  min-height: 1.2em;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Form input typography only */
input,
textarea,
select {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
}

textarea {
  resize: vertical;
}

.contact-alt {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.contact-alt-label {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.contact-links {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;
    color: var(--text);
    text-decoration: none;

    opacity: 0.85;
    transition: color 160ms ease, opacity 160ms ease;
}

.contact-link:hover {
    color: var(--accent);
    opacity: 1;
}

.contact-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: 0.8;
}


/* ===============================
   Skills
   =============================== */

.skills-group {
  margin-top: 28px;
}

.skills-heading {
  font-size: 1.25rem;
  font-weight: 650;
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

.skills-group .skills-grid {
  max-width: 960px;
}

.skill-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

body.light .skill-card {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.skill-card-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.skill-badge {
  width: auto;
  height: auto;
  display: block;
}

.skill-badge img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.skill-main {
  display: grid;
  gap: 10px;
}

.skill-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.skill-name {
  font-weight: 650;
  letter-spacing: 0.2px;
}

.skill-meta {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.skill-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

body.light .skill-bar {
  background: rgba(0, 0, 0, 0.08);
}

.skill-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 500ms ease;
}

/* Responsive */
@media (max-width: 860px) {
  .nav-desktop {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .nav-wrap > .theme-toggle {
    display: none;
  }
}

/* ===============================
   Footer
   =============================== */

.site-footer {
  margin-top: 80px;
  padding: 28px 22px 36px;
  border-top: 1px solid var(--line);

  opacity: 0;
  transform: translateY(20px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.site-footer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-copy {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    gap: 10px;
  }
}

.about {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2.25rem;
    align-items: start;
}

.about-photo {
    position: static;
}

.photo-placeholder {
    position: relative;
    width: 220px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(135deg, var(--bg-2), var(--bg));
    border: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(0,0,0,.28);
}

.photo-placeholder::after{
    content: "Profile photo";
    position: absolute;
    left: 14px;
    bottom: 12px;
    font-size: 0.78rem;
    color: var(--muted);
    opacity: 0.65;
}

.photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-content h1 {
    margin-bottom: 1rem;
}

.page-section.about .page-text {
    margin-bottom: 1.2rem;
}


.about-content { max-width: 62ch; }


/* Mobile */
@media (max-width: 768px) {
    .about {
        grid-template-columns: 1fr;
    }

    .about-photo {
        position: static;
    }

    .photo-placeholder {
        margin-bottom: 1.5rem;
    }
}

.about-lede {
    margin: 0 0 1.1rem;
    max-width: 62ch;
    color: var(--text);
    opacity: 0.85;
    line-height: 1.65;
}

.hero-cta {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 14px;
}

.hero-cta .btn {
    min-width: max-content;
}

.hero-cta .btn.primary {
    min-width: max(160px, max-content);
}

.hero-cta .btn {
    min-width: 168px; /* example */
}
