:root {
  color-scheme: light;
  --bg: #f6f2eb;
  --paper: #fffdf8;
  --paper-soft: rgba(255, 253, 248, 0.78);
  --ink: #1f2422;
  --muted: #6a716e;
  --line: rgba(31, 36, 34, 0.12);
  --green: #276f61;
  --blue: #2f7fc1;
  --yellow: #ffd21f;
  --red: #d76543;
  --shadow: 0 22px 70px rgba(38, 43, 39, 0.12);
  --radius: 8px;
  --section: clamp(78px, 10vw, 136px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 242, 235, 0) 36rem),
    radial-gradient(circle at 18% 10%, rgba(255, 210, 31, 0.12), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

.floating-header {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(calc(100% - 24px), 690px);
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 16px 42px rgba(45, 48, 44, 0.1);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.brand {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fffaf1;
  font-weight: 800;
  overflow: hidden;
}

.brand img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand span {
  grid-area: 1 / 1;
}

.brand img:not([hidden]) + span {
  display: none;
}

.nav-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  gap: 4px;
}

.nav-links a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 14px 16px;
  text-align: center;
  transition: background 180ms ease, color 180ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(39, 111, 97, 0.12);
  color: var(--green);
}

main,
footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.section {
  padding: var(--section) 0 0;
  scroll-margin-top: 96px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 860px);
  align-items: center;
  min-height: 78vh;
  padding-top: clamp(112px, 12vw, 152px);
}

.eyebrow,
.case-type {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 26px;
  font-size: clamp(42px, 5.6vw, 74px);
  line-height: 1.01;
  letter-spacing: 0;
}

.hero-title {
  max-width: 860px;
  margin-bottom: 24px;
  font-size: clamp(34px, 4.5vw, 58px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(30px, 4.2vw, 54px);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1.12;
  letter-spacing: 0;
}

.lead {
  max-width: 700px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(18px, 1.8vw, 21px);
}

.hero-list {
  display: grid;
  max-width: 840px;
  gap: 12px;
  margin: 0 0 34px;
  padding-left: 22px;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
}

.hero-list li {
  padding-left: 4px;
}

.hero-list strong {
  color: var(--ink);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover {
  box-shadow: 0 14px 34px rgba(45, 48, 44, 0.12);
  transform: translateY(-2px);
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffaf1;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.56);
}

.hero-proof,
.principles article,
.portfolio-card,
details,
.contact-section,
.case-note,
.case-fact,
.case-toc {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-proof {
  padding: 18px;
}

.proof-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.proof-row span {
  color: var(--muted);
  font-weight: 700;
}

.proof-row strong {
  color: var(--red);
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1;
}

.hero-proof p {
  margin: 18px 0 0;
  color: var(--muted);
}

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

.principles article {
  min-height: 252px;
  padding: 28px;
}

.principles span {
  display: block;
  margin-bottom: 38px;
  color: var(--red);
  font-weight: 800;
}

.principles h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

.principles p,
.section-heading p,
.portfolio-card p,
.details-body,
.contact-section {
  color: var(--muted);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 34px;
}

.case-carousel {
  position: relative;
  margin: 0 -54px;
  padding: 0 54px;
}

.case-viewport {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.case-list {
  display: flex;
  align-items: stretch;
  gap: 18px;
  will-change: transform;
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.case-list.no-transition {
  transition: none;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc((100% - 36px) / 3);
  gap: 0;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
  color: inherit;
  scroll-snap-align: start;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.portfolio-card:hover {
  box-shadow: 0 24px 74px rgba(58, 62, 58, 0.18);
  transform: translateY(-4px);
}

.portfolio-card img {
  width: 100%;
  height: 188px;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius);
  background: var(--ink);
}

.portfolio-card.large-card {
  flex-direction: column;
}

.portfolio-card-copy {
  padding: 14px 8px 8px;
}

.portfolio-card .case-type {
  display: flex;
  align-items: flex-start;
  min-height: 42px;
  margin-bottom: 12px;
}

.portfolio-card-copy h3 {
  font-size: clamp(20px, 1.55vw, 24px);
}

.portfolio-card-copy p {
  font-size: 14px;
}

.card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(221, 216, 204, 0.88);
  border-radius: 999px;
  background: rgba(250, 248, 242, 0.92);
  box-shadow: 0 22px 54px rgba(58, 62, 58, 0.2);
  color: var(--ink);
  cursor: pointer;
  line-height: 0;
  transform: translateY(-50%);
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.carousel-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.carousel-button:hover {
  background: var(--ink);
  box-shadow: 0 28px 64px rgba(58, 62, 58, 0.24);
  color: var(--paper);
  transform: translateY(-50%) scale(1.04);
}

.carousel-button:focus-visible {
  outline: 3px solid rgba(33, 128, 112, 0.22);
  outline-offset: 4px;
}

.carousel-button-prev {
  left: 14px;
}

.carousel-button-next {
  right: 14px;
}

.card-metrics span,
.skill-cloud span,
.case-meta span,
.result-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.card-metrics span {
  min-height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: start;
}

.sticky-copy {
  position: sticky;
  top: 112px;
}

.accordion-list {
  display: grid;
  gap: 12px;
}

details {
  padding: 0 22px;
}

summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary span {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
}

summary small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.details-body {
  padding: 0 0 24px;
}

.details-body p {
  margin-bottom: 14px;
}

.details-body ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.skill-section {
  display: grid;
  gap: 0;
  padding-bottom: 0;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.compact details {
  align-self: start;
}

.education-section {
  padding-top: clamp(58px, 7vw, 92px);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 36px;
  margin-top: clamp(22px, 3vw, 38px);
  padding: clamp(28px, 5vw, 54px);
}

.details-body a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-section h2 {
  margin-bottom: 0;
}

.contact-links {
  display: grid;
  align-content: center;
  gap: 10px;
}

.contact-links a {
  display: flex;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 42px 0 36px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.case-page main {
  width: min(1040px, calc(100% - 40px));
}

.case-header {
  padding: clamp(124px, 16vw, 178px) 0 48px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 44px;
  color: var(--muted);
  font-weight: 800;
}

.case-header h1 {
  max-width: 940px;
  margin-bottom: 22px;
}

.case-lead {
  max-width: 780px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.case-cover {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink);
  box-shadow: var(--shadow);
}

.case-cover img {
  width: 100%;
}

.case-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.24fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 78px);
  align-items: start;
  padding-top: var(--section);
}

.case-toc {
  position: sticky;
  top: 112px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.case-toc a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.case-article {
  display: grid;
  gap: 46px;
}

.case-block {
  scroll-margin-top: 98px;
}

.case-block h2 {
  margin-bottom: 18px;
}

.case-block h3 {
  margin: 26px 0 10px;
  font-size: 24px;
}

.case-block p,
.case-block li {
  color: var(--muted);
}

.case-block ul,
.case-block ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.case-note,
.case-fact {
  padding: 24px;
}

.case-note strong,
.case-fact strong {
  color: var(--ink);
}

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

.case-fact strong {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 34px;
  line-height: 1;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.case-image {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.case-image img {
  width: 100%;
  cursor: zoom-in;
}

.case-image figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
}

.wide-image {
  grid-column: 1 / -1;
}

.case-video {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
}

.case-video video {
  width: 100%;
}

.notion-content {
  display: grid;
  min-width: 0;
  max-width: 880px;
  margin: 0 auto;
  gap: 18px;
  padding-bottom: 24px;
}

.notion-content h2 {
  margin: 58px 0 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.notion-content h3 {
  margin: 36px 0 4px;
  font-size: clamp(22px, 2.4vw, 30px);
}

.notion-content p,
.notion-content li,
.notion-content blockquote {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.notion-content p {
  margin-bottom: 0;
}

.notion-content a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.notion-content ul,
.notion-content ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 24px;
}

.notion-content hr {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--line);
}

.notion-content blockquote {
  margin: 0;
  padding: 18px 22px;
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.notion-aside {
  display: grid;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 12px 38px rgba(38, 43, 39, 0.08);
}

.notion-aside p:first-child {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.notion-content .case-image {
  margin: 14px 0 4px;
  box-shadow: 0 16px 46px rgba(38, 43, 39, 0.09);
}

.notion-content .case-image img {
  width: 100%;
}

.notion-content .case-video figcaption {
  padding: 12px 14px;
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  font-size: 14px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 18, 17, 0.82);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-height: 92vh;
  width: auto;
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.lightbox button {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .floating-header {
    top: 10px;
    width: min(calc(100% - 16px), 560px);
    border-radius: 28px;
  }

  .nav-links a {
    padding: 13px 8px;
    font-size: 13px;
  }

  main,
  footer,
  .case-page main {
    width: min(100% - 28px, 720px);
  }

  .hero,
  .split-section,
  .contact-section,
  .portfolio-card,
  .portfolio-card.large-card,
  .case-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .case-carousel {
    margin: 0 -18px;
    padding: 0 48px;
  }

  .portfolio-card {
    flex-basis: calc((100% - 18px) / 2);
  }

  .principles,
  .compact,
  .result-grid,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .sticky-copy,
  .case-toc {
    position: static;
  }

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

@media (max-width: 560px) {
  :root {
    --section: 64px;
  }

  body {
    font-size: 15px;
  }

  .floating-header {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .nav-links {
    min-width: 438px;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 30px;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .case-carousel {
    margin: 0 -14px;
    padding: 0 42px;
  }

  .principles article,
  .portfolio-card {
    min-height: auto;
  }

  .portfolio-card {
    flex-basis: 100%;
  }

  .portfolio-card img {
    height: 172px;
    min-height: 0;
  }

  .carousel-button {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .carousel-button-prev {
    left: 2px;
  }

  .carousel-button-next {
    right: 2px;
  }

  summary {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 0;
  }

  summary small {
    text-align: left;
  }
}
