/* ============================================
   TOKENS — terminal / phosphor palette
   ============================================ */
:root{
  /* Dark theme — lifted, still moody but not muddy */
  --bg: #12181A;          /* lighter charcoal-green, not near-black */
  --surface: #1B2320;     /* softer dark surface for cards/nav */
  --text: #F3F1E7;        /* warm ivory, higher contrast */
  --muted: #9CB0A4;       /* lighter sage, readable on dark bg */
  --accent: #3F9C74;      /* slightly brighter Tanjiro green */
  --accent-2: #FF7B8A;    /* Nezuko pink, a touch brighter */
  --line: rgba(255,255,255,0.14);

  --font: 'JetBrains Mono', ui-monospace, monospace;
  --nav-h: 68px;
  --edge: clamp(18px, 5vw, 56px);
  --ease: cubic-bezier(.16,.84,.44,1);
}

html[data-theme="light"]{
  --bg: #F6F3EC;
  --surface: #ECE4D6;
  --text: #1A1F1B;
  --muted: #5E6E64;
  --accent: #256B4E;
  --accent-2: #E8412C;
  --line: rgba(17,24,39,0.12);
}

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

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  transition: background .5s var(--ease), color .5s var(--ease);
  overflow-x: hidden;
  position: relative;
}

/* CRT scanline overlay — subtle */
body::before{
  content:'';
  position: fixed; inset:0;
  z-index: 5;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.028) 0px,
    rgba(255,255,255,0.028) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

a{ color: inherit; text-decoration: none; }
ul{ margin:0; padding:0; list-style:none; }

.comment, .prompt{ color: var(--accent); }

/* ============================================
   PIXEL ICONS
   ============================================ */
.icon-slot{ display:inline-flex; color: currentColor; }
.icon-slot svg{ image-rendering: pixelated; display:block; }

/* ============================================
   BACKGROUND CANVAS
   ============================================ */
#bg-canvas{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: .7;
  pointer-events: none;
  image-rendering: pixelated;
}
html[data-theme="light"] #bg-canvas{ opacity: .4; }

/* ============================================
   NAV
   ============================================ */
.nav{
  position: fixed;
  top:0; left:0; right:0;
  height: var(--nav-h);
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 0 var(--edge);
  z-index: 50;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav__mark{
  display:flex;
  align-items:center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--text);
}
.nav__mark .icon-slot{ color: var(--accent); }

.nav__links{ display:flex; gap: 28px; }
.nav__links a{
  font-size: 13px;
  color: var(--muted);
  transition: color .3s var(--ease);
}
.nav__links a:hover{ color: var(--accent); }

.nav__controls{ display:flex; gap: 10px; }

.icon-btn{
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 36px; height: 36px;
  display:flex; align-items:center; justify-content:center;
  cursor: pointer;
  color: var(--text);
  transition: border-color .3s var(--ease);
  position: relative;
}
.icon-btn:hover{ border-color: var(--accent); }

.theme-icon{ position:absolute; }
.theme-icon--light{ display:none; }
html[data-theme="light"] .theme-icon--dark{ display:none; }
html[data-theme="light"] .theme-icon--light{ display:inline-flex; }

.menu-btn{
  display:none;
  flex-direction:column;
  gap:5px;
  background:none;
  border:none;
  cursor:pointer;
  padding:8px;
}
.menu-btn span{ width:20px; height:1px; background: var(--text); }

.mobile-nav{
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--bg);
  z-index: 49;
  display:flex;
  flex-direction:column;
  padding: 32px var(--edge);
  gap: 20px;
  transform: translateY(-110%);
  transition: transform .5s var(--ease);
}
.mobile-nav.open{ transform: translateY(0); }
.mobile-nav a{ font-size: 22px; }
.mobile-nav a::before{ content: '/'; color: var(--accent); margin-right: 4px; }

/* ============================================
   MAIN / SECTIONS
   ============================================ */
main{ position:relative; z-index:1; }
section, .footer{ padding: 100px var(--edge); position: relative; }

.section-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 36px;
}
.section-head h2{
  font-weight: 500;
  font-size: clamp(22px, 3.4vw, 32px);
  margin:0;
}
.section-head h2::before{ content: '## '; color: var(--accent); }
.section-head__count{ font-size: 12px; color: var(--muted); }

/* ============================================
   HERO
   ============================================ */
.hero{
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding-top: var(--nav-h);
}

.hero__eyebrow{
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 20px;
}

.hero__title{
  margin: 0;
  font-weight: 700;
  font-size: clamp(48px, 11vw, 132px);
  line-height: .96;
  letter-spacing: -.01em;
}
.hero__title .reveal{ display:block; overflow:hidden; }

.caret{
  display:inline-block;
  width: .5em; height: .8em;
  background: var(--accent);
  margin-left: .08em;
  animation: blink 1.1s step-end infinite;
  vertical-align: -0.08em;
}
@keyframes blink{ 50%{ opacity: 0; } }

.hero__role{
  font-size: clamp(14px, 1.6vw, 17px);
  color: var(--muted);
  margin: 24px 0 8px;
  max-width: 42ch;
}
.hero__bio{
  font-size: 14px;
  color: var(--muted);
  max-width: 50ch;
  line-height: 1.6;
  margin: 0 0 44px;
}
.hero__scroll{
  display:flex;
  align-items:center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  width: fit-content;
}
.hero__scroll-line{
  width: 40px; height: 1px;
  background: var(--muted);
  position: relative;
  overflow: hidden;
}
.hero__scroll-line::after{
  content:'';
  position:absolute; left:-100%; top:0;
  width:100%; height:100%;
  background: var(--accent);
  animation: scrollline 2s ease-in-out infinite;
}
@keyframes scrollline{
  0%{ left:-100%; } 50%{ left:0; } 100%{ left:100%; }
}

/* ============================================
   PROJECTS
   ============================================ */
.project-list{ position: relative; }

.project-item{ border-bottom: 1px solid var(--line); }
.project-item:last-child{ border-bottom: none; }

.project-row{
  width: 100%;
  display:grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items:center;
  gap: 20px;
  padding: 22px 0;
  border: none;
  background: none;
  color: inherit;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: padding-left .35s var(--ease);
}
.project-row:hover{ padding-left: 10px; }

.project-row__index{ font-size: 12px; color: var(--muted); }
.project-row__name{
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 500;
  transition: color .3s var(--ease), transform .35s var(--ease);
}
.project-row:hover .project-row__name{ color: var(--accent); transform: translateX(6px); }

.project-row__meta{
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.project-row__toggle{
  font-size: 12px;
  color: var(--muted);
  transition: color .3s var(--ease);
  min-width: 24px;
  text-align: right;
}
.project-row:hover .project-row__toggle{ color: var(--accent); }
.project-item.open .project-row__toggle{ color: var(--accent); }
.project-item.open .project-row__name{ color: var(--accent); }

/* accordion panel — animated via grid-template-rows so no JS height math */
.project-panel{
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s var(--ease);
}
.project-item.open .project-panel{ grid-template-rows: 1fr; }
.project-panel__inner{ overflow: hidden; }

.project-panel__grid{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: 4px 0 32px;
}

.project-gallery{ display:flex; flex-direction: column; gap: 8px; }

.project-gallery__main{
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface);
  overflow: hidden;
}
.project-gallery__main img{
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  filter: contrast(1.05) saturate(0.9);
  transition: opacity .2s var(--ease);
}
.project-gallery__main .corner{ position:absolute; }

.project-gallery__thumbs{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.thumb{
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  aspect-ratio: 4/3;
  overflow: hidden;
  opacity: .55;
  transition: opacity .25s var(--ease), border-color .25s var(--ease);
}
.thumb img{
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}
.thumb:hover{ opacity: .85; }
.thumb--active{ opacity: 1; border-color: var(--accent); }

.project-panel__body{ display:flex; flex-direction: column; gap: 18px; min-width: 0; }
.project-panel__desc{
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}
.project-panel__row{ display:flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.project-panel__label{
  font-size: 11px;
  color: var(--muted);
  min-width: 44px;
  flex-shrink: 0;
}
.project-panel__tech{ display:flex; gap: 8px; flex-wrap: wrap; }
.tech-badge{
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--accent);
  background: var(--surface);
}
.project-panel__links{ display:flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.project-panel__links a{ color: var(--text); border-bottom: 1px solid var(--line); }
.project-panel__links a:hover{ color: var(--accent); border-color: var(--accent); }
.project-panel__nolink{ font-size: 12px; color: var(--muted); }

.project-preview{
  position: fixed;
  top:0; left:0;
  width: 220px;
  aspect-ratio: 4/3;
  pointer-events:none;
  z-index: 40;
  opacity: 0;
  transform: translate(-50%,-50%) scale(.92);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  background: var(--surface);
  padding: 10px;
}
.project-preview.visible{ opacity:1; transform: translate(-50%,-50%) scale(1); }
.project-preview__frame{
  position:relative;
  width:100%; height:100%;
}
.project-preview img{
  width:100%; height:100%; object-fit: cover; display:block;
  image-rendering: pixelated;
  filter: contrast(1.05) saturate(0.9);
}
.project-preview__frame::before,
.project-preview__frame::after,
.project-preview span.corner{
  content:'';
  position:absolute;
  width: 10px; height: 10px;
  color: var(--accent);
}
.corner{ position:absolute; font-size: 13px; line-height: 1; color: var(--accent); }
.corner--tl{ top: 2px; left: 2px; }
.corner--tr{ top: 2px; right: 2px; }
.corner--bl{ bottom: 2px; left: 2px; }
.corner--br{ bottom: 2px; right: 2px; }

/* ============================================
   INFO
   ============================================ */
.info__grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-bottom: 56px;
}
.info__col h3{
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 500;
}
.info__col p{ line-height: 1.6; font-size: 13px; margin:0; color: var(--text); }
.plain-list li{
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.plain-list li::before{ content: '- '; color: var(--muted); }

.faq__item{ border-top: 1px solid var(--line); padding: 18px 0; }
.faq__item:last-child{ border-bottom: 1px solid var(--line); }
.faq__item summary{
  cursor: pointer;
  font-size: 15px;
  list-style: none;
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 12px;
}
.faq__item summary::after{
  content: '[+]';
  color: var(--muted);
  font-size: 12px;
}
.faq__item[open] summary::after{ content:'[-]'; }
.faq__item summary::-webkit-details-marker{ display:none; }
.faq__item p{
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 62ch;
}

/* ============================================
   CONTACT
   ============================================ */
.contact__email{
  display:flex;
  align-items:center;
  gap: 14px;
  font-size: clamp(24px, 5vw, 46px);
  font-weight: 500;
  border-bottom: 2px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 28px;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.contact__email:hover{ color: var(--accent); border-color: var(--accent); }

.contact__social{ display:flex; gap: 24px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.contact__social a{ display:flex; align-items:center; gap: 8px; }
.contact__social a:hover{ color: var(--accent); }

.resume-box{
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 40px;
  max-width: 46ch;
}
.resume-box__icon{ color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.resume-box__body{ display: flex; flex-direction: column; gap: 8px; }
.resume-box__label{ font-size: 11px; color: var(--muted); margin: 0; }
.resume-box__link{
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  width: fit-content;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.resume-box__link:hover{ color: var(--accent); border-color: var(--accent); }
.resume-box__note{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer{
  display:flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding-top: 32px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 800px){
  .nav__links{ display:none; }
  .menu-btn{ display:flex; }
  .info__grid{ grid-template-columns: 1fr; gap: 28px; }
  .project-row{ grid-template-columns: 26px 1fr auto; }
  .project-row__meta{ display:none; }
  .project-preview{ display:none; }
  .project-panel__grid{ grid-template-columns: 1fr; }
  .project-gallery{ max-width: 280px; }
  .footer{ flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
  html{ scroll-behavior: auto; }
}
