/* ===========================================================
   Sky Words Answers — skywordsanswers.net
   Aesthetic: warm editorial, paper-like, square & honest
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600;700&display=swap');

:root {
    --bg: #F3ECD8;
    --bg-soft: #ECE3CC;
    --paper: #FAF5E6;
    --ink: #1C2B33;
    --ink-soft: #3C4E58;
    --ink-muted: #6B7882;
    --rule: #2A3A44;
    --accent: #C2583C;
    --accent-dark: #9E4228;
    --accent-soft: #E8C9B8;
    --moss: #5F7356;
    --gold: #B88A2E;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-size: 17px;
    min-height: 100vh;
    /* subtle paper grain via layered radial gradients */
    background-image:
        radial-gradient(at 15% 20%, rgba(194,88,60,0.04) 0, transparent 50%),
        radial-gradient(at 85% 80%, rgba(95,115,86,0.04) 0, transparent 50%);
    background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s ease; }
a:hover { border-bottom-color: var(--accent); }

/* ========== Layout ========== */

.wrap { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* ========== Header ========== */

.site-header {
    border-bottom: 2px solid var(--ink);
    background: var(--paper);
    padding: 18px 0;
    position: sticky; top: 0; z-index: 50;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 26px;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1;
    border: none !important;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.logo .logo-mark {
    display: inline-block;
    width: 14px; height: 14px;
    background: var(--accent);
    transform: translateY(1px);
}
.logo em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

.site-nav {
    display: flex;
    gap: 18px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--accent); }

/* ========== Hero / intro ========== */

.hero {
    padding: 56px 0 28px;
    border-bottom: 1px solid rgba(28,43,51,0.15);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--moss);
    margin-bottom: 14px;
    font-weight: 600;
}

h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 6vw, 54px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-bottom: 18px;
}
h1 em { font-style: italic; color: var(--accent); font-weight: 500; }

.lead {
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 640px;
    margin-bottom: 12px;
}

.update-stamp {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    background: var(--ink);
    color: var(--bg);
    margin-top: 20px;
}

/* ========== Section headings ========== */

h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 28px;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--ink);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
h2 .count {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-muted);
    letter-spacing: 0.05em;
    font-weight: 500;
}

h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    color: var(--ink);
    margin: 28px 0 12px;
}

p { margin-bottom: 14px; }

/* ========== Level index grid ========== */

.level-index {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0;
    margin: 20px 0 40px;
    border-top: 1px solid var(--ink);
    border-left: 1px solid var(--ink);
}

.level-index a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    color: var(--ink);
    background: var(--paper);
    font-weight: 500;
    font-size: 15px;
    transition: background .15s ease, color .15s ease;
}
.level-index a:hover {
    background: var(--ink);
    color: var(--bg);
    border-bottom-color: var(--ink);
}
.level-index a .arrow {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    transition: color .15s ease;
}
.level-index a:hover .arrow { color: var(--bg); }

/* Dense level list for 1-100 style pages */
.level-index.dense {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.level-index.dense a {
    padding: 10px 14px;
    font-size: 14px;
}

/* ========== Daily puzzle highlight ========== */

.daily-highlight {
    background: var(--ink);
    color: var(--paper);
    padding: 24px;
    margin: 28px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.daily-highlight::before {
    content: '';
    position: absolute;
    right: -40px; top: -40px;
    width: 160px; height: 160px;
    background: var(--accent);
    transform: rotate(45deg);
    opacity: 0.18;
}
.daily-highlight .eyebrow { color: var(--accent-soft); }
.daily-highlight h3 {
    color: var(--paper);
    font-size: 26px;
    margin: 0;
}
.daily-highlight a {
    color: var(--paper);
    border-bottom: 1px solid var(--accent);
    align-self: flex-start;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.daily-highlight a:hover {
    background: var(--accent);
    border-bottom-color: var(--accent);
}

/* ========== The Crossword Grid (the signature visual) ========== */

.grid-wrap {
    margin: 28px 0 36px;
    padding: 28px;
    background: var(--paper);
    border: 2px solid var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    position: relative;
}
.grid-wrap::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 1px solid var(--ink);
    pointer-events: none;
    opacity: 0.25;
}

.grid-label {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--moss);
    font-weight: 600;
}

.grid {
    display: grid;
    gap: 4px;
}
.cell {
    width: 48px; height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    text-transform: uppercase;
    position: relative;
}
.cell.filled {
    background: var(--ink);
    color: var(--paper);
    box-shadow: inset 0 0 0 1px var(--ink);
}
.cell.filled.start-h::before,
.cell.filled.start-v::before {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--accent-soft);
    font-weight: 700;
    top: 3px; left: 4px;
    letter-spacing: 0;
}
.cell.empty {
    background: transparent;
}

@media (max-width: 520px) {
    .cell { width: 38px; height: 38px; font-size: 20px; }
}

/* Letter tiles (the "available letters" row, like the game shows) */
.letter-tiles {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
.letter-tiles .eyebrow { width: 100%; text-align: center; margin-bottom: 4px; }
.tile {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent);
    color: var(--paper);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    text-transform: uppercase;
    box-shadow: 2px 2px 0 var(--ink);
}

/* ========== Word list ========== */

.word-list {
    margin: 20px 0 32px;
}
.word-list h3 {
    margin-top: 0;
    display: flex;
    align-items: baseline;
    gap: 14px;
}
.word-list h3 .word-count {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-muted);
    font-weight: 500;
}

.words {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0;
    border-top: 1px solid var(--ink);
    border-left: 1px solid var(--ink);
}
.words .word-entry {
    padding: 12px 16px;
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    background: var(--paper);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.words .word-entry .w {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 19px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink);
}
.words .word-entry .len {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--moss);
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ========== Prev/Next nav ========== */

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 40px 0;
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
}
.pager a {
    padding: 18px 20px;
    background: var(--paper);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: none;
    transition: background .15s ease;
}
.pager a:hover { background: var(--ink); color: var(--bg); }
.pager a.prev { border-right: 1px solid var(--ink); }
.pager a.next { text-align: right; align-items: flex-end; }
.pager a.empty {
    background: var(--bg-soft);
    cursor: default;
    pointer-events: none;
}
.pager .label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-muted);
    font-weight: 600;
}
.pager a:hover .label { color: var(--accent-soft); }
.pager .target {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
}

/* ========== Related levels ========== */

.related {
    margin: 32px 0;
}
.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0;
    border-top: 1px solid var(--ink);
    border-left: 1px solid var(--ink);
}
.related-list a {
    padding: 12px 14px;
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
}
.related-list a:hover { background: var(--accent); color: var(--paper); }

/* ========== Breadcrumb ========== */

.crumbs {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
    padding: 24px 0 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.crumbs a { color: var(--ink-soft); border: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--ink-muted); }
.crumbs .here { color: var(--ink); }

/* ========== Search box ========== */

.search-box {
    margin: 20px 0 36px;
    padding: 22px;
    background: var(--paper);
    border: 2px solid var(--ink);
}
.search-box .eyebrow { margin-bottom: 10px; }
.search-box form {
    display: flex;
    gap: 0;
    border: 2px solid var(--ink);
}
.search-box input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border: none;
    background: var(--bg);
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--ink);
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.search-box button {
    padding: 12px 20px;
    background: var(--ink);
    color: var(--paper);
    border: none;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background .15s ease;
}
.search-box button:hover { background: var(--accent); }

/* ========== Article content (about, privacy, etc.) ========== */

.article {
    padding: 24px 0 40px;
    max-width: 680px;
}
.article p { margin-bottom: 16px; font-size: 17px; color: var(--ink-soft); }
.article p strong { color: var(--ink); }
.article ul { margin: 16px 0 20px 20px; }
.article li { margin-bottom: 8px; color: var(--ink-soft); }

/* ========== Footer ========== */

.site-footer {
    border-top: 2px solid var(--ink);
    background: var(--ink);
    color: var(--bg);
    margin-top: 60px;
    padding: 40px 0 24px;
}
.site-footer .wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}
.footer-brand {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--paper);
}
.footer-brand em { color: var(--accent); font-style: italic; font-weight: 500; }
.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.footer-links a { color: var(--bg); border: none; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid rgba(243,236,216,0.15);
    padding-top: 16px;
    font-size: 13px;
    color: var(--ink-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    line-height: 1.7;
}
.footer-bottom p + p { margin-top: 6px; }

/* ========== Misc ========== */

.intro-block {
    padding: 28px 0 20px;
}
.intro-block p {
    font-size: 17px;
    color: var(--ink-soft);
    max-width: 680px;
}

hr.rule {
    border: none;
    border-top: 1px solid var(--ink);
    opacity: 0.25;
    margin: 32px 0;
}

.small { font-size: 14px; color: var(--ink-muted); }
.mono { font-family: var(--font-mono); }

/* ========== Responsive ========== */

@media (max-width: 600px) {
    .site-nav { gap: 12px; font-size: 13px; }
    .site-nav a:not(.primary) { display: none; }
    .hero { padding: 36px 0 20px; }
    h1 { font-size: 34px; }
    .level-index { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .level-index.dense { grid-template-columns: repeat(3, 1fr); }
    .grid-wrap { padding: 18px; }
    .pager { grid-template-columns: 1fr; }
    .pager a.prev { border-right: none; border-bottom: 1px solid var(--ink); }
}
