/* ============================================================
   RONIT CHOUDHURY — CODE-EDITOR PORTFOLIO
   Light brutalism + steampunk. Latin Roman Mono headers.
   ============================================================ */

/* ---- FONTS ---- */
@import url('https://cdn.jsdelivr.net/gh/aaaakshat/cm-web-fonts@master/fonts.css');

/* ---- RESET & BASE ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:        #faf8f3;
  --gutter:    #f0ede6;
  --surface:   #fffefc;
  --text:      #2a2825;
  --text-dim:  #5e5c58;
  --text-faint:#9e9a92;
  --accent:    #a0522d;
  --accent-hi: #7a3b1a;
  --accent-dim:#c49a6c;
  --border:    #ddd8cf;
  --border-hi: #c8c3ba;
  --danger:    #a03030;
  --ok:        #4a6b3e;
  --line-num:  #bdb8ae;
  --line-active:#e8e3da;
  --cursor:    #a0522d;

  --mono:      'JetBrains Mono', 'SF Mono', 'Fira Code', 'Liberation Mono', monospace;
  --header:    'Computer Modern Typewriter', 'Courier Prime', 'Courier New', monospace;

  --gutter-w:  60px;
  --line-h:    22px;
  --nav-h:     52px;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--mono);
  font-size: 17px;
  line-height: var(--line-h);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  padding-left: var(--gutter-w);
  position: relative;
}

/* ---- LINE GUTTER ---- */
.line-gutter {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--gutter-w);
  height: 100vh;
  background: var(--gutter);
  border-right: 1px solid var(--border);
  z-index: 200;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
  line-height: var(--line-h);
  color: var(--line-num);
  text-align: right;
  padding-right: 12px;
  user-select: none;
  pointer-events: none;
}

.line-gutter .line-num {
  height: var(--line-h);
  line-height: var(--line-h);
}

/* ---- SELECTION ---- */
::selection {
  background: rgba(160, 82, 45, 0.22);
  color: var(--text);
}

/* ---- NAV ---- */
.nav {
  position: sticky;
  top: 0;
  left: var(--gutter-w);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  width: calc(100% - var(--gutter-w));
}

.nav-logo {
  font-family: var(--header);
  font-size: 15px;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0;
  border: 0;
  padding: 1px 0;
}

.nav-logo:hover {
  background: transparent;
  color: var(--accent-hi);
}

.nav-links {
  display: flex;
  gap: 2px;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 10px;
  border-bottom: 1px solid transparent;
  transition: all 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
  background: transparent;
}

/* ---- HEADER ---- */
.header {
  padding: 56px 24px 44px;
  max-width: 960px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  margin-bottom: 28px;
  text-transform: uppercase;
}

.header-status::before {
  content: '● ';
  color: var(--ok);
}

.header-name {
  font-family: var(--header);
  font-size: clamp(32px, 6.5vw, 68px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}

.header-cursor {
  display: inline-block;
  font-family: var(--header);
  color: var(--cursor);
  animation: blink 1.1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.header-manifesto {
  font-family: var(--header);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 20px;
  max-width: 720px;
}

.header-manifesto li {
  list-style: none;
  position: relative;
  padding-left: 18px;
  margin-bottom: 4px;
}

.header-manifesto li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent-dim);
}

.header-tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.header-rule {
  height: 1px;
  background: var(--border-hi);
  width: 100%;
}

/* ---- MAIN & SECTIONS ---- */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  position: relative;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
}

.section-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0;
  flex-shrink: 0;
}

.section-header h2 {
  font-family: var(--header);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text);
}

.section-body {
  padding-left: 0;
}

/* ---- ABOUT ---- */
.about-text {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
}

.about-quote {
  margin-top: 24px;
  padding: 14px 0 14px 18px;
  border-left: 2px solid var(--accent-dim);
  background: transparent;
  color: var(--text-dim);
  font-family: var(--header);
  font-size: 14px;
  line-height: 1.65;
  font-style: italic;
}

.about-quote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  font-style: normal;
}

/* ---- STACK ---- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px 32px;
}

.stack-card {
  background: transparent;
  padding: 0;
}

.stack-label {
  font-family: var(--header);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.stack-items {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}

/* ---- PROJECTS ---- */
.project {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  padding: 18px 0 6px;
  margin-bottom: 16px;
}

.project:last-child {
  margin-bottom: 0;
}

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

.project-name {
  font-family: var(--header);
  font-size: 17px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  border: 0;
  padding: 0;
  background: transparent;
}

.project-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.project-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  padding-bottom: 1px;
}

.project-link:hover {
  color: var(--accent-hi);
  border-bottom-color: var(--accent-hi);
}

/* ---- GITHUB ---- */
.gh-block {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  padding: 10px 0 0;
}

.gh-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.gh-row:last-child {
  border-bottom: none;
}

.gh-key {
  font-family: var(--mono);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}

.gh-val {
  font-family: var(--mono);
  color: var(--text);
  font-weight: 600;
}

.gh-repos-label {
  font-family: var(--header);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.gh-repo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.gh-repo:last-child {
  border-bottom: none;
}

.gh-repo a {
  font-family: var(--mono);
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.gh-repo a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.gh-repo-meta {
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}

.gh-loading {
  font-family: var(--mono);
  color: var(--text-faint);
  font-size: 13px;
  font-style: italic;
}

.gh-error {
  font-family: var(--mono);
  color: var(--danger);
  font-size: 13px;
}

.gh-note {
  margin-top: 18px;
  padding: 10px 0 0 16px;
  border-left: 2px solid var(--accent-dim);
  background: transparent;
  font-family: var(--header);
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

/* ---- READING ---- */
.reading-list {
  display: grid;
  gap: 18px;
}

.reading-item {
  background: transparent;
  padding: 0 0 16px;
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.reading-item:last-child {
  border-bottom: none;
}

.reading-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.reading-title {
  font-family: var(--header);
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
}

.reading-author {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.reading-trivia {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  padding-left: 16px;
  border-left: 1px solid var(--border-hi);
  margin-top: 4px;
}

/* ---- WRITING ---- */
.writing-list {
  display: grid;
  gap: 0;
}

.writing-item {
  background: transparent;
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.writing-item:last-child {
  border-bottom: none;
}

.writing-item a {
  font-family: var(--header);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  border-bottom: 1px solid var(--border);
}

.writing-item a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.writing-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0;
}

.writing-more {
  margin-top: 14px;
  font-size: 12px;
}

.writing-more a {
  font-family: var(--mono);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
}

/* ---- CONTACT ---- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px 28px;
}

.contact-row {
  display: flex;
  background: transparent;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.contact-type {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: transparent;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  font-weight: 600;
}

.contact-row a {
  flex: 1;
  padding: 10px 0 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  border-bottom: none;
  overflow-wrap: anywhere;
}

.contact-row a:hover {
  background: transparent;
  color: var(--accent);
}

/* ---- FOOTER ---- */
.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 24px 56px;
  text-align: center;
}

.footer-rule {
  height: 1px;
  background: var(--border);
  margin-bottom: 20px;
}

.footer p {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .line-gutter {
    display: none;
  }

  body {
    padding-left: 0;
  }

  .nav {
    left: 0;
    width: 100%;
    padding: 0 14px;
    height: auto;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .nav-links {
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .header {
    padding: 36px 14px 28px;
  }

  .main {
    padding: 0 14px;
  }

  .section {
    padding: 32px 0;
  }

  .project-header {
    flex-direction: column;
    gap: 6px;
  }

  .contact-row {
    flex-direction: column;
  }

  .contact-type {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-cursor {
    animation: none;
  }
}
