@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* night is the default; data-theme="light" on <html> switches (see the toggle in the header) */
:root {
  --ink: #ececec;
  --muted: #a3a3a3;
  --line: #2c2c2c;
  --bg: #121212;
  --bg-alt: #1a1a1a;
  --accent: rgb(239, 34, 37);
  --measure: 720px;
  --wide: 1080px;
}
:root[data-theme="light"] {
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e4e4e4;
  --bg: #ffffff;
  --bg-alt: #f7f7f7;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: 1.5rem; margin-top: 0; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
.measure { max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* header */
header { border-bottom: 1px solid var(--line); }
header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; }
.brand img { height: 28px; width: auto; }
nav { white-space: nowrap; }
nav a { color: var(--ink); margin-left: 16px; font-weight: 600; font-size: 0.95rem; }
nav a:hover { color: var(--accent); text-decoration: none; }

/* sections */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }
.alt { background: var(--bg-alt); }

.hero {
  padding: 72px 0;
  background: var(--bg) url("images/squares-dark.svg") no-repeat right top;
  background-size: auto 100vh;
  background-attachment: fixed; /* parallax; iOS ignores fixed and falls back to scroll */
}
.hero p { font-size: 1.15rem; }
.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 700;
  margin-top: 8px;
}
.cta:hover { text-decoration: none; filter: brightness(0.9); }

/* work cards */
.cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 24px;
}
.card {
  display: block;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--bg);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.kicker {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.card h3 { margin: 6px 0; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* simple / logical / agile */
.triad {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 24px;
}
.triad h3 { margin-bottom: 4px; }
.triad p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* logos */
.logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px 40px;
  margin-top: 16px;
}
.logos img { height: 36px; width: auto; filter: grayscale(1); opacity: 0.7; }
.logos img:hover { filter: none; opacity: 1; }

/* team */
.team {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 24px;
}
.member img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  background: #aeaaab; /* matches the portrait backgrounds */
  display: block;
  margin-bottom: 12px;
}
.member h3 { margin-bottom: 2px; }
.member .role { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }

/* case study page */
.case h1 { margin-bottom: 0.2em; }
.case .meta { color: var(--muted); margin-bottom: 2em; }
.case ul { padding-left: 1.2em; }
.case .tech {
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 2em;
}
.case figure { margin: 2em 0; }
.case figure img { max-width: 100%; height: auto; border-radius: 8px; }
.case figcaption { font-size: 0.85rem; color: var(--muted); }
.back { display: inline-block; margin-bottom: 24px; font-weight: 600; }

/* content still to be filled in by the team */
.gap { background: #fff3cd; padding: 0 4px; }

footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  font-size: 0.9rem;
  color: var(--muted);
}

@media print {
  header, footer, .back, .cta { display: none; }
  .gap { background: none; }
}

/* phones: the squares would sit behind the text */
@media (max-width: 900px) {
  .hero { background-image: none; }
}

/* night (default) image treatments */
.brand img { filter: invert(1) hue-rotate(180deg); } /* ink to light, red stays red */
.logos img { filter: grayscale(1) invert(1); }
.logos img:hover { filter: invert(1); }
.gap { color: #1a1a1a; }

/* light theme */
:root[data-theme="light"] .hero { background-image: url("images/squares.svg"); }
:root[data-theme="light"] .brand img { filter: none; }
:root[data-theme="light"] .logos img { filter: grayscale(1); }
:root[data-theme="light"] .logos img:hover { filter: none; }
@media (max-width: 900px) {
  :root[data-theme="light"] .hero { background-image: none; }
}

/* theme toggle: sun shown in night mode, moon in light mode */
.theme {
  background: none;
  border: 0;
  padding: 4px;
  margin-right: 8px;
  cursor: pointer;
  color: var(--ink);
  vertical-align: middle;
  line-height: 0;
}
.theme:hover { color: var(--accent); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme .moon { display: none; }
:root[data-theme="light"] .theme .sun { display: none; }
:root[data-theme="light"] .theme .moon { display: inline; }
