/* =========================================================
   Ganesh Patil — Portfolio
   Theme: "the editor" — a personal site styled like the IDE
   a developer actually lives in: file-tab navigation, a
   terminal-chrome hero, and a contribution graph built from
   real numbers instead of a decorative stat block.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root{
  /* --- color: 6 named values --- */
  --bg:          #F8F9FA;
  --surface:     #FFFFFF;
  --surface-2:   #F1F3F5;
  --border:      #E9ECEF;
  --text:        #212529;
  --text-muted:  #495057;
  --accent:      #0D9488;
  --accent-2:    #D97706;

  /* --- type --- */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body:    'IBM Plex Sans', 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --radius: 6px;
}

/* --- Dark Theme --- */
body.dark-theme {
  --bg:          #0D0F16;
  --surface:     #161A26;
  --surface-2:   #1E2333;
  --border:      #2B3143;
  --text:        #ECEAE6;
  --text-muted:  #97A0B5;
  --accent:      #5FD4C4;
  --accent-2:    #F2B85C;
}

/* --- reset --- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}
img{ max-width: 100%; display: block; }
ul, ol{ margin: 0; padding: 0; }
a{ color: var(--accent); }

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

/* visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* =========================================================
   Layout shell
   ========================================================= */
.wrap{
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   Nav — "file tabs" like an editor's open-file bar
   ========================================================= */
.editor-bar{
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.editor-bar .wrap{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
  padding-bottom: 0;
  gap: 16px;
}
.brand{
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 14px 0;
  white-space: nowrap;
}
.brand strong{ color: var(--text); font-weight: 500; }

.tabs{
  display: flex;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar{ display: none; }

.tabs li a{
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 14px 18px;
  border-top: 2px solid transparent;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.tabs li a:hover{ color: var(--text); background: var(--surface-2); }
.tabs li a .dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.tabs li a[aria-current="page"]{
  color: var(--text);
  background: var(--bg);
  border-top-color: var(--accent);
}
.tabs li a[aria-current="page"] .dot{ background: var(--accent-2); }

.menu-toggle{
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: pointer;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--accent);
}

/* =========================================================
   Hero
   ========================================================= */
.hero{
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}
.window-chrome{
  display: flex;
  gap: 7px;
  margin-bottom: 28px;
}
.window-chrome span{
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--border);
}
.window-chrome span:nth-child(1){ background: #E5697A; }
.window-chrome span:nth-child(2){ background: var(--accent-2); }
.window-chrome span:nth-child(3){ background: var(--accent); }

.hero .eyebrow{
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin: 0 0 14px;
}
.hero h1{
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 10px;
}
.hero .role{
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 22px;
}
.hero p.lede{
  max-width: 58ch;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 28px;
}
.hero .cta-row{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover{ border-color: var(--accent); transform: translateY(-1px); }
.btn.primary{
  background: var(--accent);
  color: #06231F;
  border-color: var(--accent);
  font-weight: 500;
}
.btn.primary:hover{ border-color: var(--accent-2); }

/* =========================================================
   Contribution graph — the signature element.
   Not decoration: each cell is one week's real activity
   band across ASF / CERN Phoenix / Alaska ORG contributions.
   ========================================================= */
.contrib{
  margin-top: 40px;
}
.contrib .contrib-label{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.contrib .contrib-label strong{ color: var(--text); font-weight: 500; }
.grid-graph{
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.cell{
  width: 100%;
  aspect-ratio: 1;
  min-width: 8px;
  border-radius: 2px;
  background: var(--surface-2);
}
.cell.l1{ background: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); }
.cell.l2{ background: color-mix(in srgb, var(--accent) 50%, var(--surface-2)); }
.cell.l3{ background: color-mix(in srgb, var(--accent) 75%, var(--surface-2)); }
.cell.l4{ background: var(--accent); }

/* =========================================================
   Sections
   ========================================================= */
section{
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
section:last-of-type{ border-bottom: none; }

.section-head{
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 32px;
}
.section-head .tag{
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-2);
}
.section-head h2{ font-size: 1.6rem; margin: 0; }

/* Education / experience timeline — order carries meaning, so <ol> */
.timeline{
  list-style: none;
  counter-reset: item;
  border-left: 1px solid var(--border);
  padding-left: 0;
}
.timeline li{
  position: relative;
  list-style: none;
  padding: 0 0 32px 28px;
  counter-increment: item;
}
.timeline li:last-child{ padding-bottom: 0; }
.timeline li::before{
  content: counter(item, decimal-leading-zero);
  position: absolute;
  left: -13px;
  top: 0;
  transform: translateX(-100%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
}
.timeline li::after{
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline .when{
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.timeline h3{ font-size: 1.15rem; margin-bottom: 4px; }
.timeline .where{ color: var(--text-muted); font-size: 0.95rem; margin: 0 0 10px; }
.timeline ul{ margin-top: 10px; }
.timeline ul li{
  padding: 0 0 8px 0;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.timeline ul li::before, .timeline ul li::after{ content: none; }
.timeline ul{ padding-left: 0; border: none; }
.timeline ul li{ list-style: none; padding-left: 20px; position: relative; }
.timeline ul li::marker{ content: none; }
.timeline ul li::before{
  content: '›';
  position: absolute; left: 0; top: 0;
  color: var(--accent);
  background: none;
  border: none;
}

/* Skill list — no inherent order, so a plain <ul> as a tag cloud */
.skill-groups{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}
.skill-groups h3{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-2);
  text-transform: lowercase;
  margin-bottom: 12px;
}
.pill-list{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.pill-list li{
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
}

/* Cards — projects / contributions */
.card-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
  gap: 20px;
}
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.card h3{ font-size: 1.15rem; margin-bottom: 8px; }
.card p{ color: var(--text-muted); font-size: 0.95rem; margin: 0 0 14px; }
.card .stack{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.card .stack span{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 4px;
  padding: 3px 8px;
}
.card a.link{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  margin-top: auto;
}
.card a.link::after{ content: ' →'; }

/* Bullet list inside cards / body copy */
.check-list{ list-style: none; }
.check-list li{
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.check-list li::before{
  content: '//';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Achievements */
.achieve-row{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.achieve-row article{
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--surface);
}
.achieve-row h3{ font-size: 1.05rem; margin-bottom: 6px; }
.achieve-row p{ color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* =========================================================
   Contact form
   ========================================================= */
.contact-layout{
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
}
.contact-info h3{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-2);
  margin-bottom: 14px;
}
.contact-info ul{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.contact-info li{ margin-bottom: 0; }
.contact-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.contact-icon:hover,
.contact-icon:focus-visible{
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.contact-icon svg{
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

form.card{ gap: 16px; }
.field{ margin-bottom: 18px; }
.field label{
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.field input,
.field select,
.field textarea{
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color: var(--accent);
  outline: none;
}
.field textarea{ resize: vertical; min-height: 110px; }
.field-row{ display: flex; gap: 16px; }
.field-row .field{ flex: 1; }

/* =========================================================
   Footer
   ========================================================= */
footer{
  padding: 40px 0 56px;
}
footer .wrap{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
footer .social{
  display: flex;
  gap: 18px;
  list-style: none;
}
footer .social a{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-muted);
}
footer .social a:hover{ color: var(--accent); }
footer .copy{
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 760px){
  .contact-layout{ grid-template-columns: 1fr; }
  .field-row{ flex-direction: column; gap: 0; }
  .editor-bar .wrap{ align-items: stretch; }
  .menu-toggle{ display: inline-flex; align-self: center; }
  .tabs{
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .tabs.open{ display: flex; }
  .tabs li a{ border-right: none; border-bottom: 1px solid var(--border); padding: 14px 24px; }
  .hero{ padding: 48px 0 40px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .btn{ transition: none; }
}