/* =========================================================
   Chariedale Joy Valdez — graphi-design.html styles
   ========================================================= */

:root {
  --purple: #6d0eb2;
  --purple-2: #9c27b0;
  --grad: linear-gradient(135deg, var(--purple) 0%, var(--purple-2) 100%);
  --accent: #c490ff;

  --bg: #0c0a18;
  --bg-2: #110d22;
  --surface: #171130;
  --surface-2: #1f1740;
  --line: #2a2247;
  --line-2: #3d3266;
  --text: #efeaf8;
  --muted: #a79fbd;

  --font: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1200px;
  --gutter: clamp(20px, 5vw, 32px);
  --section-y: clamp(56px, 8vw, 96px);
  --header-h: 72px;
  --radius: 14px;

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font-family: var(--font); line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--band { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head h2 { font-size: clamp(1.875rem, 4vw, 2.5rem); font-weight: 700; }
.section-head p { margin-top: 8px; color: var(--muted); max-width: 52ch; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 10px 22px; border-radius: 10px; border: 1px solid transparent; font: 600 .9375rem/1 var(--font); text-decoration: none; cursor: pointer; transition: filter .2s ease; }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 12px 30px -14px rgba(156, 39, 176, .8); }
.btn--primary:hover { filter: brightness(1.12); }
.btn--block { width: 100%; }

.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; transition: border-color .2s ease, color .2s ease; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; height: var(--header-h); background: rgba(12, 10, 24, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand__mark { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.brand__mark svg { width: 20px; height: 20px; }
.brand h1 { font-size: 1.0625rem; font-weight: 700; white-space: nowrap; }
.brand__role { font-size: .75rem; color: var(--muted); white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a { position: relative; text-decoration: none; font-size: .9375rem; color: var(--muted); padding: 10px 14px; }
.nav a:hover { color: var(--text); }
.nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--grad); transform: scaleX(0); transition: transform .2s ease; }
.nav a:hover::after { transform: scaleX(1); }

.nav a { white-space: nowrap; }

@media (max-width: 640px) {
  .brand__role { display: none; }
  .brand h1 { font-size: .9375rem; }
  .nav a { padding: 10px 8px; font-size: .875rem; }
  .nav a::after { display: none; }
}
@media (max-width: 480px) {
  .nav a[href="index.html"] { display: none; }   /* the name already links home */
  .brand__mark { display: none; }
  .brand h1 { font-size: .875rem; }
  .nav a { padding: 10px 0 10px 8px; font-size: .8125rem; }
}

/* ---------- Hero ---------- */
.gd-hero { position: relative; overflow: hidden; padding-block: clamp(56px, 9vw, 110px) clamp(48px, 7vw, 80px); }
.gd-hero::before { content: ""; position: absolute; width: 520px; aspect-ratio: 1; right: -120px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(156, 39, 176, .45), transparent 65%); pointer-events: none; }
.gd-hero .container { position: relative; }
.gd-hero h2 { font-size: clamp(2.75rem, 8vw, 5.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.gd-hero h2 span { background: linear-gradient(120deg, #d7a8ff 0%, #b066f0 50%, #e27cff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gd-hero p { margin-top: 20px; max-width: 50ch; font-size: 1.0625rem; color: var(--muted); }

.jump { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jump a { display: inline-block; text-decoration: none; font-size: .875rem; font-weight: 500; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .2s ease, color .2s ease; }
.jump a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Tools ---------- */
.section--tight { padding-block: clamp(40px, 6vw, 64px); }
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tool { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s ease, transform .2s ease; }
.tool:hover { border-color: var(--line-2); transform: translateY(-2px); }
.tool__mono { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; color: #fff; background: var(--grad); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.tool h3 { font-size: 1rem; font-weight: 600; }

/* Logo files go in assets/tools/. Logos show by default (no JS needed).
   If a file fails to load, JS adds .no-logo and the lettered tile shows instead. */
.tool__mono { background: transparent; box-shadow: none; }
.tool__mono img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tool__mono span { display: none; }
.tool__mono.no-logo { background: var(--grad); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.tool__mono.no-logo img { display: none; }
.tool__mono.no-logo span { display: inline; }

@media (max-width: 900px) { .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tools { gap: 10px; } .tool { padding: 14px 12px; gap: 10px; } .tool__mono { width: 40px; height: 40px; font-size: .9375rem; border-radius: 10px; } .tool h3 { font-size: .875rem; } }

/* ---------- Featured Work: showcase ---------- */
.showcase {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr);
  gap: 14px;
  height: clamp(560px, 58vw, 680px);
  padding: 14px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
  background: var(--surface);
}
/* Blurred copy of the current piece fills the frame, like the reference */
.showcase__bg {
  position: absolute;
  inset: -10%;
  z-index: -2;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: blur(48px) saturate(1.3) brightness(.45);
  transition: opacity .5s ease;
}
.showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(109, 14, 178, .35), rgba(12, 10, 24, .55));
}

/* Glass cards */
.s-card {
  position: relative;
  border-radius: 24px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: clamp(18px, 2.2vw, 26px);
  color: var(--text);
}
.s-label { display: block; font-size: .75rem; font-weight: 600; color: rgba(239, 234, 248, .6); }
.s-pill { font-size: .75rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--grad); color: #fff; }
.s-count { font-size: .875rem; color: rgba(239, 234, 248, .6); font-variant-numeric: tabular-nums; }
.s-count b { color: #fff; font-weight: 700; }

.showcase__info { display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 14px; min-height: 0; }

.s-card--title { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); }
.s-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.s-card--title h3 { font-size: clamp(1.5rem, 2.6vw, 2.25rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }

.s-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 14px; }
.s-card--type { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.s-type { font-size: clamp(1.125rem, 1.8vw, 1.375rem); font-weight: 700; color: var(--accent); }

.s-card--next {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.s-card--next:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); }
.s-card--next img { flex: none; width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.s-next__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.s-next__title { font-size: .875rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.s-card--desc { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.s-card--desc p { font-size: .9375rem; line-height: 1.7; color: rgba(239, 234, 248, .85); overflow-y: auto; min-height: 0; padding-right: 4px; scrollbar-width: thin; }

/* Round buttons */
.s-round {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 0;
  background: #fff;
  color: #150f26;
  cursor: pointer;
}
.s-round svg { width: 18px; height: 18px; }
.s-round--glass { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background-color .2s ease; }
.s-round--glass:hover { background: rgba(255, 255, 255, .26); }
.s-round--big { width: 56px; height: 56px; background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .5); transition: background-color .2s ease; }
.s-round--big:hover { background: rgba(255, 255, 255, .12); }
.s-round--big svg { width: 22px; height: 22px; }

/* Stage (right) */
.showcase__stage {
  position: relative;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(12, 10, 24, .35);
  border: 1px solid rgba(255, 255, 255, .1);
  display: grid;
  place-items: center;
  padding: 28px 104px 88px 28px;
}
.showcase__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7);
  transition: opacity .3s ease, transform .3s ease;
}
.showcase.is-changing .showcase__img,
.showcase.is-changing [data-f] { opacity: 0; }
.showcase.is-changing .showcase__img { transform: scale(.97); }
.showcase [data-f] { transition: opacity .25s ease; }

.showcase__thumbs {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.showcase__thumbs::-webkit-scrollbar { display: none; }
.showcase__thumb {
  display: block;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  opacity: .6;
  transition: opacity .2s ease, border-color .2s ease;
}
.showcase__thumb img { width: 100%; height: 100%; object-fit: cover; }
.showcase__thumb:hover { opacity: 1; }
.showcase__thumb[aria-pressed="true"] { opacity: 1; border-color: #fff; }

.showcase__arrows { position: absolute; left: 0; right: 90px; bottom: 22px; display: flex; justify-content: center; gap: 10px; }
.showcase__expand { position: absolute; right: 100px; bottom: 16px; }

/* ---------- Showcase: tablet & phone ---------- */
@media (max-width: 900px) {
  .showcase { grid-template-columns: 1fr; height: auto; padding: 10px; gap: 10px; border-radius: 26px; }
  .showcase__stage { order: -1; aspect-ratio: 4 / 5; max-height: 72vh; padding: 20px 20px 92px; }
  .showcase__thumbs {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    padding: 6px;
  }
  .showcase__thumb { flex: none; width: 48px; height: 48px; }
  .showcase__arrows { top: 12px; bottom: auto; left: auto; right: 12px; gap: 8px; }
  .showcase__expand { top: 12px; right: auto; left: 12px; bottom: auto; width: 44px; height: 44px; }
  .showcase__info { grid-template-rows: none; }
  .s-card { border-radius: 20px; }
  .s-card--desc p { overflow: visible; }
}
@media (max-width: 480px) {
  .s-row { grid-template-columns: 1fr; }
  .s-card--type { flex-direction: row; align-items: center; }
}

/* ---------- Gallery: filters + masonry ---------- */
.filters { position: sticky; top: var(--header-h); z-index: 50; margin-inline: calc(var(--gutter) * -1); padding: 12px var(--gutter); background: rgba(17, 13, 34, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.filters ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.filters ul::-webkit-scrollbar { display: none; }
.filters button { white-space: nowrap; font: 500 .875rem/1 var(--font); color: var(--muted); padding: 10px 16px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: border-color .2s ease, color .2s ease; }
.filters button:hover { color: var(--text); border-color: var(--accent); }
.filters button[aria-pressed="true"] { color: #fff; background: var(--grad); border-color: transparent; }
.filters .count { font-size: .75rem; opacity: .7; }

.masonry { margin-top: 20px; columns: 4 240px; column-gap: 16px; }
.masonry__item { break-inside: avoid; margin: 0 0 16px; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; position: relative; }
.masonry__item img { width: 100%; height: auto; transition: transform .35s ease; }
.masonry__item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(12, 10, 24, .7)); opacity: 0; transition: opacity .25s ease; }
.masonry__item .tag { position: absolute; left: 10px; bottom: 10px; z-index: 1; font-size: .75rem; font-weight: 600; color: #fff; padding: 4px 10px; border-radius: 999px; background: rgba(109, 14, 178, .85); opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; }
.masonry__item:hover img { transform: scale(1.03); }
.masonry__item:hover::after, .masonry__item:focus-visible::after { opacity: 1; }
.masonry__item:hover .tag, .masonry__item:focus-visible .tag { opacity: 1; transform: none; }
.masonry__item[hidden] { display: none; }

@media (max-width: 520px) { .masonry { columns: 2; column-gap: 10px; } .masonry__item { margin-bottom: 10px; border-radius: 10px; } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 64px 72px; background: rgba(8, 5, 18, .97); }
.lightbox.is-open { display: flex; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; border-radius: 8px; }
.lightbox figcaption { font-size: .875rem; color: var(--muted); }
.lightbox__close { position: absolute; top: 16px; right: 16px; }
.lightbox__prev, .lightbox__next { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
.lightbox .icon-btn { background: rgba(23, 17, 48, .9); }

@media (max-width: 640px) {
  .lightbox { padding: 64px 12px 88px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 20px; transform: none; }
  .lightbox__prev { left: calc(50% - 56px); }
  .lightbox__next { right: calc(50% - 56px); }
}

/* ---------- Videos ---------- */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.player__screen { aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.player__screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.playlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.playlist h5 { font-size: .875rem; font-weight: 600; color: var(--muted); padding: 4px 6px 10px; }
.playlist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.playlist button { width: 100%; min-height: 48px; text-align: left; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; font: 600 .9375rem/1.2 var(--font); color: var(--text); cursor: pointer; display: flex; gap: 12px; align-items: center; }
.playlist button:hover { background: var(--surface-2); }
.playlist button[aria-pressed="true"] { background: var(--surface-2); border-color: var(--line-2); }
.play-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--accent); }
.playlist button[aria-pressed="true"] .play-icon { background: var(--grad); border-color: transparent; color: #fff; }
.play-icon svg { width: 12px; height: 12px; margin-left: 2px; }

@media (max-width: 860px) {
  .player { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .playlist { padding: 0; background: none; border: 0; }
  .playlist h5 { display: none; }
  .playlist ul { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 6px; }
  .playlist button { background: var(--surface); border-color: var(--line); padding-right: 18px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: clamp(56px, 8vw, 80px) 28px; }
.contact-card { max-width: 400px; margin-inline: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; }
.contact-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad); }
.contact-card h4 { font-size: 1.125rem; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.contact-card p { font-size: .9375rem; color: var(--muted); }
.contact-card p + p { margin-top: 8px; }
.contact-card p span { color: var(--text); font-weight: 600; }
.contact-card .btn { margin-top: 20px; }
.credits { margin-top: 10px; text-align: center; font-size: .75rem; color: var(--muted); opacity: .8; }
.credits a { color: var(--muted); }
.credits a:hover { color: var(--accent); }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; font-size: .8125rem; color: var(--muted); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}