/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --color-bg:         #ffffff;
  --color-surface:    #f5f5f5;
  --color-border:     #e0e0e0;
  --color-text:       #0c0c0c;
  --color-text-muted: #6b6b6b;
  --color-text-faint: #aaaaaa;
  --color-green:      #16a34a;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --max-wide:    1120px;
  --max-content: 680px;
  --nav-height:  56px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background-color: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.nav__inner {
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text);
  transition: color var(--duration-fast);
}
.nav__logo:hover { color: var(--color-text-muted); }

.nav__links { display: flex; gap: 2rem; }

.nav__link {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
}
.nav__link:hover,
.nav__link--active { color: var(--color-text); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ============================================================
   INDEX — HERO HEADER
   ============================================================ */
.page-header {
  padding: 10rem 0 6rem;
}

.page-header__title {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

.page-header__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ============================================================
   INDEX — PROJECT LIST
   ============================================================ */
.project-list {
  padding-bottom: 10rem;
}

.project-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 4rem 0;
  cursor: pointer;
}

.project-entry--reverse {
  direction: rtl;
}
.project-entry--reverse > * {
  direction: ltr;
}

.project-entry__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.project-entry__meta {
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-text-faint);
  text-transform: uppercase;
}

.project-entry__arrow {
  font-size: 1.25rem;
  color: var(--color-text-faint);
  transition: transform var(--duration-base) var(--ease-out),
              color var(--duration-base);
}
.project-entry:hover .project-entry__arrow {
  transform: translate(3px, -3px);
  color: var(--color-text);
}

.project-entry__text {
  display: flex;
  flex-direction: column;
}

.project-entry__title {
  margin-bottom: 0.4rem;
}

.project-entry__desc {
  margin-bottom: 1.75rem;
}

.project-entry__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--color-text);
  transition: color var(--duration-fast);
}

.project-entry__desc {
  font-size: 1.0625rem;
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.read-more-btn {
  display: inline-block;
  align-self: flex-start;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.65rem 1.75rem;
  border-radius: 999px;
  transition: background var(--duration-fast);
}

.project-entry__image {
  width: 100%;
  border-radius: 6px;
  display: block;
}

.project-entry__image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 6px;
  background: var(--color-surface);
}

/* ============================================================
   TAGS
   ============================================================ */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  padding: 2px 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-muted);
}

.tag--accent { border-color: var(--color-text-faint); }

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-green);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: 999px;
  padding: 2px 0.65rem;
}
.availability-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-green);
  flex-shrink: 0;
}

/* ============================================================
   PROJECT PAGE — HERO
   ============================================================ */
.project-hero {
  width: 100%;
  max-width: var(--max-wide);
  margin: 2.5rem auto 5rem;
  padding: 0 2.5rem;
}

.project-hero__image {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.project-hero__placeholder {
  width: 100%;
  aspect-ratio: 21 / 9;
  border-radius: 8px;
  background: var(--color-surface);
}

/* ============================================================
   PROJECT PAGE — HEADER
   ============================================================ */
.project-header {
  max-width: var(--max-wide);
  margin: 0 auto 4rem;
  padding-top: 4rem;
}

.project-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 0 2rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  max-width: var(--max-content);
  margin-left: auto;
  margin-right: auto;
}

.project-meta-col {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
}

.project-meta-label {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.project-meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-meta-list li {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.6;
  padding: 0.3rem 0;
}

.project-hero-inline {
  max-width: var(--max-content);
  margin: 0 auto 5rem;
}

.project-hero-inline__image {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.project-meta__sep { color: var(--color-border); }
.project-meta__role { color: var(--color-text-muted); }

.project-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 1.25rem;
}

.project-lead {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.tech-stack__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-right: 0.25rem;
}

/* ============================================================
   PROSE — RENDERED MARKDOWN
   ============================================================ */
.prose {
  max-width: var(--max-content);
  margin: 0 auto;
  padding-bottom: 10rem;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: var(--color-text);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.prose h1 { font-size: 2rem; margin-top: 4rem; margin-bottom: 1.25rem; }
.prose h2 {
  font-size: 1.5rem;
  margin-top: 4rem;
  margin-bottom: 1rem;
}
.prose h3 { font-size: 1.125rem; margin-top: 3rem; margin-bottom: 0.75rem; }
.prose h4 { font-size: 1rem; margin-top: 2rem; margin-bottom: 0.5rem; color: var(--color-text-muted); }

.prose p {
  margin-bottom: 1.25rem;
  color: var(--color-text-muted);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.8;
}

.prose a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--duration-fast);
}
.prose a:hover { text-decoration-color: var(--color-text); }

.prose strong { font-weight: 500; color: var(--color-text); }
.prose em { font-style: italic; }

.prose ul, .prose ol { margin-bottom: 1.25rem; padding-left: 1.25rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4rem; color: var(--color-text-muted); font-weight: 300; line-height: 1.7; }

.prose blockquote {
  border-left: 2px solid var(--color-text);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
}
.prose blockquote p {
  font-size: 1.125rem;
  font-style: italic;
  color: var(--color-text);
  margin-bottom: 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  color: var(--color-text);
}

.prose pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 2rem;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.7;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.875rem;
}
.prose th {
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
}
.prose td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  color: var(--color-text-muted);
  font-weight: 300;
}
.prose tr:last-child td { border-bottom: none; }

.prose hr { display: none; }

.prose img {
  width: 100%;
  border-radius: 6px;
  margin: 2rem 0;
}

.prose figcaption {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
  margin-top: -1rem;
  margin-bottom: 2rem;
}

.image-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.image-row__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.image-row__item img {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 6px;
}

.figure-bleed {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.figure-bleed img {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 6px;
}

.figure-bleed figcaption {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
  max-width: var(--max-content);
  margin-left: auto;
  margin-right: auto;
}

.image-row__item figcaption {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-header {
  padding: 10rem 0 5rem;
  max-width: var(--max-content);
  margin: 0 auto;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4rem;
}

.about-name {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.about-headline {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.about-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.about-location {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--color-text-faint);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
}

.footer__inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer__copy { font-size: 0.75rem; color: var(--color-text-faint); font-weight: 300; }
.footer__links { display: flex; gap: 1.5rem; }
.footer__link {
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--color-text-faint);
  transition: color var(--duration-fast);
}
.footer__link:hover { color: var(--color-text); }

/* ============================================================
   BACK LINK
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--color-text-muted);
  padding: 2.5rem 0 0;
  transition: color var(--duration-fast);
}
.back-link:hover { color: var(--color-text); }
.back-link svg { transition: transform var(--duration-fast) var(--ease-out); }
.back-link:hover svg { transform: translateX(-3px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
  .nav__inner { padding: 0 1.25rem; }
  .project-hero { padding: 0 1.25rem; }
  .footer__inner { padding: 0 1.25rem; flex-direction: column; align-items: flex-start; }
  .page-header { padding: 5rem 0 3rem; }
  .project-entry { grid-template-columns: 1fr; gap: 1.5rem; padding: 2.5rem 0; direction: ltr; }
  .about-header { padding: 5rem 0 3rem; }
}
