/* =============================================================================
   BRIAN CHANDER PORTFOLIO - STYLES
   ----------------------------------------------------------------------------
   Designed white, refined, editorial. Generous whitespace, serif titles,
   clean sans body. Three breakpoints: mobile, tablet, desktop.
   ============================================================================= */

:root {
  --bg: #ffffff;
  --bg-soft: #fafaf8;
  --ink: #0a0a0a;
  --ink-soft: #1a1a1a;
  --muted: #6b6b66;
  --muted-light: #9b9b95;
  --rule: #e8e6e1;
  --rule-soft: #f1efea;

  --serif: "Unbounded", system-ui, sans-serif;
  --sans: "Unbounded", system-ui, sans-serif;
  --mono: "Unbounded", ui-monospace, monospace;

  --max: 1400px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }

/* =============================================================================
   NAV
   ============================================================================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav-brand .ampersand {
  font-weight: 300;
  color: var(--muted);
  margin: 0 0.15em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--muted);
  transition: color 0.2s var(--ease);
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a:hover { color: var(--ink); }

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

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--ink);
}

@media (max-width: 600px) {
  .nav-inner { padding: 1rem var(--gutter); }
  .nav-brand { font-size: 0.95rem; }
  .nav-links { gap: 1.25rem; font-size: 0.625rem; }
}

/* =============================================================================
   PAGE WRAPPER
   ============================================================================= */

main {
  flex: 1;
  width: 100%;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) 4rem;
}

.page-header {
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.page-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.page-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.page-title em {
  font-style: normal;
  font-weight: 200;
  color: var(--muted);
  letter-spacing: -0.02em;
}

.page-lede {
  font-size: clamp(0.95rem, 1.4vw, 1.0625rem);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.55;
  letter-spacing: 0;
  max-width: 44ch;
  margin-top: 1.5rem;
}

/* =============================================================================
   WORK GRID
   ============================================================================= */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}

@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .work-grid { grid-template-columns: 1fr; }
}

.grid-item {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-soft);
  color: #fff;
  isolation: isolate;
  border-radius: 2px;
}

.grid-item-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), filter 0.6s var(--ease);
}

.grid-item-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a2a28 0%, #1a1a18 100%);
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.grid-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(0, 0, 0, 0.15) 60%,
    rgba(0, 0, 0, 0.75) 100%
  );
  z-index: 1;
  transition: opacity 0.4s var(--ease);
}

.grid-item-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(1rem, 2vw, 1.5rem);
  z-index: 2;
  transform: translateY(0);
  transition: transform 0.5s var(--ease-out);
}

.grid-item-title {
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.3vw, 1.125rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.4rem;
  color: #fff;
}

.grid-item-role {
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.grid-item-year {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  z-index: 2;
  font-variant-numeric: tabular-nums;
}

.grid-item-laurel {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  width: clamp(64px, 7.5vw, 82px);
  height: auto;
  z-index: 2;
  opacity: 0.95;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.grid-item:hover .grid-item-image {
  transform: scale(1.04);
}

.grid-item:hover .grid-item-overlay {
  opacity: 0.85;
}

/* Staggered fade-in on load */
.grid-item {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.6s var(--ease-out) forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================================================
   ABOUT PAGE
   ============================================================================= */

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: 2rem;
}

@media (max-width: 800px) {
  .about-layout { grid-template-columns: 1fr; }
}

.about-portrait {
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  overflow: hidden;
  position: relative;
  border-radius: 2px;
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-portrait-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f4f2ed 0%, #e8e6e1 100%);
  color: var(--muted-light);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.about-body {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 56ch;
}

.about-body p { margin-bottom: 1.25em; }

.about-body p:first-of-type {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1.75rem;
}

.about-credits {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 2rem;
  font-size: 0.9rem;
}

@media (max-width: 500px) {
  .about-credits { grid-template-columns: 1fr; }
}

.about-credit-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.about-credit-value { color: var(--ink-soft); font-size: 0.875rem; font-weight: 400; }

/* =============================================================================
   CONTACT PAGE
   ============================================================================= */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  margin-top: 2rem;
}

@media (max-width: 800px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.contact-info {
  font-size: 0.9375rem;
  line-height: 1.65;
}

.contact-info p { margin-bottom: 1.5rem; color: var(--ink-soft); max-width: 40ch; font-weight: 400; }

.contact-direct {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.contact-direct-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.contact-direct-value {
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.contact-direct-value a:hover {
  color: var(--muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row { display: flex; flex-direction: column; gap: 0.5rem; }

.form-row label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-row input,
.form-row textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  letter-spacing: -0.005em;
  transition: border-color 0.2s var(--ease);
}

.form-row input:focus,
.form-row textarea:focus {
  border-bottom-color: var(--ink);
}

.form-row textarea {
  resize: vertical;
  min-height: 140px;
  font-family: inherit;
  line-height: 1.5;
}

.form-submit {
  align-self: flex-start;
  margin-top: 1rem;
  padding: 0.85rem 2.25rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.form-submit:hover {
  background: #2a2a28;
  transform: translateY(-1px);
}

.form-message {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.form-message.success { color: #2d6a4f; }
.form-message.error { color: #9b2c2c; }

/* =============================================================================
   PROJECT DETAIL PAGE
   ============================================================================= */

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
  transition: color 0.2s var(--ease);
}

.project-back:hover { color: var(--ink); }

.project-back::before { content: "←"; font-size: 1rem; }

.project-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
  margin-bottom: 3rem;
  position: relative;
  border-radius: 2px;
}

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

.project-hero-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a2a28 0%, #1a1a18 100%);
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Muted dark tone palette for placeholders. The same six classes apply to both
   grid placeholders and the detail page hero placeholder, keyed by project id
   so each project gets a consistent stand-in until art is added. Each tone
   stays in the same dark/muted family as the default so the front page reads
   as a coherent wall, just with subtle hue variation under the surface. */
.grid-item-placeholder.tone-1,
.project-hero-placeholder.tone-1 { background: linear-gradient(135deg, #2a2a28 0%, #1a1a18 100%); } /* neutral charcoal */
.grid-item-placeholder.tone-2,
.project-hero-placeholder.tone-2 { background: linear-gradient(135deg, #262a30 0%, #16191f 100%); } /* cool steel    */
.grid-item-placeholder.tone-3,
.project-hero-placeholder.tone-3 { background: linear-gradient(135deg, #2c2722 0%, #1c1814 100%); } /* warm umber    */
.grid-item-placeholder.tone-4,
.project-hero-placeholder.tone-4 { background: linear-gradient(135deg, #272a25 0%, #181b15 100%); } /* slate olive   */
.grid-item-placeholder.tone-5,
.project-hero-placeholder.tone-5 { background: linear-gradient(135deg, #2a2429 0%, #1c1820 100%); } /* deep plum     */
.grid-item-placeholder.tone-6,
.project-hero-placeholder.tone-6 { background: linear-gradient(135deg, #232a28 0%, #141a18 100%); } /* forest cool   */

.project-meta {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 700px) {
  .project-meta { grid-template-columns: 1fr; gap: 2rem; }
}

.project-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.project-title {
  font-family: var(--serif);
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
}

.project-logline {
  font-size: clamp(0.95rem, 1.4vw, 1.0625rem);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.55;
  letter-spacing: 0;
  max-width: 50ch;
}

.project-details {
  font-size: 0.85rem;
  line-height: 1.55;
  font-weight: 400;
}

.project-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.project-detail-row:last-child { border-bottom: none; }

.project-detail-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.project-detail-value {
  text-align: right;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.project-section {
  margin-bottom: 3rem;
}

.project-section-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.project-description {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 70ch;
}

.project-description p { margin-bottom: 1em; }

.project-trailers {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-trailer-label {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.project-trailer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border-radius: 2px;
}

.project-trailer iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.project-stills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.project-stills img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  background: var(--bg-soft);
}

/* If a project has an odd number of stills, the last one would otherwise sit
   alone in the bottom-left cell. Spanning it across both columns gives the
   sequence a clean bottom edge and lets the closing image breathe as a
   featured shot. */
.project-stills img:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .project-stills { grid-template-columns: 1fr; }
  .project-stills img:last-child:nth-child(odd) { grid-column: auto; }
}

.project-awards {
  list-style: none;
}

.project-awards li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: -0.005em;
}

.project-awards li:last-child { border-bottom: none; }

.project-external {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.85rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.project-external:hover { background: #2a2a28; transform: translateY(-1px); }

.project-external::after { content: "→"; }

/* =============================================================================
   FOOTER
   ============================================================================= */

.footer {
  margin-top: auto;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--rule-soft);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
}

.footer span { font-weight: 300; }

/* =============================================================================
   UTILITIES
   ============================================================================= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
