:root {
  --blue: #0A6E93;
  --orange: #E8772E;
  --azure: #3FB0DC;
  --code-blue: #5EC4E8;
  --ink: #0B1215;
  --muted: #5B6870;
  --body: #3F4C53;
  --line: #E4E8EA;
  --hero-bg: #F5F8F9;
  --teal: #0B3140;
  --teal-deep: #082733;
  --teal-line: #17475A;
  --teal-muted: #9DB2BA;

  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
a:hover { color: var(--blue); }

.accent { color: var(--orange); }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* header */

.site-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__word {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ink);
  /* centre the lowercase letters, not the ascenders, on the mark */
  transform: translateY(-3px);
}

.site-nav {
  display: flex;
  gap: clamp(12px, 3.5vw, 24px);
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}

.site-nav a {
  padding: 14px 0;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover { color: var(--blue); }

/* keep the logo and the links on one row on phones */
@media (max-width: 420px) {
  .site-header__inner { padding-left: 20px; padding-right: 20px; }
  .site-nav { font-size: 12px; }
}

@media (max-width: 370px) {
  .site-nav .slash { display: none; }
}

@media (max-width: 340px) {
  .site-header__inner { gap: 12px; }
  .brand { gap: 8px; }
  .brand__mark { width: 24px; height: 24px; }
  .brand__word { font-size: 21px; }
}

/* hero */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  border-bottom: 1px solid var(--line);
}

.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero__inner {
  position: relative;
  padding-top: 104px;
  /* keep the content above the water, which grows with the viewport width */
  padding-bottom: max(220px, calc(13.4vw + 48px));
}

.entry { max-width: 540px; }

.entry__label {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.entry__word {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(72px, 11vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.entry__say {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  font-size: 18px;
  color: var(--muted);
}

.entry__respell {
  color: var(--ink);
  font-weight: 500;
}

.entry__pos {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
}

.entry__senses {
  margin: 32px 0 0;
  padding: 0 0 0 24px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 300;
}

.entry__senses li { padding-left: 4px; }

.entry__senses em {
  font-family: var(--serif);
  font-size: 19px;
}

/* buttons */

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

.entry .actions { margin-top: 40px; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
  background: var(--orange);
  color: var(--ink);
  font-weight: 600;
}

.btn--primary:hover {
  background: #F08A3E;
  color: var(--ink);
}

.btn--ghost {
  background: #FFFFFF;
  border: 1px solid #C9D3D7;
  color: var(--ink);
}

.btn--ghost:hover { border-color: var(--blue); }

.btn--outline-light {
  border: 1px solid #2E5B6B;
  color: #FFFFFF;
}

.btn--outline-light:hover {
  border-color: var(--code-blue);
  color: #FFFFFF;
}

/* sections */

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--blue);
}

.eyebrow--light { color: var(--code-blue); }

.section-title {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 48px);
  line-height: 1.1;
}

.section-title--light {
  color: #FFFFFF;
  font-size: clamp(36px, 5vw, 56px);
}

.body-text {
  margin: 16px 0 0;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--body);
}

.section-title + .body-text { margin-top: 24px; }

/* about */

.about__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 40px 56px;
  align-items: start;
  padding-top: 96px;
  padding-bottom: 96px;
}

.code {
  margin: 0;
  min-width: 0;
  background: var(--teal);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(11, 49, 64, 0.5);
}

.code__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--teal-line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal-muted);
}

.code__body {
  margin: 0;
  padding: 24px 20px 28px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.8;
  color: #E6EDF0;
}

.c-comment { color: var(--teal-muted); }
.c-key { color: var(--code-blue); }
.c-str { color: var(--orange); }

/* projects */

.projects {
  background: var(--hero-bg);
  border-top: 1px solid var(--line);
}

.projects__inner {
  padding-top: 96px;
  padding-bottom: 96px;
}

.project-list {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}

.project-list li { border-bottom: 1px solid var(--line); }

.project {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 40px;
  padding: 32px 0;
  color: var(--ink);
  text-decoration: none;
}

.project:hover { color: var(--ink); }
.project:hover .project__name { color: var(--blue); }

.project__meta {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.project__num { color: var(--blue); }

.project__body {
  flex: 999 1 420px;
  min-width: 0;
}

.project__name {
  display: block;
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1.1;
  transition: color 0.15s ease;
}

.project__text {
  display: block;
  margin-top: 10px;
  max-width: 560px;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--body);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
}

.tags span {
  padding: 4px 10px;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid var(--line);
}

.project__link {
  flex: 1 0 auto;
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--blue);
}

.project--next {
  padding: 28px 0;
  font-family: var(--mono);
  font-size: 13px;
  color: #8C979E;
}

.project--next .project__meta { color: inherit; }

/* contact */

.contact {
  background: var(--teal);
  color: #E6EDF0;
}

/* heading on top; the intro and the link list start on the same line below it */
.contact__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "body" "list";
  gap: 24px 72px;
  padding-top: 112px;
  padding-bottom: 112px;
}

.contact__head { grid-area: head; }
.contact__body { grid-area: body; }
.contact-list { grid-area: list; }

@media (min-width: 760px) {
  .contact__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "head head" "body list";
    align-items: start;
  }
}

.contact__intro {
  margin: 0;
  max-width: 420px;
  font-size: 17px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--teal-muted);
}

.contact__email {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 36px);
  color: #FFFFFF;
  text-decoration: none;
  border-bottom: 1.5px solid var(--orange);
  padding-bottom: 2px;
  overflow-wrap: anywhere;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.contact__email:hover {
  color: #FFFFFF;
  border-color: var(--code-blue);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--teal-line);
}

.contact-list li { border-bottom: 1px solid var(--teal-line); }

.contact-list a,
.contact-list__row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 16px 2px;
  color: #FFFFFF;
  text-decoration: none;
}

.contact-list__key {
  flex: 0 0 84px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal-muted);
}

.contact-list__value {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.contact-list__arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--code-blue);
  transition: transform 0.15s ease;
}

.contact-list a:hover { color: #FFFFFF; }
.contact-list a:hover .contact-list__value { color: var(--code-blue); }
.contact-list a:hover .contact-list__arrow { transform: translateX(3px); }

/* footer */

.site-footer {
  background: var(--teal-deep);
  border-top: 1px solid var(--teal-line);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal-muted);
}

/* scene animation */

.wave { animation: wave 6s ease-in-out infinite; }

.fish {
  transform-box: fill-box;
  transform-origin: center;
  fill: #A7B3B9;
  stroke: var(--orange);
  stroke-width: 7;
  stroke-opacity: 0;
}

.fish.is-lit { animation: glint 2.6s ease-in-out; }

.drift { animation: drift0 12s ease-in-out infinite; }
.drift--1 { animation-name: drift1; }
.drift--2 { animation-name: drift2; }

@keyframes wave {
  0%, 100% { transform: translate(-7px, 0); }
  50% { transform: translate(7px, 2px); }
}

@keyframes glint {
  0%, 100% { fill: #A7B3B9; stroke-opacity: 0; transform: scale(1); }
  35% { fill: var(--orange); stroke-opacity: 0.28; transform: scale(1.6); }
}

@keyframes drift0 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(7px, -5.5px); }
  66% { transform: translate(-5.5px, 4.2px); }
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-7px, -4.2px); }
  66% { transform: translate(5.5px, 7px); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(4.2px, 7.5px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wave,
  .fish,
  .drift { animation: none; }
}

/* on narrow screens the bird moves to a small spot above the heading, clear of the text,
   and the water fades back so it doesn't compete with it */
@media (max-width: 760px) {
  #scene-water,
  #scene-fish { opacity: 0.45; }
  #scene-bird { transform: translate(1112px, 30px) scale(0.4); }
  .hero__inner { padding-top: 150px; }
}
