@font-face {
    font-family: "KeterAramTsova";
    src: url("KeterAramTsova.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f4ece0;
    --bg-paper: #faf6ee;
    --text: #1c1915;
    --text-secondary: #4e463d;
    --text-muted: #84796c;
    --accent: #9a2c20;
    --accent-hover: #7a2016;
    --border: rgba(28, 25, 21, 0.13);
    --font-serif: "Noto Serif TC", "Songti TC", "STSong", "Crimson Pro", Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "PingFang SC", sans-serif;
    --font-hebrew: "KeterAramTsova", "SBL Hebrew", "Noto Serif Hebrew", serif;
    --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-serif);
    font-size: 16.5px;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ב״ה at the very top-right corner on all pages */
.bh-corner {
    position: fixed;
    top: 12px;
    right: 18px;
    z-index: 100;
    font-family: var(--font-hebrew);
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: 0.04em;
    color: rgba(28, 22, 15, 0.72);
    pointer-events: none;
    user-select: none;
}

.page-shell {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 24px 72px;
}

/* Wide Woodblock Prototype Header */
.wide-header {
    position: relative;
    width: 100%;
    aspect-ratio: 1024 / 366;
    border-radius: 20px;
    overflow: hidden;
    background-color: #dec9a4;
    box-shadow:
        0 14px 36px rgba(36, 26, 14, 0.14),
        0 2px 6px rgba(36, 26, 14, 0.08);
    user-select: none;
}

.header-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Bottom-Left Borderless Liquid Glass Squircle Lens Icon */
.liquid-glass-icon {
    position: absolute;
    left: clamp(16px, 3.4vw, 28px);
    bottom: clamp(14px, 3vw, 26px);
    width: clamp(104px, 18vw, 140px);
    height: clamp(104px, 18vw, 140px);
    border-radius: 22.8%;
    z-index: 2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    backdrop-filter: blur(2.2px) saturate(112%) brightness(1.03);
    -webkit-backdrop-filter: blur(2.2px) saturate(112%) brightness(1.03);
    box-shadow:
        0 10px 24px rgba(38, 26, 10, 0.15),
        0 2px 6px rgba(38, 26, 10, 0.09);
    transform: translateZ(0);
}

.liquid-glass-icon canvas.lens-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    pointer-events: none;
}

.liquid-glass-icon .wu-glyph {
    position: relative;
    z-index: 2;
    width: 112%;
    height: 112%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

/* Title & Links */
.intro-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 28px 2px 24px;
    border-bottom: 1px solid var(--border);
}

.title-top-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-title-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.app-title {
    font-family: var(--font-sans);
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.app-subtitle {
    font-size: 1.02rem;
    color: var(--text-secondary);
}

.primary-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-paper);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(28, 25, 21, 0.04);
    transition: all 0.15s ease;
}

.link-btn .apple-icon {
    width: 13px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
    transform: translateY(-1px);
}

.link-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.link-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #faf6ee;
}

.link-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #ffffff;
}

.script-switch {
    display: inline-flex;
    background: rgba(28, 25, 21, 0.06);
    padding: 2px;
    border-radius: 999px;
    border: 1px solid var(--border);
}

.script-switch button {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    cursor: pointer;
}

.script-switch button.active {
    background: var(--bg-paper);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Epigraph */
.epigraph {
    padding: 24px 2px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.epigraph p {
    margin: 0 0 4px;
}

.epigraph .hebrew {
    font-family: var(--font-hebrew);
    font-size: 1.2rem;
    direction: rtl;
    text-align: right;
    margin: 6px 0;
    color: var(--text);
}

.epigraph .cite {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 2x2 General Feature Grid */
.spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 40px;
    padding: 28px 2px 32px;
    border-bottom: 1px solid var(--border);
}

.spec-item h2 {
    font-size: 1.06rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text);
}

.spec-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    padding: 28px 2px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.dedication {
    white-space: pre-line;
    line-height: 1.8;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* Legal pages (/privacy, /terms) */
.legal-wrapper {
    max-width: 720px;
    margin: 0 auto;
    padding: 44px 24px 72px;
    font-family: var(--font-sans);
    line-height: 1.68;
}

.legal-card {
    background: var(--bg-paper);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
}

.legal-card h1 {
    font-size: 1.65rem;
    margin: 0 0 4px;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.legal-card h2 {
    font-size: 1.08rem;
    margin: 24px 0 8px;
}

.legal-card p, .legal-card li {
    color: var(--text-secondary);
    font-size: 0.94rem;
}

.legal-card code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: rgba(28, 25, 21, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
}

@media (max-width: 680px) {
    .page-shell {
        padding: 16px 16px 56px;
    }
    .spec-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .footer-meta {
        align-items: flex-start;
    }
    .legal-card {
        padding: 24px;
    }
}
