/* ===================================================================
   HARIKRISHNA MANOJ — PORTFOLIO
   Design concept: "the editor" — a developer's workspace as a page.
   Tab bar = navigation. Terminal = hero. Git log = experience timeline.
   ===================================================================*/

:root {
  /* Color */
  --ink:        #0F141B;   /* base background, deep charcoal-navy */
  --surface:    #171F2A;   /* panels / cards */
  --surface-2:  #1E2733;   /* raised panels */
  --line:       #2A3441;   /* hairlines / borders */
  --text:       #E7EDF3;   /* primary text */
  --muted:      #8B9AAE;   /* secondary text */
  --amber:      #F3A85C;   /* accent — "build" / warm highlight */
  --teal:       #4ED9C4;   /* accent — "pass" / cool highlight */
  --red-dot:    #E5675B;   /* traffic-light dots */
  --amber-dot:  #E8B95C;
  --green-dot:  #61C77A;

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --maxw: 1100px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--ink);
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
img { max-width: 100%; display: block; }

::selection { background: var(--amber); color: var(--ink); }

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

/* ---------- scroll progress ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  z-index: 999;
  transition: width 0.08s linear;
}

/* ---------- editor chrome / tab-bar nav ---------- */
.editor-frame {
  max-width: var(--maxw);
  margin: 28px auto 0;
  padding: 0 24px;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 10px 16px;
}

.dots { display: flex; gap: 7px; flex-shrink: 0; }
.dots span { width: 11px; height: 11px; border-radius: 50%; display: block; }
.dots span:nth-child(1) { background: var(--red-dot); }
.dots span:nth-child(2) { background: var(--amber-dot); }
.dots span:nth-child(3) { background: var(--green-dot); }

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 7px 14px;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.tab.active {
  color: var(--teal);
  background: var(--ink);
  border-color: var(--line);
  border-bottom-color: var(--ink);
  position: relative;
  top: 1px;
}

.editor-body {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- section shell ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 24px;
}
.section + .section { border-top: 1px solid var(--line); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--teal);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.eyebrow::before { content: '//'; color: var(--muted); }

.section h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: 32px;
}

/* ---------- hero / terminal ---------- */
.hero {
  padding: 64px 24px 56px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: center;
}

.hero-photo-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.hero-photo-wrap:hover {
  border-color: var(--teal);
  transform: translateY(-4px);
}
.hero-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-photo-wrap {
    max-width: 260px;
    margin: 20px auto 0;
  }
}

.terminal {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 24px;
  max-width: 620px;
}
.terminal .line { margin-bottom: 6px; }
.terminal .prompt { color: var(--teal); }
.terminal .out { color: var(--amber); }
.terminal .muted-out { color: var(--muted); }
.caret {
  display: inline-block;
  width: 8px; height: 16px;
  background: var(--teal);
  margin-left: 2px;
  vertical-align: -3px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-title {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.02;
  margin: 28px 0 10px;
}
.hero-title .accent { color: var(--teal); }
.hero-role {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 28px;
}
.hero-role .badge {
  color: var(--amber);
}

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 12px 20px;
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--teal); color: var(--ink); border-color: var(--teal); font-weight: 600; }
.btn-primary:hover { background: #5EE7D2; }
.btn-ghost { color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- stack marquee ---------- */
.marquee-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
  background: var(--surface);
}
.marquee {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: scroll-x 28s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; } }
@keyframes scroll-x {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.chip {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 16px;
  white-space: nowrap;
  background: var(--ink);
}
.chip .dot { color: var(--teal); margin-right: 6px; }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-stagger.in-view { transition-delay: var(--d, 0s); }

/* ---------- project cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--teal); transform: translateY(-4px); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  background: var(--amber);
  border-radius: 4px;
  padding: 3px 8px;
  font-weight: 700;
}
.card-tag.co { background: var(--teal); }
.card-year { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p.desc { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }

.card ul {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.8px;
}
.card ul li { margin-bottom: 5px; }

.tech-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tech-row span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--teal);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
}

.card-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--muted);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.card-link:hover { color: var(--teal); border-color: var(--teal); }

/* ---------- git-log timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line);
}
.commit { position: relative; padding-bottom: 34px; }
.commit:last-child { padding-bottom: 0; }
.commit::before {
  content: '';
  position: absolute;
  left: -28px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--teal);
}
.commit-hash { font-family: var(--font-mono); font-size: 12px; color: var(--amber); margin-right: 10px; }
.commit-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.commit h3 { font-size: 17px; margin: 6px 0 4px; }
.commit p { color: var(--muted); font-size: 14.5px; max-width: 560px; }

/* ---------- skills matrix (about page) ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.skill-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.skill-group h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.skill-group ul { list-style: none; margin: 0; padding: 0; }
.skill-group li {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.skill-group li:last-child { border-bottom: none; }
.skill-group li::before { content: '▸'; color: var(--teal); }

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

.about-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.file-block {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.file-block .k { color: var(--teal); }
.file-block .v { color: var(--text); }
.file-block div { padding: 3px 0; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 14.5px;
  color: var(--text);
  transition: color 0.15s ease, padding-left 0.15s ease;
}
.contact-list a:hover { color: var(--teal); padding-left: 6px; }
.contact-list .label { color: var(--muted); font-size: 12px; }

form.compose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
form.compose label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal);
  margin-bottom: 6px;
  margin-top: 16px;
}
form.compose label:first-child { margin-top: 0; }
form.compose input, form.compose textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}
form.compose input:focus, form.compose textarea:focus {
  border-color: var(--teal);
  outline: none;
}
form.compose textarea { resize: vertical; min-height: 100px; }
form.compose button {
  margin-top: 20px;
  width: 100%;
  justify-content: center;
  cursor: pointer;
}

.form-result {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: none;
  transition: all 0.2s ease;
}
.form-result.show {
  display: block;
}
.form-result.success {
  display: block;
  color: var(--teal);
  background: rgba(78, 217, 196, 0.08);
  border-color: var(--teal);
}
.form-result.error {
  display: block;
  color: var(--red-dot);
  background: rgba(229, 103, 91, 0.08);
  border-color: var(--red-dot);
}

/* ---------- footer ---------- */
footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px 24px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
footer a:hover { color: var(--teal); }

/* ---------- misc ---------- */
.lede {
  color: var(--muted);
  font-size: 16px;
  max-width: 640px;
  margin-bottom: 8px;
}

/* ---------- mobile menu components ---------- */
.mobile-active-file {
  display: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal);
  font-weight: 500;
}

.menu-toggle {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  padding: 8px 7px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  z-index: 101;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.menu-toggle:hover {
  border-color: var(--teal);
}
.menu-toggle .bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle.active .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.active .bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===================================================================
   MOBILE & TABLET OPTIMIZATIONS
   =================================================================== */

/* Prevent horizontal overflow on mobile viewports */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

@media (max-width: 768px) {
  .editor-frame {
    margin-top: 10px;
    padding: 0 10px;
  }
  
  .titlebar {
    position: relative;
    justify-content: space-between;
    padding: 10px 14px;
  }

  .mobile-active-file {
    display: inline-block;
  }

  .menu-toggle {
    display: flex;
  }

  .dots {
    gap: 5px;
  }
  .dots span {
    width: 9px;
    height: 9px;
  }

  .tabs {
    display: none;
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    flex-direction: column;
    padding: 10px;
    gap: 6px;
    z-index: 100;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  }

  .tabs.open {
    display: flex;
    animation: menuSlideDown 0.2s ease-out;
  }
  
  .tab {
    width: 100%;
    font-size: 13.5px;
    padding: 12px 14px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .tab.active {
    background: var(--ink);
    border-color: var(--teal);
    color: var(--teal);
    font-weight: 600;
  }
  
  .section {
    padding: 44px 16px;
  }
  
  .section h2 {
    font-size: 24px;
    margin-bottom: 22px;
  }
  
  .hero {
    padding: 32px 14px 40px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  
  .hero-photo-wrap {
    max-width: 240px;
    margin: 0 auto;
  }

  .terminal {
    font-size: 13.5px;
    padding: 16px 18px;
    word-break: break-word;
  }
  
  .hero-title {
    font-size: clamp(28px, 7.5vw, 42px);
    margin: 20px 0 12px;
  }
  
  .hero-role {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
  }
  
  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
    padding: 13px 18px;
    font-size: 14px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .card {
    padding: 18px;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .about-photo {
    max-width: 260px;
    margin: 0 auto;
  }

  .file-block {
    font-size: 12.5px;
    padding: 14px 16px;
    overflow-x: auto;
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
  }
  
  .skill-group {
    padding: 14px;
  }

  .timeline {
    padding-left: 20px;
  }
  
  .timeline::before {
    left: 4px;
  }
  
  .commit::before {
    left: -20px;
    width: 10px;
    height: 10px;
    top: 5px;
  }
  
  .commit-hash, .commit-date {
    display: inline-block;
    font-size: 11px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  
  .contact-list a {
    padding: 14px 0;
    font-size: 13.5px;
  }

  /* Prevent iOS zoom on form input focus */
  form.compose input, 
  form.compose textarea {
    font-size: 16px !important;
    padding: 12px;
  }
  
  footer {
    padding: 28px 16px 40px;
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .editor-frame {
    padding: 0 6px;
    margin-top: 6px;
  }
  
  .hero-title {
    font-size: 26px;
  }
  
  .chip {
    font-size: 12px;
    padding: 5px 12px;
  }

  .card h3 {
    font-size: 17px;
  }

  .card p.desc {
    font-size: 13.5px;
  }

  .card ul {
    font-size: 13px;
    padding-left: 14px;
  }
}

@keyframes menuSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
