/* ---------- Design tokens ---------- */
:root {
  --bg: #0a0f14;
  --bg-elev: #0f1720;
  --surface: #131c26;
  --surface-2: #1a2532;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --ink: #f4ede0;
  --ink-2: #d9d1c2;
  --muted: #8b95a1;
  --accent: #e0b962;
  --accent-2: #c39b4e;
  --success: #4ade80;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.25);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, 0.5);
  --maxw: 1120px;
  --transition: 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf6ec;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4eddb;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --ink: #1a1f26;
    --ink-2: #3a4149;
    --muted: #6b7280;
    --accent: #b8862d;
    --accent-2: #a17020;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }
img, svg { max-width: 100%; display: block; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 20px 0;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ink);
  font-size: 15px;
}

.brand-star {
  width: 22px; height: 22px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
}

.nav-links a {
  color: var(--ink-2);
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  padding: 100px 0 60px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.05;
  font-weight: 800;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--ink) 30%, color-mix(in srgb, var(--ink) 55%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink-2);
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface); }

/* ---------- Section ---------- */
.section {
  padding: 60px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
}
.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-sub {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Featured card ---------- */
.featured {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 44px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  transition: transform var(--transition), border-color var(--transition);
}
.featured::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, var(--_tint, transparent) 0%, transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}
.featured:hover { border-color: var(--border-strong); }

.featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--_accent, var(--accent)) 15%, transparent);
  color: var(--_accent, var(--accent));
  border: 1px solid color-mix(in srgb, var(--_accent, var(--accent)) 30%, transparent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.featured h2 {
  font-size: clamp(30px, 4vw, 44px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-weight: 800;
}

.featured .subtitle {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 20px;
}

.featured p.desc {
  color: var(--ink-2);
  font-size: 16px;
  margin: 0 0 28px;
  max-width: 46ch;
}

.featured-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.featured-icon {
  position: relative;
  aspect-ratio: 1;
  max-width: 340px;
  justify-self: end;
  border-radius: 40px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition);
}
.featured:hover .featured-icon { transform: translateY(-4px) rotate(-2deg); }

/* ---------- Project grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 0%, var(--_tint, transparent) 0%, transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.card-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.card-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.card-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}
.card-desc {
  color: var(--ink-2);
  font-size: 14px;
  margin: 0;
  flex: 1;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.card-foot .arrow {
  transition: transform var(--transition);
}
.card:hover .arrow { transform: translateX(4px); color: var(--accent); }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent);
  margin-right: 6px;
  vertical-align: middle;
}

/* ---------- About ---------- */
.about {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
  margin-top: 40px;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: start;
}
.about h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.about p {
  color: var(--ink-2);
  font-size: 17px;
  margin: 0 0 16px;
}

/* ---------- Footer ---------- */
.foot {
  padding: 40px 0 60px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--accent); }

/* ---------- Project detail page ---------- */
.project-hero {
  padding: 60px 0 40px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
}
.project-hero-icon {
  width: 200px;
  height: 200px;
  border-radius: 44px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.project-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  margin: 8px 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.project-hero .subtitle {
  color: var(--muted);
  font-size: 18px;
  margin: 0 0 20px;
}
.project-hero .actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.project-section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.project-section h2 {
  font-size: 22px;
  margin: 0 0 20px;
  font-weight: 700;
}
.project-section p {
  color: var(--ink-2);
  font-size: 17px;
  max-width: 70ch;
  margin: 0 0 16px;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.feature-list li {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.feature-list li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.screenshots img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  background: var(--surface);
}
.screenshots-empty {
  padding: 40px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}
.back-link:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .featured {
    grid-template-columns: 1fr;
    padding: 32px;
    text-align: left;
  }
  .featured-icon {
    justify-self: start;
    max-width: 200px;
  }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .project-hero { grid-template-columns: 1fr; gap: 24px; }
  .project-hero-icon { width: 140px; height: 140px; border-radius: 32px; }
  .feature-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 40px; }
  .section { padding: 40px 0; }
  .nav-links { display: none; }
}
