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

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

$_pt = require __DIR__ . '/translations/timeline-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>Timeline — Every date in your case, instantly mapped · Do Better Norge Tools</title>
    <meta name="description" content="Timeline extracts every temporal event from Norwegian legal documents into a sortable, confidence-scored chronology. Recognises 12+ date formats, classifies by type and confidence, surfaces next steps.">
    <meta name="robots" content="index, follow">
    <link rel="canonical" href="https://tools.dobetternorge.no/timeline-about.php">
    <meta property="og:title" content="Timeline — AI date extraction for Norwegian legal documents">
    <meta property="og:description" content="AI timeline tool for Norwegian case notes, court decisions, and correspondence. Extracts absolute, relative, and recurring dates with confidence scoring.">
    <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="/timeline.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="Timeline documentation">
    <div class="kdoc-doc-nav__inner">
        <a href="/timeline-about.php" class="is-active"><?= htmlspecialchars($t['nav_about']) ?></a>
        <a href="/timeline-guide.php"><?= htmlspecialchars($t['nav_guide']) ?></a>
        <a href="/timeline-tech.php"><?= htmlspecialchars($t['nav_howit']) ?></a>
        <?php if ($isAuthed): ?>
        <a href="/timeline.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/timeline/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>12+</strong>
                <span><?= htmlspecialchars($t['stat_formats']) ?></span>
            </div>
            <div class="kdoc-hero__stat">
                <strong>5</strong>
                <span><?= htmlspecialchars($t['stat_types']) ?></span>
            </div>
            <div class="kdoc-hero__stat">
                <strong>4</strong>
                <span><?= htmlspecialchars($t['stat_filters']) ?></span>
            </div>
            <div class="kdoc-hero__stat">
                <strong>3</strong>
                <span><?= htmlspecialchars($t['stat_levels']) ?></span>
            </div>
        </div>

        <div class="kdoc-hero__ctas">
            <a href="<?= htmlspecialchars($ctaUrl) ?>" class="kdoc-btn-primary"><?= htmlspecialchars($t['btn_try']) ?></a>
            <a href="/timeline-guide.php" class="kdoc-btn-secondary"><?= htmlspecialchars($t['btn_guide']) ?></a>
            <a href="/timeline-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">&#128197;</span>
            <h3 class="kdoc-feature-card__title"><?= htmlspecialchars($t['f1_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= $t['f1_body_html'] ?></p>
        </div>
        <div class="kdoc-feature-card">
            <span class="kdoc-feature-card__icon">&#127919;</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">&#128269;</span>
            <h3 class="kdoc-feature-card__title"><?= htmlspecialchars($t['f3_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= htmlspecialchars($t['f3_body']) ?></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/timeline/output-timeline.png" alt="Timeline output showing ABSOLUTE and PERIOD date cards with HIGH and MEDIUM confidence badges, actor names, and event descriptions" 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"><?= htmlspecialchars($t['s3_body']) ?></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/timeline/form-top.png" alt="Timeline form — engine selection and advanced settings panel showing Focus, Confidence, Background events, and Date types" 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/timeline/output-timeline.png" alt="Timeline output showing ABSOLUTE and PERIOD date cards with HIGH and MEDIUM confidence badges, actor names, event descriptions" 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/timeline/output-detail.png" alt="Detailed timeline events from a Barnevernet case — social workers Judith and Trude, 2025 dates" 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/timeline/evidence-trail.png" alt="Evidence Trail section with source documents, What Remains Uncertain list, and Next Practical Step recommendation" class="kdoc-screenshot" loading="lazy">
            <p class="kdoc-gallery__caption"><?= htmlspecialchars($t['g4_caption']) ?></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>12+</strong>
                <span><?= htmlspecialchars($t['llm_s2']) ?></span>
            </div>
            <div class="kdoc-llm-stat">
                <strong>5</strong>
                <span><?= htmlspecialchars($t['llm_s3']) ?></span>
            </div>
            <div class="kdoc-llm-stat">
                <strong>GPU</strong>
                <span><?= htmlspecialchars($t['llm_s4']) ?></span>
            </div>
        </div>
    </div>
</div>

<!-- Focus filter showcase -->
<section class="kdoc-section--alt">
<div class="kdoc-section">
    <p class="kdoc-section__eyebrow"><?= htmlspecialchars($t['focus_eyebrow']) ?></p>
    <h2 class="kdoc-section__title"><?= htmlspecialchars($t['focus_title']) ?></h2>
    <p class="kdoc-section__sub"><?= htmlspecialchars($t['focus_sub']) ?></p>
    <div class="kdoc-features">
        <div class="kdoc-feature-card">
            <span class="kdoc-feature-card__icon">&#128197;</span>
            <h3 class="kdoc-feature-card__title"><?= htmlspecialchars($t['ff1_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= htmlspecialchars($t['ff1_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['ff2_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= htmlspecialchars($t['ff2_body']) ?></p>
        </div>
        <div class="kdoc-feature-card">
            <span class="kdoc-feature-card__icon">&#127963;&#65039;</span>
            <h3 class="kdoc-feature-card__title"><?= htmlspecialchars($t['ff3_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= htmlspecialchars($t['ff3_body']) ?></p>
        </div>
        <div class="kdoc-feature-card">
            <span class="kdoc-feature-card__icon">&#128100;</span>
            <h3 class="kdoc-feature-card__title"><?= htmlspecialchars($t['ff4_title']) ?></h3>
            <p class="kdoc-feature-card__body"><?= htmlspecialchars($t['ff4_body']) ?></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="/timeline.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>
