/* ==========================================================================
   Shaun Chopra portfolio
   Layout: single page. Header, intro, certifications, skills, projects,
   education, contact, footer.
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root {
  --bg: #ffffff;
  --surface: #f6f6f6;
  --text: #111111;
  --text-soft: #3a3a3a;
  --line: #e2e2e2;
  --accent: #147a54;
  --accent-hover: #0e5a3e;
  --on-accent: #ffffff;
  --photo-bg: #147a54;
  --logo-filter: none;

  --font: "IBM Plex Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --max-width: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f;
    --surface: #181818;
    --text: #ffffff;
    --text-soft: #e2e2e2;
    --line: #2a2a2a;
    --accent: #34b383;
    --accent-hover: #28916a;
    --on-accent: #06130d;
    --photo-bg: #1d8a61;
    --logo-filter: invert(1);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: #181818;
  --text: #ffffff;
  --text-soft: #e2e2e2;
  --line: #2a2a2a;
  --accent: #34b383;
  --accent-hover: #28916a;
  --on-accent: #06130d;
  --photo-bg: #1d8a61;
  --logo-filter: invert(1);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 28px;
}

section {
  padding-block: 56px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 22px;
}

.site-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 4px;
}

.site-nav a:hover {
  background: var(--surface);
}

/* ---------- Intro ---------- */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding-block: 48px 64px;
}

.intro-photo {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--photo-bg);
  overflow: hidden;
}

.intro-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro h1 {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.intro p {
  font-size: 1.15rem;
  color: var(--text-soft);
  max-width: 52ch;
  margin: 16px 0 28px;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: var(--on-accent);
  transition: background-color 0.15s ease;
}

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

/* ---------- Certifications ---------- */
.badges {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.badge {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 150px;
  text-align: center;
}

.badge img {
  width: 130px;
  height: 130px;
  object-fit: contain;
}

.badge span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
  line-height: 1.35;
}

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px 40px;
}

.skills > div {
  min-width: 0;
}

.skills h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.skills p {
  margin: 0;
  color: var(--text-soft);
}

/* ---------- Projects ---------- */
.featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.card img {
  display: block;
  flex: none;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--line);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 22px;
}

.card h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.card p {
  margin: 0;
  color: var(--text-soft);
}

.card-stack {
  font-size: 0.88rem;
  color: var(--text-soft);
}

.card-link {
  margin-top: auto;
  padding-top: 6px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.more {
  margin-top: 48px;
}

.more h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Shared row list, used by "More projects" and "Education" */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}

.rows li > div {
  flex: 1 1 320px;
  min-width: 0;
}

.rows strong {
  display: block;
  font-weight: 600;
}

.rows .desc {
  color: var(--text-soft);
  max-width: 62ch;
}

.rows .meta {
  color: var(--text-soft);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ---------- Contact ---------- */
.contact p {
  color: var(--text-soft);
  max-width: 55ch;
  margin: 0 0 20px;
  font-size: 1.05rem;
}

.social {
  display: flex;
  gap: 20px;
  align-items: center;
}

.social a {
  display: inline-flex;
  color: var(--text);
  transition: opacity 0.15s ease;
}

.social a:hover {
  opacity: 0.65;
}

.social svg,
.social img {
  width: 28px;
  height: 28px;
}

.social img {
  filter: var(--logo-filter);
}

.social.small svg,
.social.small img {
  width: 22px;
  height: 22px;
}

.email-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--text-soft);
  text-decoration: none;
}

.email-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-block: 28px;
}

.site-footer .site-name {
  font-size: 1rem;
}

.site-footer small {
  color: var(--text-soft);
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-block: 24px 40px;
  }

  .intro-photo {
    max-width: 200px;
  }
}

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

  .btn,
  .social a {
    transition: none;
  }
}
