/* One Tenth. Two colours, two typefaces, one centred axis. */

:root {
  --paper: #f6f4f1;
  --ink: #000000;

  --display: "Antonio", "Arial Narrow", sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 34rem;   /* reading column */
  --wide: 60rem;      /* products spread and footer */
  --gutter: 24px;

  /* Ribbon: same proportions as the logo, where the corner sits about
     1.1 square-widths from the square's centre. */
  --ribbon-s: 120px;  /* logo square */
  --ribbon-c: 131px;  /* distance from the corner to the square's centre */
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

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

p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  transition: text-underline-offset 160ms ease;
}

a:hover {
  text-underline-offset: 0.42em;
}

a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 5px;
}

.display {
  font-family: var(--display);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

/* Columns stay centred on the page; text inside them reads from the left.
   Only the hero, the blog and the 404 page are centred. */
.narrow {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.centered {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.wide {
  max-width: calc(var(--wide) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Corner ribbon ---------- */

.ribbon {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: calc(var(--ribbon-c) * 2);
  height: calc(var(--ribbon-c) * 2);
  pointer-events: none;
}

/* The band runs off the top and left edges, so it reads as tied around
   the corner. Its shading is the logo's own: square rings of grey around
   the mark, drawn into ribbon-band.png in the band's frame. */
.ribbon-band {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--ribbon-s) * 3.8);
  height: calc(var(--ribbon-s) * 1.41421);
  transform: translate(-50%, -50%) rotate(-45deg);
  background: url("ribbon-band.png") center / 100% 100% no-repeat;
  animation: band-in 1100ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.ribbon-mark {
  position: absolute;
  top: calc(var(--ribbon-c) - var(--ribbon-s) / 2);
  left: calc(var(--ribbon-c) - var(--ribbon-s) / 2);
  display: block;
  width: var(--ribbon-s);
  height: var(--ribbon-s);
  background: var(--paper);
  pointer-events: auto;
}

.ribbon-mark img {
  width: 100%;
  height: 100%;
}

/* Logo lockup: the logo's own 0.1 (mark-01.png) over ONE TENTH set in the
   site's Antonio. The text is stretched to the 0.1's width, which lands its
   letter spacing close to the nav's. Units are the logo's (918 wide). */
.mark {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mark text {
  font-family: var(--display);
  font-size: 174.4px;
  font-weight: 700;
  fill: var(--ink);
}

.ribbon-mark:focus-visible {
  outline-offset: 3px;
}

@keyframes band-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-45deg) scaleX(0.3);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-45deg) scaleX(1);
  }
}

/* ---------- Navigation: the top-right corner answers the ribbon ---------- */

.site-nav {
  position: fixed;
  top: 32px;
  right: 40px;
  z-index: 20;
  display: flex;
  gap: 2.25rem;
  padding: 0.6rem 0.25rem 0.6rem 1rem;
  background: var(--paper);
}

.site-nav a {
  font-family: var(--display);
  font-size: 1.125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
}

/* ---------- Home ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(100vh, 60rem);
  min-height: min(100svh, 60rem);
  padding-block: 6rem;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(4rem, 13vw, 8.5rem);
  font-weight: 200;
  letter-spacing: 0.03em;
  line-height: 0.9;
}

.hero p {
  margin: 2.25rem 0 0;
  text-wrap: balance;
}

.section {
  padding-block: 7rem;
}

/* Page and section headings sit on the centre line; the text under them
   reads from the left. */
.section-title {
  margin: 0 0 2.5rem;
  font-size: clamp(2.25rem, 5vw, 3rem);
  text-align: center;
}

/* Products: square-cornered cards with a hairline edge. The status tag is a
   small piece of the ribbon's black band, pinned to the bottom of each card
   so both tags line up. */
.spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
}

.product {
  display: flex;
  flex-direction: column;
  padding: 2.25rem;
  border: 1px solid var(--ink);
}

/* Symbol and name share one line. */
.product-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.product-symbol {
  flex: none;
  width: 44px;
  height: 44px;
}

.product h3 {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.product p {
  max-width: 24rem;
  margin-bottom: 2.25rem;
  text-wrap: pretty;
}

.product .status {
  align-self: flex-start;
  margin: auto 0 0;
  padding: 0.45rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8125rem;
  line-height: 1.2;
}

/* ---------- Inner pages ---------- */

.doc {
  padding-top: clamp(11rem, 26vh, 15rem);
  padding-bottom: 5rem;
}

.doc h1 {
  margin: 0 0 1rem;
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 200;
  text-align: center;
}

.doc .updated {
  margin-bottom: 4rem;
  font-size: 0.875rem;
  text-align: center;
}

.doc-body h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.doc-body ul {
  margin: 0 0 1.1em;
  padding-left: 1.2em;
}

.doc-body li + li {
  margin-top: 0.35em;
}

.doc-body address {
  font-style: normal;
}

/* Contact: label on the left, details on the right, one row each. */
.contact-list {
  margin: 4.5rem 0 0;
  /* Row lines switched off for review; uncomment to bring them back.
  border-bottom: 1px solid var(--ink); */
}

.contact-list div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  padding: 1.6rem 0;
  /* border-top: 1px solid var(--ink); */
}

.contact-list div:first-child {
  padding-top: 0;
  border-top: 0;
}

.contact-list dt {
  font-size: 0.875rem;
  font-weight: 600;
}

.contact-list dd {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.6;
}

/* About: one sentence to a line, read as a statement. */
.about {
  margin-top: 4.5rem;
}

.about p,
.marks,
.blog-note p {
  font-size: clamp(1.1875rem, 2.2vw, 1.375rem);
  line-height: 1.5;
}

.about p {
  margin: 0 0 1.5em;
}

.about .lead-in {
  margin-bottom: 1rem;
}

/* Bullets are the logo's square, in miniature. */
.marks {
  margin: 0 0 1.5em;
  padding: 0;
  list-style: none;
}

.marks li {
  display: flex;
  align-items: center;
  gap: 0.85em;
}

.marks li + li {
  margin-top: 0.35em;
}

.marks li::before {
  content: "";
  flex: none;
  width: 0.34em;
  height: 0.34em;
  background: var(--ink);
}

.about .closing {
  margin: 4.5rem 0 0;
}

/* Blog, until there are posts. */
.blog-note {
  margin-top: 4.5rem;
}

.blog-note p {
  margin: 0 0 0.4em;
}

.follow {
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  margin: 3.5rem 0 0;
  padding: 0;
  list-style: none;
}

.follow img {
  width: 26px;
  height: 26px;
}

.missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  min-height: 100svh;
}

.missing h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 200;
}

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

.site-footer {
  margin-top: 4rem;
  padding-bottom: 3rem;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-top: 4rem;
  border-top: 1px solid var(--ink);
}

/* logo-full.png: the band runs to the image edges, so no offset is needed.
   (For the earlier logo.png, use 136px with margin: -18px 0 0.75rem -18px.) */
.footer-brand img {
  width: 128px;
  height: 128px;
  margin: 0 0 1.5rem;
}

.footer-brand p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

.footer-brand .footer-name {
  margin-bottom: 0.6rem;
  font-size: 1.375rem;
  letter-spacing: 0.1em;
}

.footer-col h2 {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li + li {
  margin-top: 0.7rem;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  vertical-align: top;
  text-decoration: none;
}

.footer-col a:hover {
  text-decoration: underline;
}

/* Social links are logos only; the alt text carries the name. */
.social {
  display: flex;
  gap: 1.25rem;
}

.footer-col .social li + li {
  margin-top: 0;
}

.social a,
.follow a {
  display: block;
  transition: opacity 160ms ease;
}

.social a:hover,
.follow a:hover {
  opacity: 0.55;
}

.social img {
  width: 20px;
  height: 20px;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 4.5rem;
  font-size: 0.8125rem;
}

.footer-base p {
  margin: 0;
}

/* ---------- Smaller screens ---------- */

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Four links in one row would cover the ribbon's band on narrow screens,
   so they fold into a two-by-two block in the corner. */
@media (max-width: 760px) {
  .site-nav {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.85rem 1.75rem;
  }
}

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

@media (max-width: 640px) {
  :root {
    --ribbon-s: 64px;
    --ribbon-c: 70px;
  }

  body {
    font-size: 1rem;
  }

  .site-nav {
    top: 14px;
    right: 12px;
    gap: 0.7rem 1.25rem;
    padding: 0.5rem;
  }

  .site-nav a {
    font-size: 1rem;
  }

  .section {
    padding-block: 5rem;
  }

  .contact-list div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 1.35rem 0;
  }

  .product {
    padding: 1.75rem;
  }

  .product h3 {
    font-size: 1.875rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 1.5rem;
  }

  .footer-base {
    flex-direction: column;
  }
}

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

  .ribbon-band {
    animation: none;
  }

  a {
    transition: none;
  }
}

/* ---------- Corner mode: square only (trial) ----------
   The logo square sits on the nav's centre line, mirroring its inset from
   the edge. The ribbon styles above are untouched: delete or comment out
   this block to bring the ribbon back. */
:root {
  --mark: 72px;
  --bar-y: 68px;   /* centre line shared by the square and the nav */
  --bar-x: 40px;
}

.ribbon {
  width: 0;
  height: 0;
}

.ribbon-band {
  display: none;
}

.ribbon-mark {
  top: calc(var(--bar-y) - var(--mark) / 2);
  left: var(--bar-x);
  width: var(--mark);
  height: var(--mark);
}

.site-nav {
  top: var(--bar-y);
  right: var(--bar-x);
  transform: translateY(-50%);
}

@media (max-width: 640px) {
  :root {
    --mark: 52px;
    --bar-y: 42px;
    --bar-x: 14px;
  }
}
