<?php
declare(strict_types=1);
require_once __DIR__ . '/includes/bootstrap.php';

$uiLang   = dbnToolsCurrentLanguage();
$isAuthed = dbnToolsIsAuthenticated();
$langPath = '/korrespond-about.php';
$toolsLogin  = 'https://dobetternorge.no/tools-login.php?return=' . urlencode('/korrespond.php');
$registerUrl = 'https://dobetternorge.no/register.php';
$ctaUrl = $isAuthed ? '/korrespond.php' : ($toolsLogin);

$_pt = require __DIR__ . '/translations/korrespond-about.php';
$t   = $_pt[$uiLang] ?? $_pt['en'];
?>
<!doctype html>
<html lang="<?= htmlspecialchars($uiLang) ?>">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Korrespond — Draft letters to Norwegian authorities · Do Better Norge Tools</title>
    <meta name="description" content="Korrespond uses Hard-RAG and a fine-tuned legal LLM to draft formal letters, emails, and court filings to Norwegian authorities — always in Norwegian bokmål + your language, with verified statute citations.">
    <meta name="robots" content="index, follow">
    <link rel="canonical" href="https://tools.dobetternorge.no/korrespond-about.php">
    <meta property="og:title" content="Korrespond — Draft letters to Norwegian authorities">
    <meta property="og:description" content="AI correspondence tool grounded in 220,000+ Norwegian legal passages. Covers NAV, Barnevernet, schools, Bufdir, Statsforvalter and more.">
    <meta property="og:type" content="website">
    <meta name="theme-color" content="#00205B">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap">
    <link rel="stylesheet" href="assets/css/tools.css">
</head>
<body class="kdoc-page">

<header class="lt-nav">
    <a href="https://dobetternorge.no" class="lt-nav__brand">
        <picture>
            <source srcset="assets/images/logo-header.webp" type="image/webp">
            <img class="lt-nav__logo" src="assets/images/logo-header.png" alt="Do Better Norge" width="140" height="36" loading="eager">
        </picture>
        <span class="lt-nav__badge">Legal Tools</span>
    </a>
    <div class="lt-nav__right">
        <nav class="shell-lang-switcher" aria-label="Language">
<?php foreach (dbnToolsSupportedLanguages() as $langCode): ?>
            <a href="<?= htmlspecialchars($langPath . '?lang=' . $langCode) ?>" class="<?= $langCode === $uiLang ? 'is-active' : '' ?>"><?= htmlspecialchars(dbnToolsLanguageLabel($langCode)) ?></a>
<?php endforeach; ?>
        </nav>
<?php if ($isAuthed): ?>
        <a href="/korrespond.php" class="lt-nav__cta lt-nav__cta--enter"><?= htmlspecialchars($t['nav_open']) ?></a>
<?php else: ?>
        <a href="<?= htmlspecialchars($toolsLogin) ?>" class="lt-nav__cta"><?= htmlspecialchars($t['nav_signin']) ?></a>
<?php endif; ?>
    </div>
</header>

<nav class="kdoc-doc-nav" aria-label="Korrespond documentation">
    <div class="kdoc-doc-nav__inner">
        <a href="/korrespond-about.php" class="is-active"><?= htmlspecialchars($t['nav_about']) ?></a>
        <a href="/korrespond-guide.php"><?= htmlspecialchars($t['nav_guide']) ?></a>
        <a href="/korrespond-tech.php"><?= htmlspecialchars($t['nav_howit']) ?></a>
        <?php if ($isAuthed): ?>
        <a href="/korrespond.php"><?= htmlspecialchars($t['nav_opentool']) ?></a>
        <?php endif; ?>
    </div>
</nav>

<!-- Hero -->
<section class="kdoc-hero" style="background: linear-gradient(rgba(0,20,60,0.82),rgba(0,20,60,0.88)), url('assets/images/korrespond/hero-marketing.png') center/cover no-repeat;">
    <div class="kdoc-hero__inner">
        <p class="kdoc-hero__kicker"><?= htmlspecialchars($t['hero_kicker']) ?></p>
        <h1 class="kdoc-hero__title"><?= htmlspecialchars($t['hero_title']) ?></h1>
        <p class="kdoc-hero__sub"><?= htmlspecialchars($t['hero_sub']) ?></p>

        <div class="kdoc-hero__stats">
            <div class="kdoc-hero__stat">
                <strong>220K+</strong>
                <span><?= htmlspecialchars($t['stat_legal']) ?></span>
            </div>
            <div class="kdoc-hero__stat">
                <strong>11</strong>
                <span><?= htmlspecialchars($t['stat_authority']) ?></span>
            </div>
            <div class="kdoc-hero__stat">
                <strong>4</strong>
                <span><?= htmlspecialchars($t['stat_output']) ?></span>
            </div>
            <div class="kdoc-hero__stat">
                <strong>3</strong>
                <span><?= htmlspecialchars($t['stat_pipeline']) ?></span>
            </div>
        </div>

        <div class="kdoc-hero__ctas">
            <a href="<?= htmlspecialchars($ctaUrl) ?>" class="kdoc-btn-primary"><?= htmlspecialchars($t['btn_try']) ?></a>
            <a href="/korrespond-guide.php" class="kdoc-btn-secondary"><?= htmlspecialchars($t['btn_guide']) ?></a>
            <a href="/korrespond-tech.php" class="kdoc-btn-secondary"><?= htmlspecialchars($t['btn_howit']) ?></a>
        </div>
    </div>
</section>

<!-- What you get -->
<section class="kdoc-section--alt">
<div class="kdoc-section">
    <p class="kdoc-section__eyebrow"><?= htmlspecialchars($t['what_eyebrow']) ?></p>
    <h2 class="kdoc-section__title"><?= htmlspecialchars($t['what_title']) ?></h2>
    <div class="kdoc-features">
        <div class="kdoc-feature-card">
            <span class="kdoc-feature-card__icon">&#127475;&#127476;</span>
            <h3 class="kdoc-feature-card__title"><?= htmlspecialchars($t['f1_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= htmlspecialchars($t['f1_body']) ?></p>
        </div>
        <div class="kdoc-feature-card">
            <span class="kdoc-feature-card__icon">&#128220;</span>
            <h3 class="kdoc-feature-card__title"><?= htmlspecialchars($t['f2_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= htmlspecialchars($t['f2_body']) ?></p>
        </div>
        <div class="kdoc-feature-card">
            <span class="kdoc-feature-card__icon">&#9878;&#65039;</span>
            <h3 class="kdoc-feature-card__title"><?= htmlspecialchars($t['f3_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= $t['f3_body_html'] ?></p>
        </div>
    </div>
</div>
</section>

<!-- How it works (3-step) -->
<div class="kdoc-section">
    <p class="kdoc-section__eyebrow"><?= htmlspecialchars($t['how_eyebrow']) ?></p>
    <h2 class="kdoc-section__title"><?= htmlspecialchars($t['how_title']) ?></h2>
    <p class="kdoc-section__sub"><?= htmlspecialchars($t['how_sub']) ?></p>

    <div class="kdoc-steps">
        <div class="kdoc-step-card">
            <span class="kdoc-step-card__num">1</span>
            <h3 class="kdoc-step-card__title"><?= htmlspecialchars($t['s1_title']) ?></h3>
            <p class="kdoc-step-card__body"><?= htmlspecialchars($t['s1_body']) ?></p>
            <p class="kdoc-step-card__example"><?= htmlspecialchars($t['s1_example']) ?></p>
        </div>
        <span class="kdoc-step-arrow" aria-hidden="true">&rarr;</span>
        <div class="kdoc-step-card">
            <span class="kdoc-step-card__num">2</span>
            <h3 class="kdoc-step-card__title"><?= htmlspecialchars($t['s2_title']) ?></h3>
            <p class="kdoc-step-card__body"><?= htmlspecialchars($t['s2_body']) ?></p>
            <p class="kdoc-step-card__example"><?= htmlspecialchars($t['s2_example']) ?></p>
            <img src="assets/images/korrespond/output-draft.png" alt="Two-column draft output — Norwegian bokmål and English side by side" class="kdoc-step-card__screenshot" loading="lazy">
        </div>
        <span class="kdoc-step-arrow" aria-hidden="true">&rarr;</span>
        <div class="kdoc-step-card">
            <span class="kdoc-step-card__num">3</span>
            <h3 class="kdoc-step-card__title"><?= htmlspecialchars($t['s3_title']) ?></h3>
            <p class="kdoc-step-card__body"><?= $t['s3_body_html'] ?></p>
            <p class="kdoc-step-card__example"><?= htmlspecialchars($t['s3_example']) ?></p>
        </div>
    </div>
</div>

<!-- Screenshots -->
<section class="kdoc-section--alt">
<div class="kdoc-section">
    <p class="kdoc-section__eyebrow"><?= htmlspecialchars($t['ss_eyebrow']) ?></p>
    <h2 class="kdoc-section__title"><?= htmlspecialchars($t['ss_title']) ?></h2>
    <div class="kdoc-gallery">
        <div class="kdoc-gallery__item">
            <img src="assets/images/korrespond/form-top.png" alt="Korrespond form — mode toggle, recipient body, output type, tone" class="kdoc-screenshot" loading="lazy">
            <p class="kdoc-gallery__caption"><?= htmlspecialchars($t['g1_caption']) ?></p>
        </div>
        <div class="kdoc-gallery__item">
            <img src="assets/images/korrespond/output-draft.png" alt="Korrespond output — two-column side-by-side Norwegian and English draft" class="kdoc-screenshot" loading="lazy">
            <p class="kdoc-gallery__caption"><?= htmlspecialchars($t['g2_caption']) ?></p>
        </div>
        <div class="kdoc-gallery__item">
            <img src="assets/images/korrespond/refine-panel.png" alt="Refine panel with jurisdiction options" class="kdoc-screenshot" loading="lazy">
            <p class="kdoc-gallery__caption"><?= htmlspecialchars($t['g3_caption']) ?></p>
        </div>
        <div class="kdoc-gallery__item">
            <img src="assets/images/korrespond/output-refined.png" alt="Refined output with formal statute and ECHR citations" class="kdoc-screenshot" loading="lazy">
            <p class="kdoc-gallery__caption"><?= $t['g4_caption_html'] ?></p>
        </div>
    </div>
</div>
</section>

<!-- Fine-tuned LLM spotlight -->
<div class="kdoc-section">
    <p class="kdoc-section__eyebrow"><?= htmlspecialchars($t['hood_eyebrow']) ?></p>
    <h2 class="kdoc-section__title"><?= htmlspecialchars($t['hood_title']) ?></h2>
    <div class="kdoc-llm-spotlight">
        <div>
            <span class="kdoc-llm-spotlight__badge"><?= htmlspecialchars($t['llm_badge']) ?></span>
            <h3 class="kdoc-llm-spotlight__title">dbn-legal-agent</h3>
            <p class="kdoc-llm-spotlight__body"><?= $t['llm_body_html'] ?></p>
        </div>
        <div class="kdoc-llm-stats">
            <div class="kdoc-llm-stat">
                <strong>QLoRA</strong>
                <span><?= htmlspecialchars($t['llm_s1']) ?></span>
            </div>
            <div class="kdoc-llm-stat">
                <strong>fvl</strong>
                <span><?= htmlspecialchars($t['llm_s2']) ?></span>
            </div>
            <div class="kdoc-llm-stat">
                <strong>gpt-4o</strong>
                <span><?= htmlspecialchars($t['llm_s3']) ?></span>
            </div>
            <div class="kdoc-llm-stat">
                <strong>3-pass</strong>
                <span><?= htmlspecialchars($t['llm_s4']) ?></span>
            </div>
        </div>
    </div>
</div>

<!-- Authority coverage -->
<section class="kdoc-section--alt">
<div class="kdoc-section">
    <p class="kdoc-section__eyebrow"><?= htmlspecialchars($t['auth_eyebrow']) ?></p>
    <h2 class="kdoc-section__title"><?= htmlspecialchars($t['auth_title']) ?></h2>
    <p class="kdoc-section__sub"><?= htmlspecialchars($t['auth_sub']) ?></p>
    <div class="kdoc-bodies">
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Barnehage</p>
            <p class="kdoc-body-card__law">barnehageloven · fvl</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Skole (1.–10. trinn)</p>
            <p class="kdoc-body-card__law">opplæringslova · fvl</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">SFO</p>
            <p class="kdoc-body-card__law">opplæringslova · fvl</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">NAV</p>
            <p class="kdoc-body-card__law">NAV-loven · fvl</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Bufdir</p>
            <p class="kdoc-body-card__law">fvl · EMK Art. 8</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Barnevernet</p>
            <p class="kdoc-body-card__law">barnevernsloven · fvl · EMK</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Kommune (annet)</p>
            <p class="kdoc-body-card__law">fvl</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Statsforvalteren</p>
            <p class="kdoc-body-card__law">fvl · barnevernsloven</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Trygderetten</p>
            <p class="kdoc-body-card__law">trygderettsloven · fvl</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Tingretten</p>
            <p class="kdoc-body-card__law">tvisteloven · EMK Art. 6</p>
        </div>
        <div class="kdoc-body-card">
            <p class="kdoc-body-card__name">Annet</p>
            <p class="kdoc-body-card__law">fvl (general)</p>
        </div>
    </div>
</div>
</section>

<!-- CTA strip -->
<section class="kdoc-cta-strip">
    <h2 class="kdoc-cta-strip__title"><?= htmlspecialchars($t['cta_title']) ?></h2>
    <p class="kdoc-cta-strip__sub"><?= htmlspecialchars($t['cta_sub']) ?></p>
    <div class="kdoc-hero__ctas">
<?php if ($isAuthed): ?>
        <a href="/korrespond.php" class="kdoc-btn-primary"><?= htmlspecialchars($t['btn_open']) ?></a>
<?php else: ?>
        <a href="<?= htmlspecialchars($toolsLogin) ?>" class="kdoc-btn-primary"><?= htmlspecialchars($t['btn_signin_cta']) ?></a>
        <a href="<?= htmlspecialchars($registerUrl) ?>" class="kdoc-btn-secondary"><?= htmlspecialchars($t['btn_register']) ?></a>
<?php endif; ?>
    </div>
</section>

<?php require_once __DIR__ . '/includes/footer.php'; ?>
<script src="assets/js/tools.js" defer></script>
</body>
</html>
