/* kaesual.com — one stylesheet, no build step, no script. */

:root {
  color-scheme: dark;
  --ground: #0b0914;
  --surface: #13101f;
  --surface-raised: #1a1629;
  --border: rgba(214, 194, 255, 0.14);
  --text: #ece8f5;
  --text-strong: #ffffff;
  --text-muted: #b4adc6;
  --accent: #a78bfa;
  --accent-strong: #8b5cf6;
  --accent-ink: #130b26;
  --sidebar: 15rem;
  --radius: 0.875rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial,
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--text-strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.skip {
  position: absolute;
  left: -100rem;
  top: 0.5rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 0.5rem;
}

.skip:focus {
  left: 0.5rem;
}

/* ---------- Shell: sidebar beside the page ---------- */

.shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: var(--sidebar);
  height: 100vh;
  height: 100dvh;
  padding: 1.25rem 0.75rem;
  border-right: 1px solid var(--border);
  background: #0d0a18;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0 0.5rem;
  color: var(--text-strong);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 800;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-label {
  margin: 0.75rem 0.75rem 0.25rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border-radius: 0.625rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  background: rgba(167, 139, 250, 0.1);
  color: var(--text-strong);
}

.nav a[aria-current="page"] {
  background: rgba(139, 92, 246, 0.22);
  color: var(--text-strong);
}

.nav img,
.nav svg {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
}

.sidebar-foot {
  margin-top: auto;
  padding: 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.sidebar-foot a {
  color: var(--text-muted);
}

.page {
  flex: 1 1 auto;
  min-width: 0;
}

.column {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

/* ---------- Home ---------- */

.intro {
  padding-block: clamp(3rem, 12vh, 7rem) clamp(2rem, 6vh, 3.5rem);
}

.intro h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.intro p {
  max-width: 36rem;
  margin: 1rem 0 0;
  color: var(--text);
  font-size: clamp(1.125rem, 2.4vw, 1.5rem);
}

.section-title {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.project:hover {
  border-color: var(--accent);
  color: inherit;
}

.project-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
}

.project-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--text-strong);
  font-size: 1.5rem;
  line-height: 1.2;
}

.project-name img {
  width: 2.25rem;
  height: 2.25rem;
}

.project-body p {
  margin: 0;
  color: var(--text);
}

.more {
  margin-top: 0.5rem;
  color: var(--accent);
  font-weight: 700;
}

.project:hover .more {
  color: var(--text-strong);
}

/* ---------- Project page ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(18rem, 52vh, 30rem);
  overflow: hidden;
}

.hero picture,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.hero-shade {
  background: linear-gradient(
    180deg,
    rgba(11, 9, 20, 0.15) 0%,
    rgba(11, 9, 20, 0.3) 50%,
    var(--ground) 100%
  );
}

.hero-inner {
  position: relative;
  padding-block: 2rem 1.5rem;
}

.hero h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.7);
}

.hero h1 img {
  width: clamp(3rem, 7vw, 4.5rem);
  height: clamp(3rem, 7vw, 4.5rem);
}

.lead {
  max-width: 40rem;
  margin: 0.5rem 0 0;
  font-size: 1.1875rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3.25rem;
  padding: 0 1.75rem;
  border-radius: 0.75rem;
  background: var(--accent-strong);
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.4);
}

.button:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.button svg {
  width: 1.125rem;
  height: 1.125rem;
}

.note {
  margin: 2rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
  color: var(--text-muted);
}

.note strong {
  color: var(--text);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Text pages (credits, not found) ---------- */

.prose {
  padding-block: clamp(2.5rem, 8vh, 5rem) 1rem;
}

.prose h1 {
  margin: 0 0 1rem;
  color: var(--text-strong);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}

.prose h2 {
  margin: 2.5rem 0 0.75rem;
  color: var(--text-strong);
  font-size: 1.375rem;
}

.prose p,
.prose li {
  max-width: 46rem;
  color: var(--text);
}

.prose li {
  margin-block: 0.5rem;
}

.prose code {
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.foot {
  padding-block: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.foot a {
  color: var(--text-muted);
}

/* ---------- Narrow windows: the sidebar becomes a bar ---------- */

@media (max-width: 52rem) {
  .shell {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    width: 100%;
    height: auto;
    padding: 0.5rem 0.75rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-label,
  .sidebar-foot {
    display: none;
  }

  .project {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
