/* ============================================================
   DICE — Dream Inspired Custom Electronics
   Pure-black editorial showcase (RCA-inspired)
   ============================================================ */

:root {
  --bg:        #f4f2ec;   /* warm off-white / cream */
  --surface:   #ffffff;
  --text:      #1a1a18;   /* near-black */
  --muted:     #6f6c66;
  --accent:       #43583f;   /* forest green */
  --accent-hover: #5a7353;
  --border:    rgba(0, 0, 0, 0.14);
  --maxw:      1200px;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --font:      "Futura", "Jost", "Century Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---------- Type ---------- */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

h1, h2, h3 { font-weight: 600; line-height: 1.1; }

.display {
  font-size: clamp(2.8rem, 8.5vw, 6.75rem);
  letter-spacing: 0.12em;
  line-height: 1.02;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  letter-spacing: 0.13em;
  line-height: 1.05;
  text-transform: uppercase;
}

.lead { font-size: clamp(1.12rem, 2.4vw, 1.5rem); line-height: 1.6; color: var(--muted); max-width: 58ch; }

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

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  background: rgba(244, 242, 236, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.brand img { height: 46px; width: auto; }
.nav-mark { display: flex; align-items: center; }
.nav-mark img { height: 30px; width: auto; display: block; }
.brand .name { font-weight: 700; letter-spacing: 0.2em; font-size: clamp(8px, 1.6vw, 18px); text-transform: uppercase; white-space: nowrap; }

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s var(--ease);
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 1px;
  background: var(--accent);
}

.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; font-size: 22px; }

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
main { padding-top: 76px; }

.section { padding: 128px 0; }
.section.tight { padding: 88px 0; }

/* ============================================================
   HERO (landing)
   ============================================================ */
.hero {
  min-height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0;
}
.hero .display { margin: 18px 0 24px; }
.hero .display span { color: var(--accent); }
.hero-actions { margin-top: 40px; display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: all 0.25s var(--ease);
}
.btn:hover { border-color: var(--text); transform: translateY(-2px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #f4f2ec; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ============================================================
   FEATURED / WORK
   ============================================================ */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.feature .feature-copy .section-title { margin: 14px 0 18px; }
.feature .feature-meta { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.feature .feature-meta .label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.feature .feature-meta .val { font-size: 15px; margin-top: 4px; }

.media-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.media-frame img { width: 100%; height: auto; display: block; }

/* image grid for showcase */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.gallery .media-frame.span-2 { grid-column: span 2; }

/* placeholder styling until real photos are dropped in */
.ph {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background:
    repeating-linear-gradient(45deg, #e6e3db 0, #e6e3db 12px, #efece5 12px, #efece5 24px);
  padding: 24px;
}
.ph.wide { aspect-ratio: 16 / 9; }

/* ---------- Carousel ---------- */
.carousel { position: relative; margin-top: 44px; }
.carousel-viewport {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
}
.carousel-track { display: flex; transition: transform 0.55s var(--ease); }
.carousel-slide { position: relative; min-width: 100%; aspect-ratio: 3 / 2; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-cap { display: none; }
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 26px; line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.carousel-btn:hover { background: var(--text); color: var(--bg); }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }
.carousel-dots { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.carousel-dots button {
  width: 8px; height: 8px;
  padding: 0;
  border: 0; border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.carousel-dots button.active { background: var(--accent); transform: scale(1.35); }

/* ============================================================
   SHOWCASE WALL (landing)
   ============================================================ */
.showcase-intro { padding: 56px 0 40px; }
.showcase-intro .display { margin: 14px 0 22px; }

.showcase {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  background: var(--border);   /* shows as hairline gaps between tiles */
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  color: inherit;
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s var(--ease);
}
.tile:hover img { transform: scale(1.06); }
.tile-cap { display: none; }
.tile-cap .client { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.tile-cap .title { font-size: 1.05rem; letter-spacing: 0.05em; text-transform: uppercase; color: #fff; margin-top: 5px; }

/* placeholder tiles — intentional, not "broken" */
.tile.placeholder { cursor: default; }
.tile .ph-fill {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 9px;
  padding: 24px;
  background: repeating-linear-gradient(45deg, #e6e3db 0, #e6e3db 12px, #efece5 12px, #efece5 24px);
}
.tile .ph-fill .ph-tag { font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--accent); }
.tile .ph-fill .ph-name { font-size: 1.2rem; letter-spacing: 0.05em; text-transform: uppercase; }
.tile .ph-fill .ph-soon { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 980px) { .showcase { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .showcase { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   MARQUEE — scrolling section labels (RCA-style)
   ============================================================ */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 56px;
  padding-left: 56px;
  animation: marquee 30s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  font-size: clamp(1.3rem, 3.2vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}
.marquee span.ghost {
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   RCA-STYLE SHOWCASE — build list + swapping stage
   ============================================================ */
.showcase-rca {
  position: relative;
  display: grid;
  grid-template-columns: 0.56fr 1.44fr;
  min-height: calc(100vh - 76px);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* RCA-style vertical scroll cue */
.scroll-cue {
  position: absolute;
  left: 18px;
  bottom: 30px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,0.72);
  pointer-events: none;
}
.scroll-cue .label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.scroll-cue .line {
  width: 1px;
  height: 54px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.7), transparent);
  animation: scrollcue 2.2s var(--ease) infinite;
  transform-origin: top;
}
@keyframes scrollcue {
  0%   { transform: scaleY(0.2); opacity: 0.3; }
  50%  { transform: scaleY(1);   opacity: 1; }
  100% { transform: scaleY(0.2); opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue .line { animation: none; }
}
.sc-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 64px 48px;
  background: #16160f;
}
.sc-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  padding: 0;
  color: rgba(255,255,255,0.5);
  align-self: flex-start;
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}
.sc-client { display: block; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--accent); margin-bottom: 7px; }
.sc-name { font-size: clamp(0.95rem, 1.5vw, 1.25rem); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.1; }
.sc-arrow { font-size: 1rem; line-height: 1; opacity: 0; transform: translateX(-10px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.sc-item:hover, .sc-item.active { color: #fff; padding-left: 14px; }
.sc-item:hover .sc-arrow, .sc-item.active .sc-arrow { opacity: 1; transform: translateX(0); color: #fff; }
.sc-item.soon { cursor: default; color: rgba(255,255,255,0.3); }

.sc-stage { position: relative; overflow: hidden; background: #16160f; }
.sc-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.5s var(--ease); }
.sc-layer.show { opacity: 1; }
.sc-layer.sc-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: repeating-linear-gradient(45deg, #e6e3db 0, #e6e3db 12px, #efece5 12px, #efece5 24px);
}
.sc-ph .ph-fill { position: static; inset: auto; padding: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 11px; }
.sc-ph .ph-tag { font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--accent); }
.sc-ph .ph-name { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.sc-ph .ph-soon { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 860px) {
  .showcase-rca { grid-template-columns: 1fr; min-height: 0; }
  .sc-stage { order: -1; aspect-ratio: 3 / 2; }
  .sc-list { padding: 36px 28px; gap: 12px; }
  .sc-name { font-size: clamp(1.1rem, 4.5vw, 1.4rem); }
  .sc-arrow { display: none; }
  .scroll-cue { display: none; }
  .sc-item:hover, .sc-item.active { padding-left: 0; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.prose p { margin-bottom: 22px; max-width: 65ch; color: #3a3833; }
.prose p:first-of-type { font-size: 1.2rem; color: var(--text); }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 56px; }
.value h3 { font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 10px; }
.value p { color: var(--muted); font-size: 15px; }
.value .num { color: var(--accent); font-size: 13px; letter-spacing: 0.2em; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }

.field { margin-bottom: 22px; }
.field label { display: block; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  transition: border-color 0.2s var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 140px; }

.contact-direct .row { padding: 18px 0; border-bottom: 1px solid var(--border); }
.contact-direct .row .label { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.contact-direct .row a, .contact-direct .row .val { font-size: 18px; margin-top: 4px; display: inline-block; }
.contact-direct .row a:hover { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 40px;
}
.footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.footer .name { letter-spacing: 0.3em; font-weight: 700; }
.footer .links { display: flex; gap: 24px; }
.footer .links a { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.footer .links a:hover { color: var(--text); }
.footer .copy { color: var(--muted); font-size: 12px; width: 100%; }

/* ============================================================
   DICE LOADER
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.7s var(--ease), visibility 0.7s var(--ease);
}
#loader.done { opacity: 0; visibility: hidden; }

#loader .dice {
  width: 130px;
  height: auto;
  transform-origin: center;
  animation: dice-roll 1.5s var(--ease) forwards;
}
#loader .loader-text {
  text-align: center;
  opacity: 0;
  animation: fade-up 0.8s var(--ease) 1.25s forwards;
}
#loader .loader-text .name { font-size: 22px; letter-spacing: 0.42em; font-weight: 700; }
#loader .loader-text .tag { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

@keyframes dice-roll {
  0%   { transform: translateY(-60px) rotate(0deg) scale(0.4); opacity: 0; }
  25%  { opacity: 1; }
  60%  { transform: translateY(10px) rotate(540deg) scale(1.08); }
  78%  { transform: translateY(-6px) rotate(680deg) scale(0.98); }
  100% { transform: translateY(0) rotate(720deg) scale(1); opacity: 1; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* reveal animation for page content after load */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  #loader .dice { animation: none; }
  #loader .loader-text { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .carousel-track { transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .feature, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .values { grid-template-columns: 1fr; gap: 28px; }
  .gallery { grid-template-columns: 1fr; }
  .gallery .media-frame.span-2 { grid-column: span 1; }

  .nav-links {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;                 /* sits behind the bar (z-index 50) */
    flex-direction: column;
    gap: 0;
    padding-top: 73px;           /* clears the fixed nav bar */
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    transition: transform 0.35s var(--ease);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 18px 32px; border-top: 1px solid var(--border); }
  .nav-toggle { display: block; }
}
