/* ===== Tim Kremer Design ===== */

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

:root {
  --color-bg: #faf9fc;
  --color-text: #1a1a2e;
  --color-muted: #716f82;
  --color-border: #ddd9e8;
  --color-card-bg: #fffdff;
  --color-bg-tertiary: #eeeaf4;
  --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1100px;
  --nav-height: 72px;
}

[data-theme="dark"] {
  --color-bg: #110f16;
  --color-text: #eeeaf4;
  --color-muted: #908ca0;
  --color-border: #2a2735;
  --color-card-bg: #1a1724;
  --color-bg-tertiary: #1e1b28;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Aurora Background ===== */

.aurora {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 600px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

[data-theme="dark"] .aurora {
  opacity: 0.3;
}

.aurora canvas {
  width: 100% !important;
  height: 100% !important;
}

main, footer {
  position: relative;
  z-index: 1;
}

/* ===== Nav ===== */

nav {
  position: sticky;
  top: 0;
  background: transparent;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background 0.3s;
}

nav.scrolled {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
}

[data-theme="dark"] nav.scrolled {
  background: linear-gradient(to bottom, rgba(10, 10, 10, 1) 0%, rgba(10, 10, 10, 0) 100%);
}

[data-theme="dark"] nav {
  background: transparent;
}

nav .nav-inner {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  display: flex;
  align-items: center;
  margin-right: 32px;
}

nav .logo img {
  height: 32px;
  width: auto;
  max-width: none;
  margin: 16px 0;
  filter: brightness(0);
  transition: filter 0.2s;
}

[data-theme="dark"] nav .logo img {
  filter: brightness(0) invert(1);
}

nav ul { list-style: none; display: flex; gap: 32px; align-items: center; }

nav ul li a {
  font-size: 1rem;
  color: var(--color-muted);
  transition: color 0.2s;
  position: relative;
}

nav ul li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1.5px;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

nav ul li a:hover,
nav ul li a.active { color: var(--color-text); }

.nav-ctas {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.nav-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: color 0.2s;
  white-space: nowrap;
  position: relative;
}

.nav-cta-secondary::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1.5px;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.nav-cta-secondary:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta-secondary:hover {
  color: var(--color-text);
}

.nav-cta-primary {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 99px;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.nav-cta-primary:hover {
  opacity: 0.8;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s;
}

/* ===== Layout ===== */

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
main { min-height: calc(100vh - var(--nav-height) - 120px); }
section { padding: 80px 0; }

/* ===== Typography — DM Sans, 120% line-height ===== */

.text-10 { font-size: 10px; line-height: 120%; }
.text-12 { font-size: 12px; line-height: 120%; }
.text-14 { font-size: 14px; line-height: 120%; }
.text-16 { font-size: 16px; line-height: 120%; }
.text-18 { font-size: 18px; line-height: 120%; }
.text-20 { font-size: 20px; line-height: 120%; }
.text-24 { font-size: 24px; line-height: 120%; }
.text-32 { font-size: 32px; line-height: 120%; }
.text-40 { font-size: 40px; line-height: 120%; }
.text-48 { font-size: 48px; line-height: 120%; }
.text-60 { font-size: 60px; line-height: 120%; }

h1 { font-size: 48px; font-weight: 600; letter-spacing: -0.03em; line-height: 120%; }
h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; line-height: 120%; margin-bottom: 24px; }
h3 { font-size: 20px; font-weight: 500; line-height: 120%; margin-bottom: 8px; }
p { color: var(--color-muted); max-width: 600px; line-height: 120%; }
.subtitle { font-size: 18px; color: var(--color-muted); margin-top: 16px; max-width: 520px; line-height: 120%; }

/* ===== Hero ===== */

.hero { padding: 120px 0 80px; }

/* ===== Gallery Hero ===== */

.gallery-hero {
  padding: 100px 0 80px;
}

.gallery-hero-inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
}

.gallery-hero-left {
  flex: 1;
  max-width: 720px;
}

.gallery-hero-micro {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 20px;
}

.gallery-hero-heading {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 115%;
}

.gallery-hero-body {
  font-size: 18px;
  color: var(--color-muted);
  margin-top: 24px;
  max-width: 520px;
  line-height: 150%;
}

.gallery-hero-ctas {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 16px 36px;
  background: #7C5CFC;
  color: #fff;
  border-radius: 99px;
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s;
  height: 60px;
}

.btn-primary:hover {
  opacity: 0.8;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 16px 36px;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 99px;
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
  height: 60px;
}

.btn-outline:hover {
  border-color: var(--color-text);
}

.gallery-hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.gallery-hero-circle-wrap {
  position: relative;
  width: 340px;
  height: 340px;
}

.gallery-hero-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
}

.gallery-hero-circle-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 30px 20px var(--color-bg);
}

.gallery-hero-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340px;
  height: 340px;
  margin-top: -170px;
  margin-left: -170px;
  animation: rotateText 30s linear infinite;
}

.gallery-hero-orbit text {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  fill: var(--color-muted);
  font-family: var(--font-main);
}

@keyframes rotateText {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gallery-hero-socials {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gallery-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  transition: color 0.2s;
}

.gallery-social-icon:hover {
  color: var(--color-text);
}

/* ===== Project Grid ===== */

.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }

.project-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.project-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.project-card .info { padding: 20px; }
.project-card .info h3 { margin-bottom: 4px; }
.project-card .info p { font-size: 0.9rem; }

/* ===== Archive Grid ===== */

.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.archive-item {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.archive-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.archive-item .thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.archive-item .info { padding: 16px; }
.archive-item .info h3 { font-size: 1rem; margin-bottom: 2px; }
.archive-item .info p { font-size: 0.85rem; }

/* ===== Filters ===== */

.filters { display: flex; gap: 12px; margin-bottom: 40px; flex-wrap: wrap; }

.filters button {
  padding: 8px 20px;
  border: 1px solid var(--color-border);
  border-radius: 99px;
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-muted);
  transition: all 0.2s;
  font-family: var(--font-main);
}

.filters button:hover,
.filters button.active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

/* ===== About ===== */

.about-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 64px; align-items: start; }

.about-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--color-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.about-text h1 { font-size: 2.2rem; margin-bottom: 24px; }
.about-text p { margin-bottom: 16px; line-height: 1.8; max-width: 100%; }

/* ===== CV ===== */

.cv-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cv-download-hero {
  display: inline-flex;
  align-items: center;
  padding: 16px 36px;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 99px;
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s;
  height: 60px;
}

.cv-download-hero:hover {
  opacity: 0.8;
}

.cv-section { margin-bottom: 56px; }

.cv-section h2 {
  font-size: 1.4rem;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.cv-entry { display: grid; grid-template-columns: 160px 1fr; gap: 24px; margin-bottom: 28px; }
.cv-entry .year { font-size: 0.9rem; color: var(--color-muted); padding-top: 2px; }
.cv-entry .details h3 { font-size: 1.05rem; margin-bottom: 4px; }
.cv-entry .details p { font-size: 0.9rem; }

.cv-company {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cv-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}

.cv-company-name {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
}

.cv-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.cv-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  color: var(--color-muted);
  transition: color 0.2s, background 0.2s;
}

.cv-pill:hover {
  color: var(--color-text);
  background: var(--color-border);
}

.cv-pill svg {
  flex-shrink: 0;
}

.cv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2.5px 6px 1.5px;
  line-height: 16px;
  text-align: center;
  border-radius: 99px;
  background: rgba(124, 92, 252, 0.16);
  border: 1px solid rgba(124, 92, 252, 0.08);
  color: #7C5CFC;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  vertical-align: middle;
  position: relative;
  top: -2px;
  margin-left: 6px;
}

.cv-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cv-list li {
  font-size: 0.9rem;
  color: var(--color-muted);
  padding-left: 16px;
  position: relative;
  margin-bottom: 6px;
  line-height: 1.5;
}

.cv-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23999'%3E%3Cpath d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.cv-sub-roles {
  margin-top: 12px;
  padding-left: 0;
  margin-left: 17px;
  position: relative;
}

.cv-sub-role {
  padding-left: 20px;
  padding-bottom: 16px;
  position: relative;
}

.cv-sub-role:last-child {
  padding-bottom: 0;
}

.cv-sub-role::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  z-index: 1;
}

.cv-sub-role::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 14px;
  bottom: -10px;
  width: 2px;
  background: var(--color-border);
}

.cv-sub-role:last-child::after {
  display: none;
}

.cv-sub-date {
  font-size: 0.8rem;
  color: var(--color-muted);
  display: block;
  margin-bottom: 2px;
}

.cv-sub-role h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.cv-sub-role p {
  font-size: 0.85rem;
  line-height: 20px;
}

.cv-download {
  display: inline-block;
  padding: 12px 28px;
  background: var(--color-text);
  color: var(--color-bg);
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
  margin-top: 16px;
}

.cv-download:hover { opacity: 0.8; }

/* ===== Footer ===== */

footer { border-top: 1px solid var(--color-border); padding: 40px 0; text-align: center; }
footer p { font-size: 0.85rem; color: var(--color-muted); margin: 0 auto; }
footer .footer-links { margin-top: 12px; display: flex; justify-content: center; gap: 24px; }
footer .footer-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--color-muted); transition: color 0.2s; }
footer .footer-links a:hover { color: var(--color-text); }

/* ===== Sidebar Nav ===== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 72px;
  height: 100vh;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-link {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--color-muted);
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
}

.sidebar-link:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.sidebar-link.active {
  background: var(--color-text);
  color: var(--color-bg);
}

/* Tooltip */
.sidebar-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-text);
  color: var(--color-bg);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  transform: translateY(-50%) translateX(-4px);
}

.sidebar-link:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-theme {
  margin-top: auto;
}

/* Body offset when sidebar is present */
body.has-sidebar {
  padding-left: 72px;
}

body.has-sidebar nav {
  display: none;
}

/* ===== Pinterest Homepage ===== */

.pin-main {
  min-height: 100vh;
  padding: 0;
}

.pin-header {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 50;
  padding: 16px 32px;
  border-bottom: 1px solid var(--color-border);
}

.pin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pin-tabs button {
  padding: 10px 22px;
  border: none;
  border-radius: 99px;
  background: var(--color-card-bg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--color-muted);
  transition: all 0.2s;
  font-family: var(--font-main);
  white-space: nowrap;
  border: 1px solid var(--color-border);
}

.pin-tabs button:hover {
  color: var(--color-text);
  border-color: var(--color-text);
}

.pin-tabs button.active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

/* Masonry Grid */
.masonry {
  columns: 4;
  column-gap: 16px;
  padding: 24px 32px;
}

.pin-card {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pin-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.pin-img {
  width: 100%;
  border-radius: 16px 16px 0 0;
  background: var(--color-bg-tertiary);
}

.pin-info {
  padding: 12px 14px 16px;
}

.pin-info h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.pin-info p {
  font-size: 12px;
  color: var(--color-muted);
}

/* ===== Case Studies ===== */

.case-list {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.case-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.case-card.reverse {
  grid-template-columns: 1fr 1.2fr;
}

.case-card.reverse .case-thumb {
  order: 2;
}

.case-card.reverse .case-body {
  order: 1;
}

.case-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  transition: transform 0.3s;
}

.case-card:hover .case-thumb {
  transform: scale(1.02);
}

.case-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.case-body h2 {
  font-size: 32px;
  margin-bottom: 16px;
}

.case-body p {
  font-size: 16px;
  line-height: 160%;
  max-width: 100%;
  margin-bottom: 20px;
}

.case-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  transition: opacity 0.2s;
}

.case-card:hover .case-cta {
  opacity: 0.6;
}

/* ===== Case Study Detail Page ===== */

.case-hero {
  padding: 80px 0 48px;
}

.case-back {
  display: inline-block;
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 24px;
  transition: color 0.2s;
}

.case-back:hover {
  color: var(--color-text);
}

.case-hero .case-tag {
  margin-bottom: 16px;
}

.case-hero h1 {
  margin-bottom: 16px;
}

.case-meta {
  display: flex;
  gap: 48px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.case-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.case-meta strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

.case-meta span {
  font-size: 14px;
}

.case-section {
  padding: 64px 0;
}

.case-content h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.case-content p {
  font-size: 16px;
  line-height: 175%;
  max-width: 680px;
  margin-bottom: 16px;
}

.case-image-full {
  padding: 0 0 16px;
}

.case-img-placeholder {
  width: 100%;
  border-radius: 12px;
}

.case-image-full .case-img-placeholder {
  border-radius: 0;
}

.case-image-pair {
  padding: 16px 0;
}

.case-pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.case-trio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.case-pair-grid .case-img-placeholder,
.case-trio-grid .case-img-placeholder {
  border-radius: 12px;
}

.case-next {
  padding: 80px 0;
  border-top: 1px solid var(--color-border);
}

/* ===== References ===== */

.ref-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.ref-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ref-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.ref-card.ref-featured {
  grid-column: 1 / -1;
  padding: 48px;
}

.ref-card.ref-featured blockquote {
  font-size: 24px;
  line-height: 150%;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.ref-card blockquote {
  font-size: 16px;
  line-height: 170%;
  color: var(--color-text);
  font-style: normal;
  margin: 0;
}

.ref-author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ref-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
  flex-shrink: 0;
}

.ref-author strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.ref-author span {
  display: block;
  font-size: 13px;
  color: var(--color-muted);
}

.ref-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-social-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-muted);
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
}

.ref-social-icon:hover {
  opacity: 1;
  color: var(--color-text);
}

/* ===== Dark Mode Toggle ===== */

.theme-toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-muted);
  transition: color 0.2s;
  margin-left: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle:hover {
  color: var(--color-text);
}

/* ===== Design System Page ===== */

.ds-section { margin-bottom: 64px; }
.ds-section h2 { border-bottom: 1px solid var(--color-border); padding-bottom: 12px; }

.ds-colors {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.ds-color-swatch {
  text-align: center;
}

.ds-color-swatch .swatch {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  margin-bottom: 8px;
}

.ds-color-swatch span {
  font-size: 0.8rem;
  color: var(--color-muted);
  display: block;
}

.ds-color-swatch strong {
  font-size: 0.85rem;
  display: block;
  margin-bottom: 2px;
}

.ds-type-sample {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.ds-type-sample .label {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.ds-components {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.ds-component-box {
  padding: 24px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.ds-component-box h3 { margin-bottom: 16px; }

.ds-spacing {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.ds-spacing-block {
  text-align: center;
}

.ds-spacing-block .block {
  background: var(--color-text);
  opacity: 0.15;
  border-radius: 4px;
  margin-bottom: 6px;
}

.ds-spacing-block span {
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* ===== Responsive ===== */

@media (max-width: 1200px) {
  .masonry { columns: 3; }
}

@media (max-width: 900px) {
  .masonry { columns: 2; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  body.has-sidebar { padding-left: 0; }
  body.has-sidebar nav { display: flex; }
  .pin-header { padding: 12px 16px; }
  .masonry { columns: 2; padding: 16px; column-gap: 12px; }
  .pin-card { margin-bottom: 12px; }
  .ref-grid { grid-template-columns: 1fr; }
  .ref-card.ref-featured { padding: 32px; }
  .ref-card.ref-featured blockquote { font-size: 18px; }
  .case-card, .case-card.reverse { grid-template-columns: 1fr; gap: 24px; }
  .case-card.reverse .case-thumb { order: 0; }
  .case-card.reverse .case-body { order: 0; }
  .case-meta { flex-wrap: wrap; gap: 24px; }
  .case-pair-grid { grid-template-columns: 1fr; }
  .case-trio-grid { grid-template-columns: 1fr; }
  h1 { font-size: 32px; }
  .hero { padding: 80px 0 48px; }
  .gallery-hero { padding: 60px 0 48px; }
  .gallery-hero-inner { flex-direction: column; text-align: center; gap: 40px; }
  .gallery-hero-left { max-width: 100%; }
  .gallery-hero-heading { font-size: 36px; }
  .gallery-hero-ctas { justify-content: center; }
  .gallery-hero-circle-wrap { width: 270px; height: 270px; }
  .gallery-hero-circle { width: 210px; height: 210px; }
  .gallery-hero-orbit { width: 270px; height: 270px; margin-top: -135px; margin-left: -135px; }
  .project-grid { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .about-layout { grid-template-columns: 1fr; gap: 40px; }
  .cv-entry { grid-template-columns: 1fr; gap: 4px; }

  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    gap: 16px;
  }
  nav ul.open { display: flex; }
  .menu-toggle { display: block; }
  .nav-ctas { display: none; }
  nav ul.open .nav-ctas-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 480px) {
  .archive-grid { grid-template-columns: 1fr; }
  section { padding: 56px 0; }
}
