:root {
  color-scheme: light dark;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-9: 96px;

  --radius-1: 0px;
  --radius-2: 0px;

  --content-max: 1160px;
  --content-padding: 24px;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 28px;

  --line-tight: 1.3;
  --line-body: 1.5;

  --flexoki-black: #100f0f;
  --flexoki-paper: #fffcf0;
  --flexoki-base-50: #f2f0e5;
  --flexoki-base-100: #e6e4d9;
  --flexoki-base-200: #cecdc3;
  --flexoki-base-800: #403e3c;
  --flexoki-base-850: #343331;
  --flexoki-base-900: #282726;
}

html[data-theme="light"] {
  --color-bg: var(--flexoki-paper);
  --color-text: var(--flexoki-black);
  --color-border: var(--flexoki-base-200);
  --color-accent: var(--flexoki-black);
  --color-subtle: var(--flexoki-base-100);
  --color-selection: rgba(32, 94, 166, 0.2);
}

html[data-theme="dark"] {
  --color-bg: var(--flexoki-black);
  --color-text: var(--flexoki-paper);
  --color-border: var(--flexoki-base-800);
  --color-accent: var(--flexoki-paper);
  --color-subtle: var(--flexoki-base-850);
  --color-selection: rgba(67, 133, 190, 0.2);
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  color-scheme: light dark;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: var(--text-md);
  line-height: var(--line-body);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  font-weight: 400;
  transition: font-weight 0.2s ease;
}

a:hover,
a:focus-visible {
  font-weight: 600;
}

.modal-target {
  cursor: zoom-in;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

::selection {
  background: var(--color-selection);
}

.container {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.site-header {
  padding: var(--space-6) 0 var(--space-4);
}

.header-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 24px;
  height: 24px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--text-sm);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  padding: 6px;
  background: none;
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle img {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-toggle .icon-dark {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-light {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-dark {
  display: block;
}

main {
  padding-bottom: var(--space-9);
}

.section {
  padding: var(--space-7) 0;
}

.case-back-link {
  margin-bottom: var(--space-4);
}

.back-home {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  text-decoration-thickness: 1px;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

.section-label h2,
.section-label h1 {
  margin: 0 0 var(--space-4);
  font-weight: 500;
  line-height: var(--line-tight);
}

.section-label .case-study-title {
  margin-bottom: var(--space-1);
}


.section-label p {
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.hero-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-2);
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-subtle), var(--color-border));
}

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

.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  z-index: 999;
}

.image-modal.is-open {
  display: flex;
}

.image-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 15, 15, 0.7);
}

.image-modal__content {
  position: relative;
  max-width: min(92vw, 1120px);
  max-height: 85vh;
  background: var(--color-bg);
  border-radius: var(--radius-2);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal__img {
  max-width: 100%;
  max-height: 78vh;
  height: auto;
  width: auto;
  display: block;
}

.image-modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: var(--text-lg);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

body.is-gated {
  overflow: hidden;
}

.soft-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(16, 15, 15, 0.55);
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
  z-index: 1000;
}

.soft-gate--hidden {
  display: none;
}

.soft-gate__panel {
  width: min(92vw, 420px);
  background: var(--color-bg);
  color: var(--color-text);
  border-radius: 4px;
  padding: var(--space-6);
  position: relative;
  display: grid;
  gap: var(--space-2);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.10), 0 8px 20px rgba(0, 0, 0, 0.1);
}

.soft-gate__panel h1,
.soft-gate__panel p {
  margin: 0;
}

.soft-gate__panel h1 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-7);
}

.soft-gate__note {
  font-size: var(--text-md);
}

.soft-gate__back {
  position: absolute;
  top: var(--space-6);
  left: var(--space-6);
  opacity: 0.85;
}

.soft-gate__form {
  display: grid;
  gap: var(--space-2);
  justify-items: stretch;
  margin-top: var(--space-3);
}

.soft-gate__form label {
  font-size: var(--text-sm);
}

.soft-gate__form input {
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-text);
  padding: 10px 12px;
  width: 100%;
  border-radius: 999px;
  text-align: center;
}

.soft-gate__form button {
  border: none;
  background: none;
  color: var(--color-text);
  padding: 6px 12px;
  cursor: pointer;
  justify-self: center;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.soft-gate__error {
  min-height: 1.2em;
  font-size: var(--text-sm);
  opacity: 0.8;
}

.work-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.work-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.work-marker {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.work-marker img {
  width: 56px;
  height: 56px;
  display: block;
}

.work-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.work-title {
  font-weight: 600;
}

.work-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.work-year {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-1);
  background: var(--color-subtle);
}

.gallery-card {
  aspect-ratio: 1 / 1;
  background: var(--color-subtle);
  border-radius: var(--radius-1);
  border: 1px solid var(--color-border);
}

.gallery-link {
  font-size: var(--text-sm);
  color: var(--color-accent);
}

.about-details {
  display: grid;
  gap: var(--space-5);
}

.detail-block h3 {
  margin: 0 0 var(--space-2);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text);
}

a.external::after {
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.85em;
}

a.external::after {
  content: "↗";
}

.contact-group {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: var(--space-5);
}

.contact-headshot {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.detail-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-1);
  color: var(--color-text);
}

.detail-block strong {
  color: var(--color-text);
  display: block;
  font-weight: 600;
}

.case-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.case-media.case-media-large {
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.case-media-item {
  margin: 0;
}

.case-media-item img {
  width: 100%;
  border-radius: var(--radius-1);
  background: var(--color-subtle);
}

.case-media-wide {
  grid-column: 1 / -1;
}

.case-subtitle {
  font-size: var(--text-lg);
  margin-top: calc(-1 * var(--space-2));
  color: var(--color-text);
}

.case-meta {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: grid;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

.case-meta strong {
  font-weight: 600;
}

.skills-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
}


.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-5) 0;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

@media (max-width: 960px) {
  .section-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .header-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .section {
    padding: var(--space-6) 0;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .contact-group {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: var(--space-4);
  }

  .case-media {
    grid-template-columns: 1fr;
  }


  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }
}
