/* =============================================================================
   Theme tokens
   ============================================================================= */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --border: #e6e5e1;
  --text: #3b3f45;
  --text-strong: #1d1f23;
  --muted: #6a6f77;
  --accent: #4a6583;
  --accent-soft: rgba(74, 101, 131, 0.1);
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.04), 0 12px 32px -16px rgba(20, 22, 26, 0.18);
  --icon-filter: none;
  --ring: #e5e9ea;
  --ring-glow: #e5e9ea;
  --card-border: transparent;
  --card-shadow: 0 8px 60px -12px rgba(13, 28, 39, 0.28);

  /* Name shimmer: base text colour and a muted golden glint */
  --name: #333333;
  --glow-1: #4a4639;
  --glow-2: #6b5f42;
  --glow-3: #7a6a45;

  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113;
    --surface: #16191d;
    --surface-2: #1e2227;
    --border: #282d33;
    --text: #c4c9cf;
    --text-strong: #eceef0;
    --muted: #8b929b;
    --accent: #9fb6d1;
    --accent-soft: rgba(159, 182, 209, 0.12);
    --on-accent: #0f1113;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
    --icon-filter: invert(1) hue-rotate(180deg);
  --ring: #262b31;
  --ring-glow: rgba(0, 0, 0, 0.55);
  --card-border: #23282e;
  --card-shadow: 0 8px 60px -12px rgba(0, 0, 0, 0.8);

    --name: #eceae6;
    --glow-1: #e8e3d6;
    --glow-2: #e3d6b4;
    --glow-3: #dfcea2;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1113;
  --surface: #16191d;
  --surface-2: #1e2227;
  --border: #282d33;
  --text: #c4c9cf;
  --text-strong: #eceef0;
  --muted: #8b929b;
  --accent: #9fb6d1;
  --accent-soft: rgba(159, 182, 209, 0.12);
  --on-accent: #0f1113;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  --icon-filter: invert(1) hue-rotate(180deg);
  --ring: #262b31;
  --ring-glow: rgba(0, 0, 0, 0.55);
  --card-border: #23282e;
  --card-shadow: 0 8px 60px -12px rgba(0, 0, 0, 0.8);

  --name: #eceae6;
  --glow-1: #e8e3d6;
  --glow-2: #e3d6b4;
  --glow-3: #dfcea2;

  color-scheme: dark;
}

/* =============================================================================
   Base
   ============================================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.25;
}

svg {
  flex-shrink: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

/* =============================================================================
   Header
   ============================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-strong);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover {
  color: var(--text-strong);
  background: var(--surface-2);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-strong);
  cursor: pointer;
  transition: border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle .i-sun {
  display: none;
}

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

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .i-moon {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .theme-toggle {
    margin-left: auto;
  }
}

/* =============================================================================
   Hero: profile card with the photo overlapping its top edge
   ============================================================================= */
.hero {
  padding-block: calc(var(--photo) / 2 + clamp(16px, 4vh, 56px)) clamp(56px, 8vw, 96px);
  --photo: 150px;
}

.profile-card {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
  padding: 0 clamp(20px, 5vw, 56px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  text-align: center;
}

/* Round profile picture with a soft ring and glow */
.profile-photo {
  width: var(--photo);
  height: var(--photo);
  margin: calc(var(--photo) / -2) auto 0;
  border-radius: 50%;
  box-shadow: 0 5px 50px 0 var(--ring-glow), 0 0 0 7px var(--ring);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 50%;
}

.role {
  min-height: 1.4em;
  margin: clamp(16px, 2.6vh, 28px) 0 4px;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-strong);
}

.cursor {
  margin-left: 2px;
  font-weight: 400;
  color: var(--muted);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.name {
  margin-bottom: clamp(10px, 2vh, 20px);
  font-size: clamp(44px, min(7vw, 9vh), 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--name);
}

/* Subtle golden glint sweeping left to right across the name */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .name-shimmer {
    background-image: linear-gradient(100deg,
        var(--name) 0%,
        var(--name) 38%,
        var(--glow-1) 43%,
        var(--glow-2) 47%,
        var(--glow-3) 50%,
        var(--glow-2) 53%,
        var(--glow-1) 57%,
        var(--name) 62%,
        var(--name) 100%);
    background-size: 400% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: name-shimmer 9s ease-in-out infinite;
  }
}

@keyframes name-shimmer {
  0% {
    background-position: 100% 0;
  }

  40%,
  100% {
    background-position: 0% 0;
  }
}

.lede {
  max-width: 36em;
  margin: 0 auto;
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.7;
}

.lede strong {
  font-weight: 600;
  color: var(--text-strong);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: clamp(18px, 3.4vh, 32px);
}

.social-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.social-btn.linkedin {
  background: linear-gradient(45deg, #0a66c2, #1d8cf0);
  box-shadow: 0 6px 24px rgba(10, 102, 194, 0.45);
}

.social-btn.email {
  background: linear-gradient(45deg, #333333, #626b73);
  box-shadow: 0 6px 24px rgba(63, 65, 67, 0.45);
}

.ask-hint {
  margin: clamp(10px, 2vh, 18px) 0 0;
  font-size: 14px;
  color: var(--muted);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.link-btn:hover {
  text-decoration-color: currentColor;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: clamp(20px, 4vh, 40px) calc(-1 * clamp(20px, 5vw, 56px)) 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.profile-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: clamp(12px, 2.2vh, 20px) 8px clamp(14px, 2.5vh, 22px);
}

.profile-stats li+li {
  border-left: 1px solid var(--border);
}

.profile-stats strong {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-strong);
}

.profile-stats span {
  font-size: 13px;
  color: var(--muted);
}

/* Short laptop screens: a smaller photo keeps the whole card in view */
@media (max-height: 700px) {
  .hero {
    --photo: 120px;
  }
}

@media (max-width: 576px) {
  .hero {
    --photo: 120px;
  }

  .profile-stats li {
    padding-inline: 4px;
  }

  .profile-stats span {
    font-size: 12px;
  }
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  transition: transform 0.15s, border-color 0.2s, background-color 0.2s, color 0.2s;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.btn-outline {
  min-height: 48px;
  padding-inline: 34px;
  border: 2px solid var(--accent);
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: 0 10px 14px -10px var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-email {
  overflow-wrap: anywhere;
}

/* =============================================================================
   Sections: heading on the left, content on the right
   ============================================================================= */
.section {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(20px, 5vw, 64px);
  padding-block: clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--border);
}

.section-head h2 {
  font-size: clamp(22px, 2.4vw, 26px);
}

@media (min-width: 821px) {
  .section-head {
    position: sticky;
    top: 96px;
    align-self: start;
  }
}

@media (max-width: 820px) {
  .section {
    grid-template-columns: 1fr;
  }
}

/* What I do */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.service-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.service h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.service p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* Selected work */
.work-group+.work-group {
  margin-top: 40px;
}

.group-label {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s, transform 0.2s;
}

.work-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.work-card h4 {
  font-size: 16px;
}

.work-card p {
  flex: 1;
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.work-card p strong {
  font-weight: 600;
  color: var(--text-strong);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text);
}

/* Tech stack */
.stack-group {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px 24px;
  padding-block: 20px;
  border-bottom: 1px dashed var(--border);
}

.stack-group:first-child {
  padding-top: 0;
}

.stack-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.stack-group h3 {
  padding-top: 7px;
  font-size: 14px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text-strong);
}

.chips img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.chips img.mono {
  filter: var(--icon-filter);
}

@media (max-width: 560px) {
  .stack-group {
    grid-template-columns: 1fr;
  }

  .stack-group h3 {
    padding-top: 0;
  }
}

/* Testimonials */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.quote {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
}

.quote blockquote {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-strong);
}

.quote figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.quote img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.quote cite {
  display: block;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  color: var(--text-strong);
}

/* Contact */
.contact-card {
  padding: clamp(24px, 4vw, 40px);
}

.contact-card h3 {
  margin-bottom: 6px;
  font-size: clamp(22px, 3vw, 28px);
}

.contact-card>p {
  margin: 0 0 24px;
  color: var(--muted);
}

.contact-card .contact-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0;
  font-size: 14px;
}

/* =============================================================================
   Footer
   ============================================================================= */
.site-footer {
  padding-block: 28px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.site-footer a:hover {
  color: var(--text-strong);
}

/* =============================================================================
   Reduced motion
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .name-shimmer,
  .cursor {
    animation: none;
  }

  .name-shimmer {
    background-position: 0% 0;
  }

  .btn,
  .work-card,
  .social-btn {
    transition: none;
  }

  .btn:hover,
  .work-card:hover,
  .social-btn:hover {
    transform: none;
  }
}
