/* Minimal, elegant base styles */
:root {
  --bg: #0b0b0c;
  --fg: #e7e7e7;
  --muted: #9aa0a6;
  --accent: #d6ff6b;
  --maxw: 840px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

nav .brand {
  font-weight: 700;
  letter-spacing: .02em;
}

nav .links a {
  color: var(--fg);
  opacity: .9;
  margin-left: 1rem;
}

nav .links a.active {
  color: var(--accent);
}

header.hero {
  margin: 4rem 0 2rem;
}

.hero h1 {
  color: #d6ff6b;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 .5rem;
}

.hero p {
  color: #D8BFD8;
  font-weight: 700;
  max-width: 60ch;
  margin: .5rem 0 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.card {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .02));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.card h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.card p {
  color: var(--muted);
}

footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px dashed rgba(255, 255, 255, .15);
  color: var(--muted);
  font-size: .95rem;
}

.small {
  font-size: .9rem;
  color: var(--muted);
}

/* Buttons */
.btn-open {
  display: inline-block;
  margin-top: .5rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  padding: .5rem .75rem;
  border-radius: 10px;
  color: var(--fg);
  cursor: pointer;
}

.btn-open:hover {
  background: rgba(255, 255, 255, .12);
}

/* Modal (overlay) */
.modal[aria-hidden="true"] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  width: min(860px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.modal-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  font-size: 1.5rem;
  line-height: 1;
  border: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.modal-media img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.modal-title {
  font-weight: 700;
  margin: .75rem 0 0;
}

.modal-desc {
  color: var(--muted);
  margin: .5rem 0 1rem;
}

.modal-link {
  display: inline-block;
  margin-top: .5rem;
  color: var(--accent);
  font-weight: 600;
}

/* Responsive media */
.card img,
.modal-media img,
article img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  object-fit: cover;
}

/* Optional aspect ratio placeholders to avoid layout jank */
.lamela-card img {
  aspect-ratio: 4 / 3;
}

.modal-media img {
  aspect-ratio: 4 / 3;
}

/* Subtle focus ring for keyboard users */
:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

/* Lamela detail gallery */
.lamela-gallery {
  display: grid;
  grid-template-columns: 1fr;
  /* 1 column by default (mobile) */
  gap: 1rem;
  margin-top: 1.5rem;
}

.lamela-gallery img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

/* On larger screens, switch to 2 columns */
@media (min-width: 700px) {
  .lamela-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Thumbnails grid inside modal */
.lamela-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: .5rem;
  margin: .75rem 0 1rem;
}

.lamela-thumbs button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  outline-offset: 2px;
}

.lamela-thumbs img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(255, 255, 255, .18);
}

.lamela-thumbs button[aria-current="true"] img {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.modal-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: normal;
  /* titles are italic via <em>, not everything */
  white-space: normal;
  /* make sure <br> works cleanly */
}

.modal-desc em {
  font-style: italic;
  font-weight: 600;
  /* italic + a bit bolder */
}

.lamela-video {
  margin-top: 2rem;
}

.lamela-video video {
  width: 100%;
  max-width: 800px;
  /* keeps it from being too huge on big screens */
  display: block;
  margin: 0 auto;
  /* centers it */
  border-radius: 12px;
}

/* Three images in one row */
.lamela-gallery-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.lamela-gallery-3 img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

/* Video below the images */
.lamela-video {
  margin-top: 2rem;
}

.lamela-video video {
  width: 100%;
  max-width: 1000px;
  /* keep it elegant on wide screens */
  display: block;
  margin: 0 auto;
  border-radius: 12px;
}

.series-block {
  margin-top: 3rem;
}

.series-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #3CB371;
  margin: 0 0 1rem;
  letter-spacing: .02em;
}

.series-heading em {
  font-style: italic;
}

/* Optional: a subtle divider under the heading */
.series-heading::after {
  content: "";
  display: block;
  height: 1px;
  background: rgba(255, 255, 255, .15);
  margin-top: .6rem;
}

/* --- New page styles --- */
.page-hero {
  margin: 2rem 0 1rem;
}

.page-hero h1 {
  font-size: 2rem;
  margin: 0 0 .25rem;
}

.page-hero .muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: rgba(255, 255, 255, .02);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  overflow: hidden;
}

.card img {
  display: block;
  width: 100%;
  height: auto;
}

.card h3 {
  margin: .6rem .8rem .2rem;
  font-size: 1rem;
}

.card p {
  margin: 0 .8rem .8rem;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 1rem;
}

.film-card {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  overflow: hidden;
}

.film-card .embed {
  aspect-ratio: 16/9;
  background: #111;
}

.film-meta {
  padding: .8rem 1rem;
}

.text-list .text-item {
  padding: .8rem 1rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
}

.text-list .text-item+.text-item {
  margin-top: .5rem;
}

#img-modal img {
  max-width: 90vw;
  /* never larger than 90% of viewport width */
  max-height: 85vh;
  /* never taller than 85% of viewport height */
  height: auto;
  width: auto;
  margin: 0 auto;
  display: block;
  border-radius: 12px;
}

#img-modal img {
  max-width: 90vw;
  max-height: 85vh;
  margin: 0 auto;
  display: block;
  border-radius: 12px;
}

#img-modal .modal-prev,
#img-modal .modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: .5rem 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 8px;
}

#img-modal .modal-prev {
  left: 0.5rem;
}

#img-modal .modal-next {
  right: 0.5rem;
}

.works {
  padding: 4rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  border-top: 1px solid rgba(0, 0, 0, .1);
}

.works h2 {
  font-weight: 800;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  letter-spacing: .03em;
}

/* Controls */
.works-controls {
  display: grid;
  gap: .75rem 1rem;
  margin: .75rem 0 1.5rem;
}

.control-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.control-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .85rem;
  opacity: .8;
}

/* Text-link filters */
.filter-line {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
}

.filter-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  opacity: .75;
}

.filter-link:hover {
  text-decoration: underline;
  opacity: 1;
}

.filter-link.is-active,
.filter-link[aria-pressed="true"] {
  font-weight: 800;
  color: var(--accent, #0a66ff);
  opacity: 1;
}

/* Shared column width for labels */
.works {
  --label-col: 9rem;
}

/* tweak 8–10rem to taste */

/* Controls in two columns: [label | options] */
.works-controls {
  display: grid;
  gap: .6rem 1rem;
  margin: .75rem 0 1.5rem;
}

.control-row {
  display: grid;
  grid-template-columns: var(--label-col) 1fr;
  align-items: baseline;
  /* aligns text baselines */
  column-gap: 1rem;
}

.control-label {
  grid-column: 1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .85rem;
  opacity: .8;
}

.filter-line,
#sortBy,
#worksCount {
  grid-column: 2;
}

/* Align the list with the options column */
.work-list {
  margin-left: var(--label-col);
}

/* Optional: tighten spacing of the count + sort row */
#worksCount {
  margin-left: .75rem;
}

/* Mobile: stack label above options and remove left offset */
@media (max-width: 640px) {
  .control-row {
    grid-template-columns: 1fr;
  }

  .work-list {
    margin-left: 0;
  }

  .control-label {
    margin-bottom: .25rem;
  }
}

/* overall tighter + "tab" look */
.works {
  --label-col: 8rem;
  /* keep left column alignment */
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* filters compacted */
.filter-line {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  /* tighter horizontal gap */
}

.filter-link {
  font-size: 0.85rem;
  /* smaller text */
  opacity: 0.65;
  transition: color .15s ease, opacity .15s ease;
}

.filter-link:hover {
  opacity: 1;
}

.filter-link.is-active,
.filter-link[aria-pressed="true"] {
  font-weight: 700;
  color: var(--accent, #d8ff6f);
  /* keep your lime accent */
  opacity: 1;
}

/* labels smaller, closer to options */
.control-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  opacity: 0.6;
  text-transform: uppercase;
  margin-top: 0.1rem;
}

/* reduce vertical spacing between rows */
.works-controls {
  gap: .3rem 1rem;
  margin: .5rem 0 1rem;
}

/* list appears slightly indented like a tab */
.work-list {
  margin-left: calc(var(--label-col) - 1.5rem);
  padding-left: 1.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.work h3 {
  font-size: 1.15rem;
  margin: 0 0 .25rem;
}

.work-meta {
  font-size: 0.9rem;
  opacity: 0.7;
}

.work h3,
.work-link {
  color: var(--text, #eaeaea);
  transition: color .25s ease;
}

.work-link:hover,
.work-link:focus {
  color: var(--accent, #d8ff6f);
}

/* Floating sticky header */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.4);
  /* translucent black glass */
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Branding link */
nav .brand {
  font-weight: 800;
  text-decoration: none;
  color: inherit;
  letter-spacing: .05em;
  transition: color .25s ease;
}

nav .brand:hover {
  color: var(--accent, #d8ff6f);
}

/* Navigation links */
nav .links {
  display: flex;
  gap: 1rem;
}

nav .links a {
  text-decoration: none;
  color: inherit;
  opacity: .75;
  transition: opacity .25s ease, color .25s ease;
}

nav .links a:hover {
  opacity: 1;
  color: var(--accent, #d8ff6f);
}