/* PhotographySG — custom styles layered on top of Tailwind (Play CDN) */

:root {
  --ink: #0B0B0C;
  --paper: #F6F4EF;
  --flame: #FF4A1C;
  --flame-ink: #0B0B0C;
  --hair: rgba(11, 11, 12, 0.14);
  --hair-light: rgba(246, 244, 239, 0.16);
}

html { scroll-behavior: smooth; }
section[id], main span[id] { scroll-margin-top: 88px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--flame); color: #fff; }

.font-display { font-family: "Space Grotesk", "Inter", sans-serif; }
.font-mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* --- Typographic helpers --- */
.kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.display-xl {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-size: clamp(2.6rem, 8.4vw, 7rem);
}
.display-lg {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.025em;
  font-size: clamp(2.1rem, 5.4vw, 4.25rem);
}
.display-md {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}
.mark {
  background-image: linear-gradient(transparent 62%, rgba(255, 74, 28, 0.9) 62%);
  padding: 0 0.05em;
}

/* --- Focus visibility --- */
a, button, input, select, textarea, summary, [tabindex] {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--flame);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -100px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-flame { background: var(--flame); border-color: var(--flame); color: var(--flame-ink); }
.btn-flame:hover { background: #ff5c33; border-color: #ff5c33; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #23232a; }
.btn-ghost { background: transparent; color: inherit; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-ghost.on-dark { border-color: var(--paper); }
.btn-ghost.on-dark:hover { background: var(--paper); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* --- Header --- */
.site-header {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  /* default on every page: solid, dark text */
  background: var(--paper);
  color: var(--ink);
  border-color: var(--hair);
}
.site-header .logo-tag { color: rgba(11, 11, 12, 0.55); }

/* only the homepage gets a transparent header sitting over its dark hero video;
   a soft top-scrim keeps the text legible over bright video frames */
body.home .site-header[data-state="top"] {
  background: linear-gradient(180deg, rgba(11, 11, 12, 0.5) 0%, rgba(11, 11, 12, 0) 100%);
  color: var(--paper);
  border-color: transparent;
}
body.home .site-header[data-state="top"] .logo-tag { color: rgba(246, 244, 239, 0.6); }

/* logo lockup */
.logo-sg {
  background: var(--flame);
  color: var(--flame-ink);
  padding: 0.02em 0.28em;
  margin-left: 0.12em;
}

/* --- Marquee --- */
.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
  animation: marquee 32s linear infinite;
}
.marquee--reverse .marquee__track { animation-direction: reverse; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee {
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; flex-wrap: wrap; }
  .marquee__track { animation: none; flex-wrap: wrap; }
  .marquee--reverse { display: none; }
}

/* --- Scroll reveal (progressive enhancement) --- */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* --- Hero --- */
.hero-media {
  object-position: center;
  background: #0B0B0C;
}
/* subtle drift on the video so a short loop feels less static; killed for reduced motion */
.hero-media[data-playing="true"] {
  animation: heroDrift 26s ease-in-out infinite alternate;
}
@keyframes heroDrift {
  from { transform: scale(1.06); }
  to { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-media { animation: none !important; transform: none !important; }
}

/* rotating word — container width tracks the active word (set by site.js) */
.rotator {
  display: inline-grid;
  justify-items: start;
  vertical-align: bottom;
  transition: width 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
.rotator > span {
  grid-area: 1 / 1;
  width: max-content;
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 0.4s ease, transform 0.4s ease;
  color: var(--flame);
  white-space: nowrap;
}
.rotator > span.is-active {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .rotator { display: inline; width: auto !important; }
  .rotator > span { position: static; width: auto; opacity: 1; transform: none; }
  .rotator > span::after { content: ", "; color: var(--flame); }
  .rotator > span:last-child::after { content: ""; }
}

/* --- Service cards flip --- */
.svc {
  transition: background-color 0.25s ease, color 0.25s ease;
}
.svc:hover, .svc:focus-within {
  background: var(--ink);
  color: var(--paper);
}
.svc:hover .svc__num, .svc:focus-within .svc__num { color: var(--flame); }
.svc:hover .svc__rule, .svc:focus-within .svc__rule { border-color: var(--hair-light); }
@media (prefers-reduced-motion: reduce) {
  .svc { transition: none; }
}

/* --- Work gallery thumbs --- */
.thumb {
  position: relative;
  overflow: hidden;
  background: #ddd8cf;
}
.thumb img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%; height: 100%; object-fit: cover;
}
.thumb:hover img, .thumb:focus-visible img { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
  .thumb img { transition: none; }
  .thumb:hover img { transform: none; }
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(11, 11, 12, 0.94);
  display: flex;
  flex-direction: column;
}
.lightbox[hidden] { display: none; }
.lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 0;
}
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: var(--paper);
}
.lightbox__btn {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hair-light);
  color: var(--paper);
  background: transparent;
  cursor: pointer;
}
.lightbox__btn:hover { background: var(--flame); border-color: var(--flame); color: #fff; }

/* --- Packages --- */
.pkg-feature {
  background: var(--ink);
  color: var(--paper);
}
.pkg-feature .pkg__price small { color: rgba(246,244,239,0.6); }

/* --- FAQ --- */
details.faq {
  border-top: 1px solid var(--hair);
}
details.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1.5rem 0;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq .faq__icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--flame);
  font-family: "JetBrains Mono", monospace;
}
details.faq[open] .faq__icon { transform: rotate(45deg); }
details.faq .faq__body {
  padding-bottom: 1.75rem;
  max-width: 60ch;
  color: rgba(11, 11, 12, 0.72);
}
@media (prefers-reduced-motion: reduce) {
  details.faq .faq__icon { transition: none; }
}

/* --- Forms --- */
.field label {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  background: #fff;
  border: 1px solid var(--hair);
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink);
}
.field[data-invalid="true"] input,
.field[data-invalid="true"] select,
.field[data-invalid="true"] textarea {
  border-color: #c0261a;
  background: #fff5f4;
}
.field__error { color: #c0261a; font-size: 0.82rem; margin-top: 0.35rem; }

/* hide honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Section index number --- */
.sec-index {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--flame);
}

/* --- Utility --- */
.rule-2 { border-top: 2px solid var(--ink); }
.on-dark .rule-2 { border-color: var(--paper); }
.link-underline {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.link-underline:hover { text-decoration-color: var(--flame); }
