/* Pride Sibanda: portfolio styles.
   Strictly monochrome. Edit the colour tokens below to adjust the greys. */

:root {
  --bg: #fafafa;
  --fg: #111111;
  --soft: #454545;
  --muted: #666666;
  --rule: #dcdcdc;
  --line: #a8a8a8;
  --tint: #f0f0f0;
  color-scheme: light;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d;
    --fg: #ececec;
    --soft: #c2c2c2;
    --muted: #9a9a9a;
    --rule: #2a2a2a;
    --line: #5c5c5c;
    --tint: #161616;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --fg: #ececec;
  --soft: #c2c2c2;
  --muted: #9a9a9a;
  --rule: #2a2a2a;
  --line: #5c5c5c;
  --tint: #161616;
  color-scheme: dark;
}

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

html {
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.wrap {
  width: min(880px, 100% - 48px);
  margin: 0 auto;
}

/* ---------- Links ---------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  text-underline-offset: 0.26em;
}

a:hover {
  text-decoration-color: var(--fg);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 22px;
  padding-bottom: 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.site-nav a {
  display: inline-block;
  color: var(--soft);
  text-decoration: none;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--fg);
  border-bottom-color: var(--line);
}

.site-nav a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

/* ---------- Theme button (moon in light, sun in dark) ---------- */

.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 -6px 0 -8px;
  padding: 0;
  color: var(--soft);
  background: none;
  border: 0;
  cursor: pointer;
}

.theme-btn:hover {
  color: var(--fg);
}

.theme-btn[hidden] {
  display: none;
}

.theme-btn .i-sun {
  display: none;
}

:root[data-theme="dark"] .theme-btn .i-moon {
  display: none;
}

:root[data-theme="dark"] .theme-btn .i-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-moon {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-btn .i-sun {
    display: block;
  }
}

/* ---------- Main and motion ---------- */

main.wrap {
  flex: 1 0 auto;
  padding-top: 80px;
  padding-bottom: 96px;
  animation: rise 0.8s ease-out both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Gentle reveal as sections scroll into view (script.js adds .in) */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  main.wrap {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .row,
  .row::before,
  .row *,
  .site-frame,
  .email-display,
  .btn {
    transition: none !important;
  }
}

/* ---------- Type ---------- */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 400;
}

h1,
h3,
.serif {
  font-family: var(--serif);
}

h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

h1.display,
.hero h1 {
  font-size: clamp(34px, 5.4vw, 54px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 15em;
}

h1.after-label {
  margin-top: 16px;
}

p {
  margin: 0 0 1em;
}

.label,
h2.label,
h4.label {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead {
  margin: 28px 0 0;
  max-width: 34em;
  font-size: 17px;
  line-height: 1.6;
  color: var(--soft);
}

.page-intro {
  margin: 18px 0 0;
  max-width: 36em;
  font-size: 16px;
  color: var(--soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

/* ---------- Sections ---------- */

.section {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.split {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  column-gap: 40px;
}

.split > .label {
  padding-top: 3px;
}

.section-body > *:last-child {
  margin-bottom: 0;
}

.section-note {
  max-width: 36em;
  margin: 0 0 20px;
  color: var(--soft);
}

/* ---------- Hero strip ---------- */

.strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 56px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.strip > div {
  padding: 18px 20px 20px 0;
}

.strip > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--rule);
}

.strip dt {
  margin-bottom: 6px;
}

.strip dd {
  margin: 0;
  color: var(--soft);
}

/* ---------- Three-up (what I do) ---------- */

.threeup {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.threeup h3 {
  margin: 6px 0 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.threeup p {
  margin: 0;
  color: var(--soft);
}

/* ---------- Plain rows ---------- */

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

.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
  align-items: baseline;
  isolation: isolate;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  transition: color 0.25s ease;
}

.row::before {
  content: "";
  position: absolute;
  inset: 0 -16px;
  z-index: -1;
  background: var(--fg);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.row:first-child {
  border-top: 0;
}

.row-title {
  display: flex;
  align-items: baseline;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.row .num {
  flex: 0 0 44px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.row-title a {
  text-decoration: none;
}

.row-status {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.row-desc {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--soft);
  max-width: 38em;
}

.row.numbered .row-desc {
  padding-left: 44px;
}

/* Whole row is the link; it inverts on hover */
.row.is-link .stretch::after {
  content: "";
  position: absolute;
  inset: 0;
}

.row.is-link:hover {
  color: var(--bg);
}

.row.is-link:hover::before {
  opacity: 1;
}

.row.is-link:hover .num,
.row.is-link:hover .row-status,
.row.is-link:hover .row-desc {
  color: inherit;
}

.stretch:focus-visible {
  outline: none;
}

.stretch:focus-visible::after {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* ---------- Live site previews (greyscale) ---------- */

.sites {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site {
  position: relative;
}

.sites.single {
  grid-template-columns: minmax(0, 1fr);
}

.site-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--tint);
  border: 1px solid var(--rule);
  transition: border-color 0.25s ease;
}

.site-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 333.34%;
  height: 333.34%;
  border: 0;
  transform: scale(0.3);
  transform-origin: 0 0;
  pointer-events: none;
}

.site:hover .site-frame {
  border-color: var(--fg);
}

.site-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
}

.site-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
}

.site-name a {
  text-decoration: none;
}

.site-name a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.site:hover .site-name a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.site-name a:focus-visible {
  outline: none;
}

.site-name a:focus-visible::after {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* ---------- Work: case studies ---------- */

.cases-title {
  margin: 96px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.case {
  padding: 40px 0 48px;
  border-top: 1px solid var(--rule);
}

.cases-title + .case {
  border-top: 0;
  padding-top: 24px;
}

.case-head {
  align-self: start;
  position: sticky;
  top: 100px;
}

.case-head h3 {
  margin: 6px 0 12px;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

.case-head p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.case-head .row-status {
  display: inline-block;
  margin-bottom: 10px;
}

.case-head .visit {
  margin-top: 10px;
  font-size: 14px;
  color: var(--fg);
}

.case-block {
  margin-bottom: 30px;
}

.case-block:last-child {
  margin-bottom: 0;
}

.case-block .label {
  margin-bottom: 8px;
}

.case-block p {
  max-width: 36em;
  margin: 0 0 0.8em;
}

.case-block p:last-child {
  margin-bottom: 0;
}

.case-block ul {
  max-width: 36em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-block li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}

.case-block li:first-child {
  border-top: 0;
  padding-top: 0;
}

.case-block li strong {
  display: block;
  font-weight: 500;
}

.stack {
  margin: 0;
  max-width: 36em;
}

.stack > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  column-gap: 16px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
}

.stack > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.stack dd {
  margin: 0;
  color: var(--soft);
}

.sm-stack {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Label / value rows (about, contact) ---------- */

.facts {
  margin: 0;
}

.fact {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  column-gap: 40px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}

.fact:first-child {
  border-top: 0;
  padding-top: 0;
}

.fact dt {
  padding-top: 0;
}

.fact dd {
  margin: 0;
  color: var(--soft);
}

.fact dd p {
  margin: 0;
}

.fact dd > p + p {
  margin-top: 0.8em;
}

.fact dd .sub {
  display: block;
  color: var(--muted);
}

.fact dd strong {
  font-weight: 500;
  color: var(--fg);
}

.section.plain {
  display: block;
}

.section.plain > .label {
  margin-bottom: 20px;
}

.brief {
  max-width: 36em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief li {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
}

.brief li:first-child {
  border-top: 0;
  padding-top: 0;
}

.brief .num {
  flex: 0 0 28px;
  padding-top: 3px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.brief strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.tools dd {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--fg);
}

.tools dd span + span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.8em;
  margin: 0 0.7em;
  background: var(--line);
}

.bio-lead {
  max-width: 24em;
  margin: 28px 0 0;
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.bio {
  max-width: 36em;
  margin-top: 28px;
}

.bio p:last-child {
  margin-bottom: 0;
}

/* ---------- Contact ---------- */

.email-display {
  display: inline-block;
  margin: 40px 0 0;
  font-family: var(--serif);
  font-size: clamp(24px, 5.4vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  user-select: all;
  -webkit-user-select: all;
  word-break: break-all;
  border-bottom: 1px solid var(--line);
  cursor: copy;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.email-display:hover {
  background: var(--fg);
  color: var(--bg);
}

.email-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 18px;
}

.btn {
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 0;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn[hidden],
.link-btn[hidden] {
  display: none;
}

.copy-status {
  font-size: 13px;
  color: var(--muted);
}

.elsewhere .row-title {
  font-size: 24px;
}

/* ---------- Closing call to action ---------- */

.closer {
  margin-top: 96px;
  padding-top: 40px;
  border-top: 1px solid var(--rule);
}

.closer p.big {
  max-width: 14em;
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-bottom: 44px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer .wrap {
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
}

.site-footer p {
  margin: 0;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a,
.link-btn {
  color: var(--soft);
}

.link-btn {
  font: inherit;
  background: none;
  border: 0;
  padding: 5px 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  text-underline-offset: 0.26em;
}

.link-btn:hover {
  text-decoration-color: var(--fg);
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .split {
    grid-template-columns: 1fr;
  }

  .split > .label {
    margin-bottom: 14px;
  }

  .case-head {
    position: static;
    margin-bottom: 24px;
  }

  .fact {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .threeup {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .strip > div,
  .strip > div + div {
    padding: 14px 0;
    border-left: 0;
  }

  .strip > div + div {
    border-top: 1px solid var(--rule);
  }

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

@media (max-width: 560px) {
  .wrap {
    width: calc(100% - 40px);
  }

  .site-header {
    padding-top: 16px;
    padding-bottom: 12px;
  }

  .site-nav ul {
    gap: 22px;
  }

  main.wrap {
    padding-top: 52px;
    padding-bottom: 64px;
  }

  .section,
  .cases-title,
  .closer {
    margin-top: 64px;
  }

  .row {
    padding: 16px 0;
  }

  .row::before {
    inset: 0 -12px;
  }

  .row-title {
    font-size: 18px;
  }

  .row .num {
    flex-basis: 36px;
  }

  .row.numbered .row-desc {
    padding-left: 36px;
  }

  .stack > div {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }
}

/* ---------- Print ---------- */

@media print {
  :root {
    --bg: #ffffff;
    --fg: #000000;
    --soft: #222222;
    --muted: #444444;
  }

  .skip,
  .site-nav,
  .site-footer ul,
  .site-frame {
    display: none;
  }

  main.wrap {
    animation: none;
    padding-top: 24px;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .case-head {
    position: static;
  }
}
