/* Site typography: assets/typefaces/nothing-sans.css from the standards
   repository, with its url() paths pointing at ../typefaces/ (this file
   lives in site/assets/css/). scripts/sync-fonts.sh copies the faces it
   names into site/assets/typefaces/. Load it last, after the layout CSS. */

/* ----------------------------------------------------------------------------
   Nothing Sans: canonical web setup
   ----------------------------------------------------------------------------
   The brand typeface of Nothing LLC and Howblue Ltd, set the way
   noth-ing.com/about sets it. See docs/nothing-sans.md for why each rule is
   here, what was tried and rejected, and the face's known spacing issues.

   To use it: copy this file and the font files it names into a project, keep
   the relative paths (or change the url() values), and load it before the
   project's own styles. The rules at the bottom set the type; the project's
   own CSS should only add layout and color.

   Used by noth-ing.com and by the project photo sites (docs/photo-sites.md),
   which load it as assets/css/typography.css after their layout CSS.

   Names (see "Naming" in docs/nothing-sans.md):
   - Files are named NothingSans-<Style>.otf and NothingSerif-Regular.ttf.
   - The fonts' internal family names are "Nothing SansSerif" and "Nothing
     Serif" (renamed 2026-10-23); they are registered here as "Nothing Sans",
     "Nothing Sans Light", and "Nothing Serif" so pages never depend on an
     installed copy.
   ------------------------------------------------------------------------- */

/* Weight mapping from the about page: SemiBold answers to 700 and Bold to
   800, so anything asking for bold gets a notch lighter than its name. */
@font-face {
	font-family: "Nothing Sans";
	src: url("../typefaces/sansserif/NothingSans-Book.otf") format("opentype");
	font-weight: 400;
	font-style: normal;
	font-display: block;
}
@font-face {
	font-family: "Nothing Sans";
	src: url("../typefaces/sansserif/NothingSans-BookItalic.otf") format("opentype");
	font-weight: 400;
	font-style: italic;
	font-display: block;
}
@font-face {
	font-family: "Nothing Sans";
	src: url("../typefaces/sansserif/NothingSans-SemiBold.otf") format("opentype");
	font-weight: 700;
	font-style: normal;
	font-display: block;
}
@font-face {
	font-family: "Nothing Sans";
	src: url("../typefaces/sansserif/NothingSans-Bold.otf") format("opentype");
	font-weight: 800;
	font-style: normal;
	font-display: block;
}

/* Light is its own family so paragraph copy can ask for it by name. */
@font-face {
	font-family: "Nothing Sans Light";
	src: url("../typefaces/sansserif/NothingSans-Light.otf") format("opentype");
	font-weight: 400;
	font-style: normal;
	font-display: block;
}
@font-face {
	font-family: "Nothing Sans Light";
	src: url("../typefaces/sansserif/NothingSans-LightItalic.otf") format("opentype");
	font-weight: 400;
	font-style: italic;
	font-display: block;
}

/* The serif has one weight; never let browsers synthesize a bold. */
@font-face {
	font-family: "Nothing Serif";
	src: url("../typefaces/serif/NothingSerif-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: block;
}

:root {
	--nothing-copy: 24px;
	--nothing-small: 16px;
	/* Optical correction for a box of Nothing Sans text: add it to the bottom
	   padding. The face reserves 1.0625em above the baseline and 0.25em below;
	   caps are 0.718em and lowercase 0.523em tall. Centering on the midpoint of
	   those heights (0.6205em) leaves 1.0625 - 0.6205 - 0.25 = 0.192em more
	   space above the text than below it with equal padding. Chosen by eye on
	   2026-10-25 between centering on caps (0.0945em, still top-heavy) and on
	   lowercase (0.2895em, too much below). See "Spacing around text" in
	   docs/nothing-sans.md. */
	--nothing-optical-bottom: 0.192em;
	--nothing-sans: "Nothing Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
	--nothing-light: "Nothing Sans Light", "Nothing Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
	--nothing-serif: "Nothing Serif", Georgia, serif;
}
@media screen and (max-width: 1366px) { :root { --nothing-copy: 20px; --nothing-small: 14px; } }
@media screen and (max-width: 1024px) { :root { --nothing-copy: 18px; } }

/* Small text in Book. letter-spacing stays 0 everywhere: the face only looks
   right with its own spacing. The second rule wins over any tracking a
   project's layout CSS sets on labels or kickers. */
body {
	font-family: var(--nothing-sans);
	font-size: var(--nothing-small);
	font-weight: 400;
	line-height: 1.3333;
	letter-spacing: 0;
	font-synthesis: none;
}
body * { letter-spacing: 0 !important; }

/* Paragraph copy in Light at the copy size. */
p {
	font-family: var(--nothing-light);
	font-size: var(--nothing-copy);
	line-height: 1.46;
}

/* Headline in Bold (800), short and very large. Set the size per project. */
h1 {
	font-weight: 800;
	line-height: 0.98;
}

/* Section titles in Book at 0.96 x the copy size, sentence case. */
h2,
h3 {
	font-weight: 400;
	font-size: calc(var(--nothing-copy) * 0.96);
	line-height: 1.25;
	text-transform: none;
}

/* Reading copy that is a list: in a .prose container, list items are set
   like paragraphs, so a bulleted section reads like the text around it. */
.prose li {
	font-family: var(--nothing-light);
	font-size: var(--nothing-copy);
	line-height: 1.46;
}

/* Links, as on noth-ing.com: a thin underline set just below the text, in a
   muted mix of the text color, that thickens and takes the full text color
   on hover or keyboard focus. A standalone "go to" link carries class="go"
   for a trailing arrow after a no-break space; a link inside a sentence is
   underlined only. A project sets the two underline colors from its own
   tokens with --nothing-link-underline and --nothing-link-underline-hover;
   without them, the underline is a mix of the text color. */
a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--nothing-link-underline, color-mix(in srgb, currentColor 45%, transparent));
	text-decoration-thickness: max(0.0313em, 1px);
	text-underline-offset: 0.12em;
}
a:hover,
a:focus-visible {
	text-decoration-color: var(--nothing-link-underline-hover, currentColor);
	text-decoration-thickness: max(0.0625em, 2px);
}
a.go::after { content: "\00a0\2192"; }

/* Table text in Book at the small size, optically centered between rules by
   the extra bottom padding. Rule weights and colors belong to the project's
   layout CSS (docs/photo-sites.md gives the standard ones). */
table { font-variant-numeric: tabular-nums; }
th,
td {
	font-family: var(--nothing-sans);
	font-size: var(--nothing-small);
	font-weight: 400;
	line-height: 1.3333;
	padding-top: 0.55em;
	padding-bottom: calc(0.55em + var(--nothing-optical-bottom));
}

/* Loading without a flash (see docs/nothing-sans.md): pages add the
   fonts-loading class to <html> before first paint with a short inline
   script and swap it for fonts-ready once the faces load, or after 3
   seconds. The page stays hidden only while fonts-loading is set, so
   without JavaScript nothing is ever hidden. */
html.fonts-loading body { opacity: 0; }
html.fonts-ready body { opacity: 1; transition: opacity 180ms ease-out; }
@media (prefers-reduced-motion: reduce) {
	html.fonts-ready body { transition: none; }
}
