/* ---------------------------------------------------------------------------
   martincol.com
   ---------------------------------------------------------------------------
   One stylesheet for all six pages. The palette comes out of the logo: ink
   blue for the words, one red dot. Everything else is paper.

   The illustration on the home page is an old-fashioned pen drawing, so the
   type pairs an antique-flavoured serif (Fraunces) for headings with a plain
   modern sans (Inter) for everything that has to be read quickly. The
   contrast is deliberate: the drawing supplies the charm, the typography
   stays out of its way.
--------------------------------------------------------------------------- */

:root {
  --blue:   #1B3C6E;
  --blue-d: #132B4F;
  --red:    #D1382A;
  --ink:    #2A3542;
  --muted:  #6E6757;
  --paper:  #FAF6EC;
  --card:   #FFFFFF;
  --rule:   #DCD2BC;

  --serif: "Fraunces", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 64ch;
  --shadow: 0 10px 26px rgba(27, 60, 110, .13);
}

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

/* A permanent scrollbar gutter. Without it the centred header jumps
   sideways between a page that scrolls and one that does not; the width of a
   scrollbar is enough to see. `scrollbar-gutter: stable` alone does not fix
   it, this does. */
html {
  overflow-y: scroll;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

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

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Said to a screen reader, not shown: "(opens in a new tab)". */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 24px;
  top: 12px;
  z-index: 10;
  background: var(--card);
  padding: .6rem 1rem;
  border: 1px solid var(--blue);
}

/* --- logo ---------------------------------------------------------------- */

.logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--blue);
  letter-spacing: -.015em;
  text-decoration: none;
  white-space: nowrap;
}
.logo:hover { color: var(--blue); }

.logo .dot {
  width: .5em;
  height: .5em;
  margin: 0 .09em;
  border-radius: 50%;
  background: var(--red);
  /* Centres the dot on the x-height rather than the line box, which sits
     noticeably high against all-lowercase type. */
  transform: translateY(.07em);
  flex: none;
}

/* --- header -------------------------------------------------------------- */

.site-header {
  padding: 1.8rem 0 1.1rem;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-block;
  padding: .35rem 0;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--blue); border-bottom-color: var(--red); }
.nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--red); }

/* An engraver's double rule: one hairline, one heavier. */
.rule {
  border: 0;
  height: 3px;
  margin: 0;
  background:
    linear-gradient(var(--blue), var(--blue)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 0 100% / 100% 1px no-repeat;
}

/* --- page furniture ------------------------------------------------------ */

main { display: block; }

/* Vertical padding only. These classes sit on the SAME element as .wrap, so
   the padding shorthand would reset .wrap's 24px side gutters to zero and the
   text would run to the edge of a phone screen. */
.section { padding-top: 3.4rem; padding-bottom: 1rem; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--blue);
  line-height: 1.18;
  margin: 0 0 .6rem;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); margin-top: 2.6rem; }
h3 { font-size: 1.14rem; }

p { margin: 0 0 1.1rem; }

.lead {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.45;
}

.prose { max-width: var(--measure); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }

.eyebrow {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

/* --- about --------------------------------------------------------------- */

/* The portrait is low-key black and white, so on this pale paper it reads as
   a dark block rather than a picture with a background. (A 3:4 color photo
   held this slot for one day, 2026-11-27, and was reverted on 2026-11-28 --
   see the About page comments.) Everything below the intro returns to the
   normal 64ch measure, so the photograph is the only thing that breaks the
   text column.

   The picture is on the RIGHT because the head faces left: on the right the
   subject looks into the page and across his own words, where on the left he
   looks out past the edge of the screen and takes the reader with him. That
   is the whole reason for the arrangement, so do not flip it back for
   symmetry with the other pages.

   The greeting is only a few lines against a 4:5 portrait, so it is centred
   on the picture rather than hung from its top edge: aligned to the top it
   leaves the whole lower half of the photograph facing dead space, which
   reads as a mistake. Centred, the air sits above and below the text. */
/* The whole block is held to 695px rather than the full 992px of the wrapper.
   At full width the photograph sat hard against the right edge of the page
   while the body text below it stopped at 64ch, so the picture stood outside
   the column everything else was built on and read as a stray element rather
   than part of the page.

   695px is not a round number, it is a MEASURED one: it puts the right edge
   of the photograph exactly on the right edge of the final "e" of "else" in
   the headline above (2026-11-27, his instruction). That only holds while the
   headline is at its full 2.9rem, which is from about 1009px of viewport up --
   below that the h1 is still on the 4.6vw ramp and shrinks away from the
   picture, and below about 808px the headline wraps and there is nothing to
   align to. So this is a wide-screen alignment, deliberately, and the earlier
   760px reasoning still covers everything narrower.

   The 65px came out of the GAP and the PHOTOGRAPH, a bit of each at his
   instruction, and deliberately NOT out of the greeting: the picture goes
   from 360px to 310px and the gap from 2.4rem to 1.5rem, which leaves the
   text column at the ~361px it already had, so the greeting sets to the same
   measure it did before. Taking it all from the gap was not possible -- the
   gap only had 38px in it against the 65px needed. */
.intro {
  display: grid;
  /* The picture column scales rather than sitting at a fixed 360px: held
     fixed, it eats the text column between 720px and 900px and squeezes the
     flush-right setting down to about 25 characters a line, which is too
     thin to read comfortably. */
  grid-template-columns: minmax(0, 1fr) clamp(240px, 34vw, 310px);
  align-items: center;
  gap: 1.5rem;
  max-width: 695px;
  margin: 1.8rem 0 .6rem;
}

/* The figure stays FIRST in the markup so that it still comes first when the
   grid collapses on a phone; these two properties do the swap on wide
   screens only. */
.portrait {
  margin: 0;
  grid-column: 2;
  grid-row: 1;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: var(--shadow);
}

/* Set flush right, so the text has a hard edge facing the photograph and the
   two meet on one line down the middle of the block. No character cap is
   needed now: the larger picture leaves the text roughly 420px, which breaks
   it into short lines on its own. That matters because ragged-left setting
   costs the reader the start of every line, a fair price over short lines of
   display type and a bad one over long ones. */
.intro .lead {
  margin: 0 0 0 auto;
  grid-column: 1;
  grid-row: 1;
  text-align: right;
}

/* The greeting takes its own line, and is the only blue in the block. */
.intro .hi {
  display: block;
  color: var(--blue);
  margin-bottom: .55rem;
}

/* --- home ---------------------------------------------------------------- */

.hero {
  padding-top: 3rem;
  padding-bottom: 1rem;
  text-align: center;
}

.hero h1 {
  max-width: 24ch;
  margin: 0 auto .9rem;
}

.hero .lead {
  max-width: 34ch;
  margin: 0 auto;
  color: var(--muted);
}

/* Keeps the hidden filter definition out of the layout entirely. */
.filters { position: absolute; width: 0; height: 0; overflow: hidden; }

.drawing {
  max-width: 940px;
  margin: 2.4rem auto .4rem;
}
.drawing img {
  display: block;
  width: 100%;
  height: auto;
  /* Maps the drawing's black-on-white onto blue-on-paper. See the note
     beside the filter in index.html. */
  filter: url(#ink-tint);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem 1.4rem;
  margin: 2.4rem 0 0;
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: .72rem 1.5rem;
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: var(--paper);
  cursor: pointer;
}
.btn:hover { background: var(--blue-d); border-color: var(--blue-d); color: var(--paper); }

.btn--ghost { background: transparent; color: var(--blue); }
.btn--ghost:hover { background: var(--blue); color: var(--paper); }

/* --- gallery of thumbnails ---------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 2rem;
  margin: 2.4rem 0 0;
  padding: 0;
  list-style: none;
}

.card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--rule);
}

.card > a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card > a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--blue); }

.card img {
  display: block;
  width: 100%;
  /* height:auto is load-bearing. The img carries width/height attributes, so
     without it the attribute height wins as a presentational hint, both axes
     are definite, and aspect-ratio below is ignored entirely. */
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-bottom: 1px solid var(--rule);
  background: #f2efe6;
}

.card .meta { padding: 1.05rem 1.2rem 1.25rem; }

.card h3 { margin: 0 0 .15rem; }
.card > a:hover h3 { color: var(--red); }

.card .domain {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .55rem;
}

.card p {
  margin: 0;
  font-size: .93rem;
  line-height: 1.55;
  color: var(--ink);
}

/* --- contact form ------------------------------------------------------- */

.form {
  max-width: 34rem;
  margin: 2.2rem 0 0;
}

.field { margin-bottom: 1.3rem; }

.field label {
  display: block;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

.field input,
.field textarea {
  width: 100%;
  padding: .7rem .8rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 0;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(27, 60, 110, .18);
  outline-offset: 0;
}
.field textarea { min-height: 9.5rem; resize: vertical; }

.field .hint { font-size: .82rem; color: var(--muted); margin: .35rem 0 0; }

/* The honeypot. A real field, kept off screen and out of the tab order, so
   only an automated filler completes it. Not display:none, which some bots
   skip on purpose. */
.trap {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  max-width: var(--measure);
  padding: 1.1rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--blue);
}
.notice--error { border-left-color: var(--red); }
.notice h1 { margin-top: 0; }
.notice ul { margin: 0 0 1rem; padding-left: 1.2rem; }

/* --- footer -------------------------------------------------------------- */

.site-footer {
  margin-top: 4.5rem;
  padding: 1.6rem 0 2.6rem;
  border-top: 1px solid var(--rule);
  font-size: .86rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem 2rem;
}

.site-footer .logo { font-size: 1.05rem; }

/* --- small screens ------------------------------------------------------ */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-header { padding-top: 1.2rem; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: .9rem; }
  .nav { gap: 0 1.2rem; }
  .hero { padding-top: 1.6rem; text-align: left; }
  .hero h1, .hero .lead { margin-left: 0; margin-right: 0; }
  .hero-links { justify-content: flex-start; }
  .section { padding-top: 2.2rem; }
  .gallery { gap: 1.5rem; }
  /* The portrait stacks above the greeting and stops short of the full
     width: at 100% a head fills a phone screen from edge to edge. The
     explicit grid placement and the flush-right setting are both undone
     here: stacked, there is no photograph for the text to face, and ragged
     left over a narrow column is simply harder to read for nothing. */
  .intro { grid-template-columns: 1fr; gap: 1.4rem; }
  .portrait { max-width: 230px; grid-column: auto; grid-row: auto; }
  .intro .lead {
    grid-column: auto;
    grid-row: auto;
    max-width: none;
    margin-left: 0;
    text-align: left;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .card > a { transition: none; }
  .card > a:hover { transform: none; }
}
