// ================================ // GLOBAL PAGE STYLES AND VARIABLES // ================================ :root { --color-fog: #eeeeee; --color-parchment: #faefe2; --color-cloud: #d9e1e4; --color-mustard: #e5c299; --color-navy: #16323f; --color-walnut: #473a3a; --color-slate: #3a4047; --color-crimson: #803847; --color-lilac: #cabdc8; // --color-lime: #c5e0af; --color-lemon: #efe2b2; --color-peach: #ebb29f; --color-ale: #cd8f7a; // --color-flamingo: #d2697c; --color-seaside: #b0d6cb; --color-seaside-rgb: 176, 214, 203; // --color-cove: #83c0b9; // --color-sage: #91b99a; // --color-storm: #627088; --max-width: 1200px; --max-width-plus-padding: calc(var(--max-width) + 40px * 2); --max-extended-width: 1600px; --max-width-reading-material: 800px; --variable-px: Min(1px, 0.15vw); --page-edge-padding: 40px; --border-thickness: 2px; --feature-box-padding: 80; --font-size-link: calc(1rem * 4 / 3); } html, body { color: var(--color-navy); background: white; font-family: "Inter Variable", sans-serif; line-height: 1.5; font-weight: 500; font-size: 18px; tab-size: 4; width: 100%; height: 100%; margin: 0; } @media screen and (max-width: 780px) { :root { --font-size-link: calc(1rem * 4 / 3); --page-edge-padding: 28px; --border-thickness: 1px; --feature-box-padding: 40; } html, body { font-size: 16px; } } @media print, screen and (max-width: 500px) { :root { --page-edge-padding: 20px; } } // ================== // GLOBAL PAGE LAYOUT // ================== body > .page { box-sizing: border-box; min-width: 320px; header { padding: 0 var(--page-edge-padding); color: var(--color-walnut); position: relative; z-index: 1000; nav { margin: auto; max-width: var(--max-width); .row { display: flex; justify-content: space-between; --nav-padding-above-below: 30px; padding-top: var(--nav-padding-above-below); padding-bottom: calc(var(--nav-padding-above-below) - 16px); margin-bottom: calc(var(--nav-padding-above-below) - 16px); // Covers up content that extends up underneath the header background: white; @media screen and (max-width: 780px) { --nav-padding-above-below: 24px; } .left, .right { z-index: 1; display: flex; align-items: center; gap: 40px; --height: 60px; --button-padding: 24px; --nav-font-size: 28px; // Keep up to date with `NAV_BUTTON_INITIAL_FONT_SIZE` in navbar.js a { font-family: "Bona Nova", Palatino, serif; font-feature-settings: "lnum"; line-height: 1.25; font-weight: 700; text-decoration: none; font-size: var(--nav-font-size); &.button { min-height: 0; height: var(--height); padding-left: var(--button-padding); padding-right: var(--button-padding); line-height: calc(var(--height) - 2 * var(--border-thickness)); font-size: var(--nav-font-size); &::before { content: none; } } &:not(.button) { color: inherit; } img { display: block; width: var(--height); height: var(--height); } } &.left img { // Don't show the alt text if the image doesn't load font-size: 0; } .heart.heart { // The same color is also used below in the SVG after the `%23` (URL-encoded `#`) color: #cc304f; } @media screen and (max-width: 1200px) { gap: 30px; --height: 50px; --button-padding: 16px; --nav-font-size: 24px; } @media screen and (max-width: 1000px) { gap: 30px; --button-padding: 14px; --nav-font-size: 20px; } @media print, screen and (max-width: 900px) { gap: 20px; --height: 40px; --button-padding: 13px; --nav-font-size: 18px; } @media print, screen and (max-width: 780px) { gap: 20px; --button-padding: 12px; --nav-font-size: 16px; } @media screen and (max-width: 680px) { gap: 16px; --height: 30px; --button-padding: 8px; --nav-font-size: 14px; } @media screen and (max-width: 580px) { gap: 12px; --height: 24px; --nav-font-size: 13px; } @media screen and (max-width: 520px) { gap: 10px; --height: 22px; --button-padding: 6px; --nav-font-size: 12px; } @media screen and (max-width: 460px) { gap: 8px; --height: 20px; --button-padding: 4px; --nav-font-size: 11px; } @media screen and (max-width: 420px) { gap: 6px; --nav-font-size: 10px; } @media screen and (max-width: 380px) { gap: 6px; --nav-font-size: 9px; } @media screen and (max-width: 350px) { gap: 6px; --nav-font-size: 8px; } } } } .ripple { display: block; background: none; // Covers up content that extends up underneath the header fill: white; stroke: currentColor; --ripple-height: 16px; height: var(--ripple-height); margin-top: calc(-1 * var(--ripple-height) + var(--border-thickness)); margin-bottom: calc(-1 * var(--border-thickness)); stroke-width: var(--border-thickness); &::before, &::after { content: none; } } hr { background: none; } @media screen and (max-width: 1400px) { .ripple { width: calc(100% + (var(--page-edge-padding) * 2)); margin-left: calc(-1 * var(--page-edge-padding)); margin-right: calc(-1 * var(--page-edge-padding)); } hr { display: none; } } } main { padding: calc(120 * var(--variable-px)) var(--page-edge-padding); > section { max-width: var(--max-width); margin-left: auto; margin-right: auto; // Puts the content in front of the hexagon decoration position: relative; z-index: 1; ~ section { margin-top: calc(120 * var(--variable-px)); } p img { max-width: 100%; } pre { box-sizing: border-box; overflow: auto; } details { width: 100%; summary { display: inline-block; position: relative; padding-left: calc(10px + 8px); font-weight: 800; &::before { content: ""; background: url('data:image/svg+xml;utf8,\ \ '); position: absolute; margin: auto; top: 0; bottom: 0; left: 0; width: 10px; height: 10px; } + * { margin-top: 20px; } } } details[open] summary::before { // content: "▼"; transform: rotate(90deg); } } } footer { display: flex; flex-direction: column; align-items: center; padding: 40px; padding-top: 0; color: var(--color-walnut); @media screen and (max-width: 1400px) { hr { width: 100%; &::before, &::after { border: none; background: currentColor; width: calc(var(--page-edge-padding) + 40px); height: var(--border-thickness); } } } nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 40px; margin-top: 40px; a { color: var(--color-walnut); } @media screen and (max-width: 900px) { max-width: 500px; } @media screen and (max-width: 780px) { max-width: 440px; } @media screen and (max-width: 400px) { gap: 6px 20px; } } span { text-align: center; margin-top: 40px; } } } // ===================== // ELEMENT SPACING RULES // ===================== :is(h1, h2, h3, h4, article > :first-child, details > summary) ~ :is(p, ul, ol, ol li p, img, a:has(> img:only-child)), :is(h1, h2, h3, h4, article > :first-child) ~ :is(ul, ol) li p + img, :is(h1, h2, h3, h4, p) ~ .feature-icons, p ~ :is(h1, h2, h3, h4, details summary, blockquote, .image-comparison, .video-background, .youtube-embed), .youtube-embed + :is(p, .link, .button), p + p > .button, p + :is(.link, section, details), table td p ~ p, img + .link, article { margin-top: 20px; } * { min-width: 0; min-height: 0; } // ================================== // HEADER AND TEXT ELEMENT TAG STYLES // ================================== h1 { font-size: calc(1rem * 8 / 3); font-family: "Bona Nova", Palatino, serif; font-feature-settings: "lnum"; line-height: 1.25; font-weight: 700; display: inline-block; margin: 0; ~ h2 { margin-top: 40px; } ~ hr { margin-top: 40px; margin-bottom: 20px; } } h2, h3, h4, h5, h6 { font-family: "Inter Variable", sans-serif; line-height: 1.5; font-weight: 800; display: inline-block; margin: 0; } h2 { font-size: calc(1rem * 16 / 9); font-weight: 700; } h3 { font-size: calc(1rem * 4 / 3); } h4, h5, h6 { font-size: 1rem; } p { margin: 0; text-align: justify; text-justify: inter-character; // Only supported in Firefox -webkit-hyphens: auto; hyphens: auto; code { text-justify: auto; } } h1, h2, h3, h4, h5, h6, p { ~ img, ~ iframe, ~ a > img:only-child { width: 100%; height: auto; } } a { color: var(--color-crimson); } // ======================== // OTHER ELEMENT TAG STYLES // ======================== img { vertical-align: top; } table { margin: 20px -20px; width: calc(100% + 40px); th, td { border: 20px solid transparent; vertical-align: top; margin: 0; padding: 0; } th:not(:first-child) img, td:not(:first-child) img { max-width: 100%; } th:empty { border: none; } :is(h1, h2, h3, h4, h5, h6) + & { margin-top: 0; } } ul, ol { margin: 0; + p { margin-top: 0; } li { margin-top: 0.5em; } } hr { // Reset Firefox user agent style that is overriding `currentColor` that we set color: unset; } code { color: black; background: var(--color-fog); padding: 0 4px; overflow-wrap: anywhere; -webkit-hyphens: none; hyphens: none; a & { color: var(--color-crimson); } } kbd { outline: calc(var(--border-thickness) / 2) solid var(--color-navy); padding: 0 8px; margin: 0 4px; color: inherit; font-family: inherit; } summary { cursor: pointer; } hr { overflow: visible; } hr, .ripple { width: calc(100% - 32px * 2); height: var(--border-thickness); margin: 0 32px; background: currentColor; position: relative; border: none; &::before { left: -40px; border-width: 0 0 var(--border-thickness) 40px; } &::after { right: -40px; border-width: 0 40px var(--border-thickness) 0; } &::before, &::after { content: ""; display: block; width: 0; height: 0; position: absolute; border-color: transparent transparent currentColor transparent; border-style: solid; } } // ======================== // COMMON SIMPLE COMPONENTS // ======================== .block { display: flex; flex-direction: column; align-items: flex-start; width: 100%; &.centered { align-items: center; } :not(.diptych, .triptych) > .block + & { margin-top: calc(120 * var(--variable-px)); } } .link { display: inline-block; font-size: var(--font-size-link); font-weight: 800; text-decoration: none; color: var(--color-crimson); white-space: nowrap; &:not(.not-uppercase) { text-transform: uppercase; } } .button { display: inline-block; border: var(--border-thickness) solid currentColor; min-height: calc(var(--font-size-link) * 2); font-size: var(--font-size-link); padding: 0 var(--font-size-link); box-sizing: border-box; text-align: left; text-decoration: none; font-weight: 800; color: var(--color-crimson); &::before { content: ""; line-height: calc(var(--font-size-link) * 2 - 2 * var(--border-thickness)); } img { height: calc(var(--font-size-link) * 1.5); margin-right: calc(var(--font-size-link) / 2); } img, span { vertical-align: middle; } } .arrow::after { content: " »"; font-family: "Inter Variable", sans-serif; } .video-background { position: relative; font-size: 0; video { max-width: Min(100%, 1280px); } // Uses a white border over the video to cover up the edges of the video which, due to a Chrome rendering bug, displays black edges sometimes when scrolling &::after { content: ""; position: absolute; inset: 0; border: 2px solid white; pointer-events: none; } } .heart::after { content: ""; background-image: url('data:image/svg+xml;utf8,\ \ '); display: inline-block; width: 0.75em; height: 0.75em; margin-left: 0.25em; margin-bottom: -0.1em; vertical-align: baseline; } // blockquote { // padding: 32px 80px; // background: rgba(0, 0, 0, 0.0625); // position: relative; // border-left: 4px solid var(--color-navy); // &::before, // &::after { // content: ""; // position: absolute; // width: 52px; // height: 40px; // background-image: url('data:image/svg+xml;utf8,\ // \ // '); // } // &::before { // top: 16px; // left: 16px; // } // &::after { // transform: rotate(180deg); // bottom: 16px; // right: 16px; // } // }