/* ShuffleCraft Studio — site styles */
:root {
  --bg: #f7f4ee;
  --bg-alt: #efe9df;
  --ink: #1c2333;
  --ink-muted: #4a5568;
  --accent: #2d6a4f;
  --accent-hot: #40916c;
  --badge: #b08968;
  --card: #ffffff;
  --shadow: rgba(28, 35, 51, 0.08);
  --radius: 12px;
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
  --max: 72rem;
  --space: clamp(1rem, 4vw, 2rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hot);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
}

.skip-link:focus {
  left: var(--space);
  top: var(--space);
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--bg-alt);
  box-shadow: 0 1px 0 var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem var(--space);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bg-alt);
  border-radius: 8px;
  background: var(--bg);
  font: inherit;
  cursor: pointer;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav a {
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--accent);
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem var(--space);
    background: var(--card);
    border-bottom: 1px solid var(--bg-alt);
    box-shadow: 0 8px 24px var(--shadow);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.5rem 0;
  }
}

main {
  flex: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--space);
  width: 100%;
}

.hero {
  text-align: center;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.hero__tagline {
  font-size: 1.2rem;
  color: var(--ink-muted);
  max-width: 36em;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: #fff !important;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: var(--accent-hot);
  color: #fff !important;
}

.btn--ghost {
  background: transparent;
  color: var(--accent) !important;
  border: 2px solid var(--accent);
}

.btn--ghost:hover {
  background: var(--bg-alt);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 1.5rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px var(--shadow);
  border: 1px solid var(--bg-alt);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px var(--shadow);
}

.project-card__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, var(--bg-alt), #e2ddd4);
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

/* Splash / hero images: bottom-right source overlay (see AGENTS.md → Image attribution overlays) */
.media-with-credit {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.media-with-credit--cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-with-credit--natural {
  height: auto;
}

.media-with-credit--natural img {
  width: 100%;
  height: auto;
  display: block;
}

.media-credit {
  position: absolute;
  bottom: 0;
  right: 0;
  left: auto;
  max-width: min(100%, 15.5rem);
  margin: 0;
  padding: 0.2rem 0.42rem;
  font-size: 0.58rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.96);
  background: rgba(18, 16, 22, 0.62);
  backdrop-filter: blur(5px);
  border-radius: 6px 0 0 0;
  text-align: right;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.06) inset;
}

.detail-hero__media .media-credit {
  font-size: 0.68rem;
  max-width: min(100%, 20rem);
  padding: 0.28rem 0.5rem;
}

.media-credit__label {
  font-weight: 700;
  opacity: 0.88;
}

.project-card__media--placeholder {
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

.project-card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card__body h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.project-card__body h2 a {
  color: var(--ink);
  text-decoration: none;
}

.project-card__body h2 a:hover {
  color: var(--accent);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: rgba(176, 137, 104, 0.2);
  color: #6b4f3a;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.badge--testing {
  background: rgba(72, 104, 160, 0.22);
  color: #2a4578;
}

.project-card__excerpt {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  flex: 1;
}

.project-card__link {
  font-weight: 600;
  font-size: 0.9rem;
}

.detail-hero {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .detail-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
  }
}

.detail-hero__media {
  border-radius: var(--radius);
  background: var(--bg-alt);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid var(--bg-alt);
}

.detail-hero__media .media-with-credit {
  width: 100%;
}

.detail-list {
  margin: 0;
  padding-left: 1.25rem;
}

.detail-list li {
  margin-bottom: 0.5rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.site-footer {
  margin-top: auto;
  padding: 2rem var(--space);
  background: var(--ink);
  color: #c5cdd8;
  font-size: 0.9rem;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer a {
  color: #a8e6cf;
}

.legal-prose {
  max-width: 42rem;
}

.legal-prose h1 {
  font-family: var(--font-display);
  font-size: 2rem;
}

.legal-prose h2 {
  font-size: 1.15rem;
  margin-top: 2rem;
}

.error-page {
  text-align: center;
  padding: 4rem 0;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: 4rem;
  margin: 0;
  color: var(--accent);
}
