/* ═══════════════════════════════════════════════════════
   PORTFOLIO — style.css
   Palette: base #F2F5DE · dark #232020 · highlight #86E7B8
   ═══════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --base:       #F2F5DE;
  --dark:       #232020;
  --highlight:  #86E7B8;
  --muted:      #B8BAA8;
  --surface:    #E8EBCE;

  --font-sans:  'Syne', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;

  --radius:     3px;
  --border:     1px solid var(--dark);
  --ease:       220ms cubic-bezier(0.25, 0, 0.1, 1);

  --max-w:      1080px;
  --gap:        40px;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--base);
  color: var(--dark);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ── Loader ─────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0;
  background: var(--dark);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-bar {
  width: 120px; height: 2px;
  background: rgba(242,245,222,0.15);
  border-radius: 1px;
  overflow: hidden;
}
.loader-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 0%;
  background: var(--highlight);
  animation: load-fill 0.8s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes load-fill { to { width: 100%; } }

/* ── Header ─────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 50;
  background: var(--dark);
  color: var(--base);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 10px;
}
.logo-bracket {
  color: var(--highlight);
  font-size: 1rem;
}
.logo-name { opacity: 0.9; }
.logo-link { text-decoration: none; }

nav {
  display: flex; align-items: center; gap: 4px;
}
nav a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-decoration: none;
  color: rgba(242,245,222,0.55);
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--ease), background var(--ease);
}
nav a:hover {
  color: var(--highlight);
  background: rgba(134,231,184,0.08);
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px var(--gap) 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  border-bottom: var(--border);
}
.hero-text p {
  margin-top: 1rem;
}
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--dark);
  opacity: 0.4;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.hero h1 mark {
  background: none;
  color: var(--highlight);
  /* drawn-on underline */
  text-decoration: underline;
  text-decoration-color: var(--highlight);
  text-underline-offset: 5px;
  text-decoration-thickness: 3px;
}
.hero-sub {
  margin-top: 20px;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.75;
  opacity: 0.6;
}
.hero-sub ul {
  padding-inline-start: 1em;
}

.hero-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  flex-shrink: 0;
}
.stat {
  text-align: right;
}
.stat-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-top: 2px;
}
.stat-divider {
  width: 1px; height: 1px;  /* visual separator */
  background: var(--muted);
  align-self: stretch;
  margin: 0;
}

/* ── Section wrapper ────────────────────────────────── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap) 100px;
}

/* ── Section header row ─────────────────────────────── */
.section-row {
  display: flex; align-items: center; gap: 16px;
  padding: 28px 0 0;
  margin-bottom: 0;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.35;
  white-space: nowrap;
}
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--dark);
  opacity: 0.15;
}
.section-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  opacity: 0.3;
}

/* ── Project Cards ──────────────────────────────────── */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: start;
  padding: 52px 0;
  border-bottom: 1px solid var(--muted);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.project-card.visible {
  opacity: 1;
  transform: none;
}
.project-card:last-child { border-bottom: none; }

/* card info */
.card-info {}

.card-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.card-tags {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  background: var(--surface);
  padding: 3px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--muted);
}

.card-role {
  display: inline;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.2rem;
  letter-spacing: 0.05em;
  border: 1px solid var(--highlight);
}

.card-title {
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 3rem;
}

.card-year {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-left: 1em;
}

.card-title-bracket-left {
  padding-right: .5em;
  color: var(--highlight);
}
.card-title-bracket-right {
  padding-left: .5em;
  color: var(--highlight);
}
.card-desc {
  font-size: 0.875rem;
  line-height: 1.8;
  opacity: 0.62;
  max-width: 440px;
  margin-bottom: 28px;
}

.card-links {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.card-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--dark);
  border: var(--border);
  padding: 7px 14px;
  border-radius: var(--radius);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.card-link:hover {
  background: var(--dark);
  color: var(--highlight);
  border-color: var(--dark);
}
.card-link .arrow {
  font-size: 0.75rem;
  transition: transform var(--ease);
}
.card-link:hover .arrow { transform: translate(2px, -2px); }

/* card image */
.card-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 16 / 10;
  background: var(--surface);
  cursor: zoom-in;
  border: var(--border);
}
.card-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card-image-wrap:hover img { transform: scale(1.04); }

/* pixel-corner accent */
.card-image-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 18px; height: 18px;
  border-top: 2px solid var(--highlight);
  border-left: 2px solid var(--highlight);
  z-index: 1;
  opacity: 0;
  transition: opacity var(--ease);
}
.card-image-wrap:hover::before { opacity: 1; }

.card-image-wrap::after {
  content: 'view ↗';
  position: absolute;
  bottom: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--base);
  background: var(--dark);
  padding: 4px 8px;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--ease), transform var(--ease);
  z-index: 1;
}
.card-image-wrap:hover::after { opacity: 1; transform: none; }

.card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  opacity: 0.25;
  letter-spacing: 0.1em;
}

/* ── Lightbox ───────────────────────────────────────── */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(35,32,32,0.96);
  z-index: 900;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
#lightbox.open { opacity: 1; pointer-events: auto; }
#lightbox img {
  max-width: 88vw; max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius);
  transform: scale(0.96);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255,255,255,0.08);
}
#lightbox.open img { transform: scale(1); }
#lightbox-close {
  position: absolute; top: 20px; right: 28px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(242,245,222,0.45);
  cursor: pointer;
  transition: color var(--ease);
  text-transform: uppercase;
  user-select: none;
}
#lightbox-close:hover { color: var(--highlight); }

/* ── Footer ─────────────────────────────────────────── */
footer {
  border-top: var(--border);
  background: var(--dark);
  color: var(--base);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px var(--gap);
  display: flex; align-items: center; justify-content: space-between;
}
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  opacity: 0.3;
  letter-spacing: 0.04em;
}
.footer-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--highlight);
  opacity: 0.5;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --gap: 24px; }
  .hero { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: row; align-items: flex-start; }
  .project-card { grid-template-columns: 1fr; gap: 24px; }
  .card-image-wrap { order: -1; }
}

@media (max-width: 520px) {
  .hero h1 { font-size: 1.9rem; }
  nav a { display: inline; }
  nav a:last-child { display: inline-flex; }
}

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.hero-tag     { animation: fadeUp 0.4s ease 0.05s both; }
.hero h1      { animation: fadeUp 0.4s ease 0.12s both; }
.hero-sub     { animation: fadeUp 0.4s ease 0.18s both; }
.hero-stats   { animation: fadeUp 0.4s ease 0.24s both; }
.section-row  { animation: fadeUp 0.4s ease 0.3s  both; }
