/* style.css - schoolhub.at
   Look: Schulheft / Papier, Tinte, ein Akzent. Keine externen Schriften (Datenschutz!).
   Angepasst: besserer Kontrast, weicherer Hover, mobile Optimierung. */

:root {
    --paper: #f4efe6;
    --ink: #1b1a17;
    --muted: #4e4a42;          /* dunkler für bessere Lesbarkeit */
    --accent: #e4572e;
    --hi: #ffd84d;
    --line: rgba(27, 26, 23, 0.18);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.05rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--hi); color: var(--ink); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Seitenwechsel: farbiger Wisch ---------- */
.wipe {
    position: fixed;
    inset: 0;
    background: var(--accent);
    transform: translateX(-100%);
    z-index: 9999;
    pointer-events: none;
}
.wipe::after {
    content: attr(data-label);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(2rem, 8vw, 5rem);
    letter-spacing: -0.03em;
    color: var(--paper);
}
.wipe.in { transform: none; transition: transform 0.5s cubic-bezier(0.7, 0, 0.2, 1); }
html.wipe-arrive .wipe { transform: none; }
.wipe.out { transform: translateX(100%); transition: transform 0.6s cubic-bezier(0.7, 0, 0.2, 1) 0.08s; }

/* ---------- Einblend-Animation für Inhalte ---------- */
.rise {
    opacity: 0;
    transform: translateY(16px);
    animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
    animation-delay: calc(var(--i, 0) * 90ms + 300ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Kopfzeile ---------- */
header.top {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
header.top .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.brand {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}
.brand i { color: var(--accent); font-style: normal; }
header.top nav a {
    font-family: var(--mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    margin-left: 1.6rem;
    position: relative;
}
header.top nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    height: 2px;
    width: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}
header.top nav a:hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero {
    padding: 6rem 0 5rem;
    background-image: linear-gradient(rgba(27, 26, 23, 0.06) 1px, transparent 1px);
    background-size: 100% 2.2rem;
    border-bottom: 1px solid var(--line);
}
.eyebrow {
    font-family: var(--mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 1.5rem;
}
.eyebrow b { color: var(--accent); font-weight: 400; }
.hero h1 {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(2.7rem, 7.5vw, 5.8rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    max-width: 15ch;
    margin-bottom: 2rem;
}
.mark {
    background-image: linear-gradient(transparent 58%, var(--hi) 58%, var(--hi) 92%, transparent 92%);
    background-repeat: no-repeat;
    background-size: 0 100%;
    animation: mark 0.9s cubic-bezier(0.6, 0, 0.2, 1) 1s forwards;
    padding: 0 0.08em;
}
@keyframes mark { to { background-size: 100% 100%; } }
.lead { max-width: 34rem; color: var(--muted); font-size: 1.2rem; margin-bottom: 2.4rem; }
.actions { display: flex; gap: 2rem; flex-wrap: wrap; }
.link-arrow {
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 2px;
    transition: padding-right 0.25s, color 0.25s;
}
.link-arrow::after { content: " →"; }
.link-arrow:hover { color: var(--accent); padding-right: 6px; }

/* ---------- Abschnitte & Listen ---------- */
section.block { padding: 5.5rem 0; }
.sec-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.8rem; }
.sec-head .num { font-family: var(--mono); color: var(--accent); font-size: 0.85rem; opacity: 0.85; }
.sec-head h2 {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.5vw, 3rem);
    letter-spacing: -0.025em;
    line-height: 1.1;
}
.sec-sub { color: var(--muted); max-width: 36rem; margin: 0 0 2.8rem 2.6rem; }

ul.rows { list-style: none; border-top: 2px solid var(--ink); }
.row {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: 3.2rem 1fr 1.8fr 2rem;
    gap: 1rem;
    align-items: baseline;
    padding: 1.25rem 0.6rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: color 0.3s, padding-left 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.row::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(228, 87, 46, 0.08);
    transform: translateY(101%);
    transition: transform 0.38s cubic-bezier(0.7, 0, 0.2, 1);
    z-index: -1;
}
.row:hover { color: var(--ink); padding-left: 1.2rem; }
.row:hover::before { transform: translateY(0); }
.row .n { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); }
.row .t { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.row .d { color: var(--muted); font-size: 1rem; transition: color 0.3s; }
.row:hover .d { color: var(--ink); }
.row .go { text-align: right; font-size: 1.3rem; transition: transform 0.3s; }
.row:hover .go { transform: translateX(6px); }

/* dunkler Abschnitt */
.dark { background: var(--ink); color: var(--paper); }
.dark .sec-sub { color: #c9c2b4; }
.dark ul.rows { border-top-color: var(--paper); }
.dark .row { border-bottom-color: rgba(244, 239, 230, 0.2); }
.dark .row::before { background: var(--accent); }
.dark .row:hover { color: var(--paper); }
.dark .row .d { color: #c9c2b4; }
.dark .row:hover .d { color: var(--paper); }
.dark .row:hover .n { color: var(--paper); }

/* Über uns */
.about { display: grid; grid-template-columns: 1fr 1.3fr; gap: 3rem; align-items: start; }
.about p { margin-bottom: 1rem; max-width: 34rem; }
.about p.big { font-family: var(--serif); font-size: 1.5rem; line-height: 1.4; letter-spacing: -0.01em; }

/* ---------- Fußzeile ---------- */
footer.foot { border-top: 2px solid var(--ink); padding: 2rem 0 3rem; }
footer.foot .wrap {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted);
}
footer.foot a { text-decoration: none; margin-left: 1.4rem; color: var(--ink); background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 2px; transition: background-size 0.3s; }
footer.foot a:first-child { margin-left: 0; }
footer.foot a:hover { background-size: 100% 2px; }

/* ---------- Rechtsseiten ---------- */
.legal { max-width: 720px; padding: 4.5rem 0 5rem; counter-reset: sec; }
.legal h1 {
    font-family: var(--serif);
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}
.legal h2 {
    font-family: var(--serif);
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    margin: 3rem 0 0.8rem;
    padding-top: 1.2rem;
    border-top: 2px solid var(--ink);
    counter-increment: sec;
}
.legal h2::before {
    content: counter(sec, decimal-leading-zero);
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-right: 0.9rem;
    letter-spacing: 0;
    vertical-align: middle;
}
.legal h3 { font-family: var(--serif); font-size: 1.2rem; margin: 1.6rem 0 0.4rem; }
.legal p { margin-bottom: 1rem; }
.legal ul { margin: 0 0 1rem 1.3rem; }
.legal li { margin-bottom: 0.4rem; }
.legal li::marker { color: var(--accent); }
.legal a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; word-break: break-word; }
.legal a:hover { color: var(--accent); }
.legal .caps { font-size: 0.92rem; }
.legal .stand { margin-top: 3rem; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
    header.top .wrap { height: auto; padding: 0.9rem 1rem; flex-direction: column; gap: 0.8rem; }
    header.top nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.2rem; }
    header.top nav a { margin: 0; }
    .hero { padding: 3.5rem 0 3rem; }
    section.block { padding: 3.8rem 0; }
    .sec-sub { margin-left: 0; }
    .row { grid-template-columns: 2.4rem 1fr 1.5rem; padding: 1.1rem 0.4rem; }
    .row .d { grid-column: 2 / 3; grid-row: 2; }
    .row .go { grid-row: 1; grid-column: 3; }
    .about { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Dark Mode */
html.dark-mode {
    --paper: #1b1a17;
    --ink: #f4efe6;
    --muted: #c9c2b4;
    --line: rgba(244, 239, 230, 0.2);
}
html.dark-mode body { background: var(--paper); color: var(--ink); }
html.dark-mode .card, html.dark-mode .sidebar, html.dark-mode .preview, html.dark-mode .tutor-box { background: #2a2824; }
html.dark-mode header.top { background: var(--paper); }
html.dark-mode .row:hover { color: var(--paper); }

/* bestehende Regeln bleiben ... */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .rise { opacity: 1; transform: none; animation: none; }
    .mark { background-size: 100% 100%; animation: none; }
    .wipe { display: none; }
    *, *::before, *::after { transition: none !important; }
}
