/* Clark's Island Labs — static site styles.
   System fonts only: no third-party requests, which keeps the privacy page accurate. */

:root {
  --ink: #1b2a33;
  --bg: #eef2f1;
  --muted: #465963;
  --link: #1f5f6b;
  --ochre: #b9852b;
  --band: #1b2a33;
  --band-ink: #dce4e6;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #dce4e6;
    --bg: #111a20;
    --muted: #9db0b9;
    --link: #86c5d2;
    --ochre: #d9a441;
    --band: #0a1116;
    --band-ink: #dce4e6;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 3px;
}

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

.wrap {
  width: min(100% - 2rem, 70rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

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

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  padding-block: 1.1rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}

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

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

.hero {
  margin: 0;
}

.hero img {
  width: 100%;
  height: clamp(16rem, 42vw, 34rem);
  object-fit: cover;
  object-position: 50% 52%;
}

.hero-text {
  display: grid;
  gap: 1.25rem;
  padding-block: clamp(2rem, 5vw, 3.75rem) clamp(2.5rem, 6vw, 4.5rem);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 7.2vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  max-width: 34ch;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (min-width: 860px) {
  .hero-text {
    grid-template-columns: 7fr 5fr;
    align-items: end;
    gap: 3rem;
  }
}

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

.band {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.band > .wrap {
  display: grid;
  gap: 1.5rem;
}

.band h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

@media (min-width: 860px) {
  .band > .wrap {
    grid-template-columns: 4fr 8fr;
    gap: 3rem;
  }

  .band h2 {
    position: sticky;
    top: 1.5rem;
    align-self: start;
  }
}

.prose > * {
  max-width: 60ch;
}

.prose p {
  margin: 0 0 1rem;
}

.prose h3 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.5rem;
}

.prose > h3:first-child {
  margin-top: 0;
}

.prose .intro {
  font-size: 1.2rem;
  line-height: 1.55;
}

.prose figure {
  max-width: none;
  margin: 2rem 0 0;
}

.prose figure img {
  width: 100%;
  height: auto;
}

/* Full-width photograph between sections -------------------------------- */

.dusk {
  margin: 0;
}

.dusk img {
  width: 100%;
  height: clamp(10rem, 26vw, 20rem);
  object-fit: cover;
  object-position: 50% 58%;
}

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

address {
  font-style: normal;
  margin: 0;
}

.fine {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

/* Policy and support pages --------------------------------------------- */

.doc {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3.5rem, 8vw, 7rem);
}

.doc h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.5rem);
}

.doc .updated {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.doc .prose {
  margin-top: 2.5rem;
}

.doc .prose h2 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.6rem;
}

.doc .prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.doc .prose li {
  margin-bottom: 0.4rem;
}

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

.site-foot {
  background: var(--band);
  color: var(--band-ink);
  padding-block: 2rem;
  font-size: 0.95rem;
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-foot p {
  margin: 0;
}

.site-foot ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-foot a {
  color: inherit;
}

/* Chart behind the work section ---------------------------------------- */

.chart-band {
  position: relative;
  isolation: isolate;
}

.chart-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("img/chart-bay.jpg") center / cover no-repeat;
  opacity: 0.2;
  filter: grayscale(0.7);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}

@media (max-width: 859px) {
  .chart-band::before {
    background-image: url("img/chart-bay-1000.jpg");
    opacity: 0.16;
  }
}

@media (prefers-color-scheme: dark) {
  .chart-band::before {
    opacity: 0.12;
    filter: invert(1) grayscale(1);
  }
}

.prose .credit {
  margin: 2.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Contact form and buttons --------------------------------------------- */

.action,
.contact-form button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.action:hover,
.contact-form button:hover:not(:disabled) {
  background: var(--link);
}

.contact-form button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.contact-form {
  display: grid;
  gap: 0.4rem;
  max-width: 34rem;
  margin: 1.5rem 0 3rem;
}

.contact-form[hidden],
.note[hidden] {
  display: none;
}

.contact-form label {
  margin-top: 0.8rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--muted);
  border-radius: 2px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  justify-self: start;
  margin-top: 1.2rem;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.65em;
  margin: 0.6rem 0 0;
}

.form-status[data-kind="error"] {
  color: var(--ink);
  font-weight: 600;
}

.note {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--ochre);
}
