@font-face {
    font-family: "Manrope";
    src: url("fonts/manrope-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
}

@font-face {
    font-family: "Source Serif Pro";
    src: url("fonts/source-serif-pro-regular-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
}

@font-face {
    font-family: "Source Serif Pro";
    src: url("fonts/source-serif-pro-semibold-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

:root {
    color-scheme: light;
    --paper: #f8f9fc;
    --ink: #292721;
    --muted: #716c62;
    --accent: #FF6C0C;
    --deep-blue: #003B4C;
    --border: #dedbd3;
    font-family: "Source Serif Pro", Georgia, serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.search-link { color: var(--deep-blue); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; overflow-wrap: anywhere; }
.search-link-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--deep-blue); outline-offset: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: 24px; padding: 12px; background: white; z-index: 2; }
.skip-link:focus { top: 16px; }

.navbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px 42px; }
.navbar a { text-decoration: none; }
.navbar-brand { flex-shrink: 0; font-size: 17px; font-weight: 700; }
.navbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 30px; min-width: 0; }
.navbar-links { display: flex; gap: 26px; font-size: 17px; }
.navbar-links a { color: var(--ink); cursor: default; }
.navbar-links a[href] { cursor: pointer; }
.navbar-search { position: relative; width: 230px; min-width: 0; }
.navbar-search-icon { position: absolute; left: 0; top: 9px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.navbar-search input { height: 36px; padding-left: 26px; border-bottom: 1px solid var(--border); font-size: 16px; border-radius: 0; }
.navbar-search input:focus { border-bottom-color: var(--deep-blue); }

@media (max-width: 600px) {
    .navbar { padding: 20px; gap: 16px; flex-wrap: wrap; }
    .navbar-right { gap: 12px; flex: 1 0 100%; flex-wrap: wrap; }
    .navbar-links { gap: 18px; }
    .navbar-search { flex: 1 0 100%; width: 100%; min-width: 0; }
}


main { flex: 1; display: grid; align-items: center; padding: 64px 24px 112px; }
.hero { width: 100%; max-width: 820px; margin: 0 auto; text-align: center; }
h1, h2, h3, h4, h5, h6 { font-family: "Manrope", system-ui, sans-serif; }
h1 { margin: 0; font-size: clamp(2.8rem, 5vw, 4rem); line-height: 1.1; letter-spacing: -0.01em; font-weight: 700; color: #1a1a2e; }
h1 span { background: linear-gradient(120deg, var(--accent), var(--deep-blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.search-form { margin-top: 43px; }
.search-box { display: flex; align-items: center; gap: 15px; padding: 9px 9px 9px 23px; background: #fff; border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 3px 5px #29272103, 0 12px 32px #29272105; transition: border-color 120ms, box-shadow 120ms; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #ff6c0c20; }
.search-icon { flex: 0 0 20px; width: 20px; height: 20px; color: var(--muted); }
input { width: 100%; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }
input::placeholder { color: #827c73; opacity: 1; }
.search-submit { font-family: "Manrope", system-ui, sans-serif; flex-shrink: 0; display: flex; align-items: center; gap: 17px; min-height: 46px; padding: 0 19px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; transition: background 120ms, color 120ms; }
.search-submit:hover { background: var(--accent); color: #fff; box-shadow: inset 0 0 0 2px #ffffff50; }
.search-submit svg { width: 19px; height: 19px; }
.compute-submit, .compute-submit:hover { background: var(--deep-blue); }
.tool-panel .search-box:focus-within { border-color: var(--deep-blue); box-shadow: 0 0 0 3px #003b4c20; }
.examples { margin: 17px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.example-label { font-size: 11px; color: var(--muted); margin-right: 6px; }
.example { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: #5f594f; font-size: 11px; line-height: 16px; }
.example span { font-size: 13px; color: #857c6e; }
.example:hover { border-color: #b1a390; background: #f0ede6; color: var(--ink); }
.search-feedback { margin: 24px 0 0; padding: 20px 24px; border: 1px solid var(--border); border-radius: 10px; text-align: left; background: #f2efe8; }
.search-feedback h2 { font-size: 15px; margin: 0 0 7px; font-weight: 600; }
.search-feedback p { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 0; }

footer { margin: 0 42px; padding: 25px 0 29px; border-top: 1px solid var(--border); text-align: center; }
footer p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
footer a { color: var(--ink); text-decoration-color: #c7b9a6; text-underline-offset: 4px; }
footer a:hover { color: var(--deep-blue); }

@media (max-width: 900px) {
    h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
}

@media (max-width: 600px) {
    main { padding: 55px 20px 80px; }
    .search-form { margin-top: 32px; }
    .search-box { padding: 7px; padding-left: 14px; gap: 9px; }
    input { font-size: 16px; }
    .search-icon { display: none; }
    .search-submit { padding: 0 13px; }
    .search-submit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .example-label { flex-basis: 100%; margin: 0 0 2px; }
    .examples { gap: 6px; }
    footer { margin: 0 22px; padding: 21px 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* Knot names, braids, and PD codes use the same input typography throughout. */
input[name="q"], textarea[name="q"], .calculation-form textarea[name="q"] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
