:root {
  --bg: #0f1115;
  --bg-elev: #161922;
  --bg-elev-2: #1d2230;
  --fg: #e8eaf0;
  --fg-dim: #a4a9b8;
  --fg-mute: #6b7184;
  --accent: #e0b85f;
  --border: #262b38;
  --radius: 14px;
  --max: 1180px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.2vw, 2rem); }
h3 { font-size: 1rem; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.08em; }

p { margin: 0 0 1em; color: var(--fg-dim); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 48px);
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 8px;
}
.brand-name { font-weight: 600; }

.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--fg-dim);
  font-size: 0.92rem;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--fg); }

/* ---------- Hero ---------- */

.hero { padding: clamp(48px, 8vw, 96px) clamp(20px, 4vw, 48px) clamp(24px, 4vw, 40px); }

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 16px;
}

.lede { font-size: 1.1rem; max-width: 52ch; }

.hero-cta { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}
.btn.primary { background: var(--accent); color: #1a1a1a; }
.btn.primary:hover { transform: translateY(-1px); }
.btn.ghost { border-color: var(--border); color: var(--fg); }
.btn.ghost:hover { border-color: var(--fg-mute); }

.hero-portrait {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Carousel ---------- */

.carousel-section { padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 48px); }

.carousel {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
}

.carousel-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  scroll-snap-type: x mandatory;
}

.slide {
  flex: 0 0 100%;
  min-height: 320px;
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  scroll-snap-align: start;
  background:
    radial-gradient(800px 300px at 85% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev));
  border-left: 4px solid var(--accent);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.slide.has-image {
  background:
    linear-gradient(90deg, rgba(15, 17, 21, 0.92) 0%, rgba(15, 17, 21, 0.6) 50%, rgba(15, 17, 21, 0.1) 100%),
    var(--slide-bg) center / cover no-repeat,
    linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev));
}

.slide-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.slide h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 8px; }
.slide p { max-width: 60ch; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(15, 17, 21, 0.75);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.carousel-btn:hover { background: var(--bg-elev-2); }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg-elev-2);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.carousel-dots button.is-active { background: var(--accent); transform: scale(1.3); }

/* ---------- Tiles ---------- */

.tiles-section { padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 48px); }

.section-head {
  max-width: var(--max);
  margin: 0 auto 28px;
}

.tiles {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--max);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tiles li a {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 1 / 1;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.tiles li a:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--bg-elev-2);
}

.tiles li a.has-thumb {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(15, 17, 21, 0.55) 0%, rgba(15, 17, 21, 0.92) 80%),
    var(--thumb);
  background-size: cover;
  background-position: center;
}
.tiles li a.has-thumb .tile-sub { color: var(--fg); }

.tile-title { font-size: 1.3rem; font-weight: 600; color: var(--fg); }
.tile-sub { font-size: 0.88rem; color: var(--fg-dim); }

/* ---------- Content blocks ---------- */

.content {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.content .meta {
  color: var(--fg-mute);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.bullets { padding-left: 18px; color: var(--fg-dim); }
.bullets li { margin-bottom: 6px; }

.bullets-label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.inline-link {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.more-info { margin: 16px 0; }
.more-info summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.more-info summary::-webkit-details-marker { display: none; }
.more-info summary::after {
  content: "+";
  font-size: 1.1rem;
  line-height: 1;
  color: var(--fg-dim);
  transition: transform 0.2s ease;
}
.more-info[open] summary::after { content: "−"; }
.more-info summary:hover { border-color: var(--accent); }
.more-info[open] summary { background: var(--bg-elev-2); border-color: var(--accent); }
.more-body {
  margin-top: 14px;
  padding: 16px 20px;
  border-left: 2px solid var(--accent);
  background: var(--bg-elev);
  border-radius: var(--radius);
}
.more-body p:last-child { margin-bottom: 0; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 16px;
}

.content-with-art {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}

.art-stack { display: grid; gap: 12px; }
.art-stack img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.art-key { align-self: start; }
.art-key img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

/* ---------- Screenshot strip ---------- */

.strip {
  position: relative;
  margin-top: 28px;
}

.strip-track {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.strip-track::-webkit-scrollbar { display: none; }

.strip-track li {
  flex: 0 0 calc((100% - 14px) / 2);
  scroll-snap-align: start;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-elev);
}
.strip-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.strip-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: rgba(15, 17, 21, 0.85);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.15s ease;
  z-index: 1;
}
.strip:hover .strip-btn { opacity: 1; }
.strip-btn:hover { background: var(--bg-elev-2); }
.strip-btn.prev { left: 8px; }
.strip-btn.next { right: 8px; }

@media (max-width: 820px) {
  .strip-track li { flex: 0 0 88%; }
  .strip-btn { opacity: 1; }
}

@media (max-width: 820px) {
  .content-with-art { grid-template-columns: 1fr; }
}

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { margin-bottom: 6px; }
.contact-list a { color: var(--accent); }

/* ---------- Footer ---------- */

.site-footer {
  padding: 32px clamp(20px, 4vw, 48px);
  text-align: center;
  color: var(--fg-mute);
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-portrait { max-width: 280px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
}

@media (max-width: 480px) {
  .tiles { grid-template-columns: 1fr; }
  .tiles li a { aspect-ratio: auto; }
}
