/* Layout: blush hero band, cream cards on warm paper, teal headers for case studies, floral "Connect" footer. */
:root {
  --teal: #10566b;
  --teal-deep: #0b3f4f;
  --blush: #e6c8bc;
  --blush-soft: #f2e2db;
  --cream: #f6f0e6;
  --paper: #fdfbf8;
  --ink: #23343a;
  --muted: #56666c;
  --line: #ddd2c4;
  --white: #ffffff;
  --display: "Gilda Display", "Iowan Old Style", Georgia, serif;
  --body: "Jost", "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 350;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--teal); line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 860px; }

.eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}

/* Top bar */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-size: 1.35rem; color: var(--teal); text-decoration: none; }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none; color: var(--ink); font-weight: 450; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--teal); }

/* Home hero */
.hero { background: var(--blush); }
.hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding-block: 36px; align-items: stretch; }
.hero-photo { border-radius: 28px; overflow: hidden; background: var(--blush-soft); min-height: 320px; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero-card { background: var(--cream); border-radius: 28px; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 20px; }
.hero-card h1 { font-size: clamp(3rem, 7vw, 5.25rem); }
.hero-card p { max-width: 30ch; color: var(--ink); }

/* Selected work */
.section { padding-block: 64px; }
.section-head { text-align: center; display: grid; gap: 14px; justify-items: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.6rem); }
.section-head p { max-width: 62ch; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.cards.center-last { justify-content: center; }
.card {
  background: var(--cream);
  border-radius: 20px;
  padding: 14px 14px 22px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16, 86, 107, .12); }
.card-img { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--blush-soft); max-width: 100%; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-rule { height: 1px; background: var(--line); margin-inline: 10%; }
.card-title { text-align: center; color: var(--teal); font-size: 0.98rem; line-height: 1.45; padding-inline: 8px; }

.btn-row { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-top: 48px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 220px; padding: 16px 32px; border-radius: 999px;
  background: var(--teal); color: var(--white); text-decoration: none;
  font-size: 0.95rem; letter-spacing: 0.02em;
  transition: background .2s ease;
}
.btn:hover { background: var(--teal-deep); }

/* Case study */
.case-head { background: var(--teal); color: var(--white); }
.case-head .wrap { padding-block: 56px; display: grid; gap: 20px; justify-items: center; text-align: center; }
.case-head h1 { color: var(--white); font-size: clamp(2rem, 4.4vw, 3.1rem); max-width: 22ch; }
.case-head p { max-width: 68ch; opacity: .95; }

.case-body { display: grid; gap: 0; }
.block { padding-block: 40px; }
.block .wrap { display: grid; gap: 14px; }
.block p + p, .block p + ul, .block ul + p { margin-top: 4px; }
.block ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.block.band { background: var(--blush); }
.panel { background: var(--cream); border-radius: 22px; padding: 32px 36px; display: grid; gap: 14px; }

.skills { text-align: center; }
.skills ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.skills li { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 16px; font-size: 0.92rem; }

.more h2 { text-align: center; font-size: clamp(1.9rem, 4vw, 2.4rem); margin-bottom: 32px; }

/* Philosophy */
.phil-head { background: var(--blush); }
.phil-head .wrap { padding-block: 36px; }
.phil-head .panel { text-align: center; justify-items: center; gap: 16px; padding: 44px 40px; }
.phil-head h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.phil-head .panel > p:last-child { text-align: left; max-width: 70ch; }
.diagram { padding-block: 48px 8px; }
.diagram img { margin-inline: auto; width: min(560px, 100%); }
.subhead { font-family: var(--body); font-style: italic; font-weight: 500; color: var(--ink); font-size: 1.12rem; }
.how { display: grid; gap: 28px; }
.how > div { display: grid; gap: 8px; }

/* Resume */
.resume-head { background: var(--blush); }
.resume-head .wrap { padding-block: 36px; }
.resume-head .panel { text-align: center; justify-items: center; gap: 10px; }
.resume-head h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.contact-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 0.95rem; }
.r-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; padding-block: 36px; border-bottom: 1px solid var(--line); }
.r-section:last-child { border-bottom: 0; }
.r-section > h2 { font-size: 1.85rem; }
.r-items { display: grid; gap: 26px; min-width: 0; }
.r-item { display: grid; gap: 6px; min-width: 0; }
.r-title { font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; color: var(--teal); }
.r-meta { font-size: 0.92rem; color: var(--muted); }
.r-item ul { margin: 4px 0 0; padding-left: 1.15em; display: grid; gap: 6px; font-size: 0.97rem; }
.r-nested { border-left: 2px solid var(--blush); padding-left: 22px; display: grid; gap: 22px; margin-top: 10px; }
.tools { display: grid; gap: 8px; font-size: 0.97rem; }
.tools b { font-weight: 600; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--teal); margin-right: 6px; }
.refs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; font-size: 0.95rem; }
.refs div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }

/* Footer */
.connect {
  background-color: var(--blush);
  background-image: linear-gradient(rgba(253, 251, 248, .08), rgba(253, 251, 248, .08)), var(--floral, linear-gradient(135deg, #e6c8bc, #b9cfd3));
  background-size: cover;
  background-position: center;
}
.connect .wrap { padding-block: 64px; }
.connect-card { background: var(--cream); border-radius: 26px; padding: 40px; max-width: 460px; display: grid; gap: 18px; }
.connect-card h2 { font-size: 2.2rem; color: var(--ink); }
.connect-card .who { font-weight: 600; }
.connect-card p { font-size: 0.98rem; }
.li-link { display: inline-flex; width: 30px; height: 30px; border-radius: 6px; background: var(--teal); color: var(--white); align-items: center; justify-content: center; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.legal { background: var(--paper); text-align: center; font-size: 0.82rem; color: var(--muted); padding-block: 18px; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-photo { min-height: 0; aspect-ratio: 1 / 1; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r-section { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .hero-card { padding: 36px 24px; }
  .panel { padding: 26px 22px; }
  .refs { grid-template-columns: 1fr; }
  .connect-card { padding: 30px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Centered card rows: the last row sits centered under the row above */
.cards { display: flex; flex-wrap: wrap; justify-content: center; }
.cards > .card { flex: 0 0 calc((100% - 48px) / 3); min-width: 0; }

/* Case Studies dropdown */
.nav { align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 450; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; }
.menu[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.menu summary:hover, .menu summary.is-current { color: var(--teal); }
.menu-list { position: absolute; right: 0; top: calc(100% + 12px); z-index: 20; width: min(340px, calc(100vw - 32px)); background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(16, 86, 107, .14); padding: 8px; display: grid; }
.menu-list a { text-decoration: none; color: var(--ink); font-size: 0.93rem; line-height: 1.4; padding: 10px 12px; border-radius: 10px; letter-spacing: 0; text-transform: none; font-weight: 400; }
.menu-list a:hover { background: var(--cream); color: var(--teal); }
.menu-list a[aria-current="page"] { background: var(--blush-soft); color: var(--teal); font-weight: 500; }
.menu-list .menu-all { border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; padding-top: 12px; color: var(--teal); font-weight: 500; }

/* Previous / next pager */
.pager { background: var(--cream); border-block: 1px solid var(--line); }
.pager .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding-block: 18px; }
.pager-link { display: grid; gap: 2px; text-decoration: none; color: var(--ink); min-width: 0; }
.pager-link.next { text-align: right; }
.pager-dir { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500; color: var(--teal); }
.pager-name { font-size: 0.95rem; line-height: 1.4; }
.pager-link:hover .pager-name { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.pager-count { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

@media (max-width: 860px) {
  .cards > .card { flex-basis: calc((100% - 24px) / 2); }
}
@media (max-width: 560px) {
  .cards > .card { flex-basis: 100%; }
  .pager .wrap { grid-template-columns: 1fr 1fr; }
  .pager-count { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .pager-name { display: none; }
}
@media (max-width: 560px) {
  .menu-list { right: auto; left: 0; }
}
