/* ==========================================================================
   Mohith Pukale — portfolio
   Design tokens, layout, and components. No framework.
   ========================================================================== */

:root {
  color-scheme: light;

  --bg:            #ffffff;
  --bg-alt:        #f6f7f9;
  --surface:       #ffffff;
  --surface-2:     #f1f3f6;
  --border:        #e3e6eb;
  --border-strong: #d2d7df;

  --text:          #101828;
  --text-muted:    #58606e;
  --text-subtle:   #5f6875; /* darkened from #7d8695, which fell below WCAG AA on white */

  --accent:        #4338ca;
  --accent-hover:  #3730a3;
  --accent-soft:   rgba(67, 56, 202, 0.09);
  --accent-ring:   rgba(67, 56, 202, 0.35);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 16px -4px rgba(16, 24, 40, 0.10);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, 0.18);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;

  --container: 1080px;
  --header-h: 68px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #0b0e14;
  --bg-alt:        #0f131b;
  --surface:       #12171f;
  --surface-2:     #171d27;
  --border:        #232b38;
  --border-strong: #313b4b;

  --text:          #e8ecf2;
  --text-muted:    #a2acbb;
  --text-subtle:   #7a8494;

  --accent:        #8b93f8;
  --accent-hover:  #a5abfa;
  --accent-soft:   rgba(139, 147, 248, 0.13);
  --accent-ring:   rgba(139, 147, 248, 0.4);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg:            #0b0e14;
    --bg-alt:        #0f131b;
    --surface:       #12171f;
    --surface-2:     #171d27;
    --border:        #232b38;
    --border-strong: #313b4b;

    --text:          #e8ecf2;
    --text-muted:    #a2acbb;
    --text-subtle:   #7a8494;

    --accent:        #8b93f8;
    --accent-hover:  #a5abfa;
    --accent-soft:   rgba(139, 147, 248, 0.13);
    --accent-ring:   rgba(139, 147, 248, 0.4);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  }
}

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

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

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

ul { margin: 0; padding: 0; }

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

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

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

.brand {
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand .brand-dot { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.is-active { color: var(--accent); background: var(--accent-soft); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.nav-toggle { display: none; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease,
              border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

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

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
  padding: 88px 0;
  border-top: 1px solid var(--border);
}
.section-alt { background: var(--bg-alt); }

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

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 12px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.0125rem;
}

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

.hero {
  position: relative;
  padding: clamp(64px, 10vw, 104px) 0 clamp(56px, 8vw, 88px);
  overflow: hidden;
  border-top: none;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto -10%;
  height: 620px;
  background:
    radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.4rem);
  letter-spacing: -0.035em;
  margin-bottom: 14px;
}

.hero-role {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 0.875rem;
  color: var(--text-subtle);
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-portrait {
  position: relative;
  justify-self: center;
  width: min(300px, 100%);
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}
.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Focus cards
   -------------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

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

.card h3 {
  font-size: 1.0625rem;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.9125rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */

.timeline {
  position: relative;
  padding-left: 30px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--border-strong), var(--border));
}

.tl-item { position: relative; padding-bottom: 44px; }
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
}
.tl-item.is-current::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 20px;
  margin-bottom: 4px;
}

.tl-role { font-size: 1.125rem; }

.tl-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

.tl-org {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  font-size: 0.9375rem;
}

.tl-summary {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 14px;
}

.tl-points {
  list-style: none;
  display: grid;
  gap: 9px;
}

.tl-points li {
  position: relative;
  padding-left: 22px;
  font-size: 0.9125rem;
  color: var(--text-muted);
}
.tl-points li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.55;
}

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

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px 40px;
}

.skill-group h3 {
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.tags li {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tags li:hover { color: var(--text); border-color: var(--border-strong); }

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.project:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.project-head h3 { font-size: 1.0625rem; }

.project-link {
  color: var(--text-subtle);
  display: inline-grid;
  place-items: center;
}
.project-link:hover { color: var(--accent); }
.project-link svg { width: 18px; height: 18px; }

.project p {
  font-size: 0.9125rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.project .tags { margin-top: auto; }

.project .tags li {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Education
   -------------------------------------------------------------------------- */

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

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

.edu h3 { font-size: 1.0625rem; margin-bottom: 6px; }

.edu .degree {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.edu .edu-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-bottom: 14px;
}

.edu p {
  font-size: 0.9125rem;
  color: var(--text-muted);
}

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

.contact-panel {
  padding: clamp(36px, 6vw, 60px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.contact-panel h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 12px;
}

.contact-panel > p {
  max-width: 52ch;
  margin: 0 auto 28px;
  color: var(--text-muted);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 30px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.8375rem;
  color: var(--text-subtle);
}

.footer-links {
  display: flex;
  gap: 18px;
  list-style: none;
}
.footer-links a { color: var(--text-subtle); }
.footer-links a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

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

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; width: min(190px, 60%); justify-self: start; }
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-grid; }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }
  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-links a { padding: 11px 12px; font-size: 0.95rem; }

  .section { padding: 64px 0; }
  .timeline { padding-left: 24px; }
  .tl-item::before { left: -24px; }
  .tl-date { white-space: normal; }
}

@media (max-width: 460px) {
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; }
}
