{% extends "base.html" %}

{% block content %}
{% if page.file.src_path == "index.md" %}

<div class="sf-wrap">
  
  <div class="sf-header">
    <img src="assets/logo.png" alt="SafeFeat logo" class="sf-logo">
    <h1 class="sf-title">SafeFeat documentation</h1>
  </div>

  <p class="sf-desc">
    <code>safefeat</code> is an open source, MIT-licensed library for leakage-safe,
    point-in-time feature engineering from event logs. It builds ML features for each
    <code>(entity_id, cutoff_time)</code> using only events that occurred at or before
    each cutoff — so your model learns what it would actually know in production.
  </p>

  <p class="sf-links">
    <strong>Useful links:</strong>
    <a href="https://pypi.org/project/safefeat/">PyPI</a> ·
    <a href="https://github.com/AlishaAng/safefeat">Source Repository</a> ·
    <a href="https://github.com/AlishaAng/safefeat/issues">Issues &amp; Ideas</a> ·
  </p>

  <hr class="sf-rule">

  <div class="sf-cards">

    <div class="sf-card">
      <div class="sf-card-head">
        <span class="sf-card-icon">🚀</span>
        <strong>Getting Started</strong>
      </div>
      <hr class="sf-card-rule">
      <p>New to <em>safefeat</em>? The getting started guide walks through installation, core concepts, and your first leakage-safe feature set.</p>
      <a class="sf-card-link" href="getting-started/">To the getting started guide →</a>
    </div>

    <div class="sf-card">
      <div class="sf-card-head">
        <span class="sf-card-icon">📖</span>
        <strong>User Guide</strong>
      </div>
      <hr class="sf-card-rule">
      <p>Understand how point-in-time joins work, what the spine pattern is, and how to avoid silent data leakage in ML pipelines.</p>
      <a class="sf-card-link"href="concepts/">To the user guide →</a>
    </div>

    <div class="sf-card">
      <div class="sf-card-head">
        <span class="sf-card-icon">⚙️</span>
        <strong>API Reference</strong>
      </div>
      <hr class="sf-card-rule">
      <p>Detailed description of <code>build_features</code>, <code>WindowAgg</code>, <code>RecencyBlock</code>, and all configuration options.</p>
      <a class="sf-card-link"href="api/">To the API reference →</a>
    </div>

    <div class="sf-card">
      <div class="sf-card-head">
        <span class="sf-card-icon">🐙</span>
        <strong>Contributing</strong>
      </div>
      <hr class="sf-card-rule">
      <p>Found a bug or want to improve safefeat? The repository is open — contributions, issues, and feedback are welcome.</p>
      <a class="sf-card-link"href="https://github.com/AlishaAng/safefeat">To the GitHub repository →</a>
    </div>

  </div>

</div>

<style>

.sf-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.sf-logo {
  height: 36px;
  width: auto;
  margin-top: -50px;
}

.sf-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 0 4rem;
}

.sf-title {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  /* border-bottom: 1px solid var(--md-default-fg-color--lightest) !important; */
  /* padding-bottom: 0.5rem !important; */
  /* margin-bottom: 1rem !important; */
}

.sf-desc {
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.sf-links {
  font-size: 0.875rem;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0;
}
.sf-links a {
  color: var(--md-accent-fg-color);
  text-decoration: none;
}
.sf-links a:hover { text-decoration: underline; }

.sf-rule {
  border: none;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  margin: 1.75rem 0;
}

.sf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.sf-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 6px;
  padding: 1.1rem 1.1rem 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sf-card:hover {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.sf-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.sf-card-icon { font-size: 1.1rem; }

.sf-card-rule {
  border: none;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  margin: 0.6rem 0 0.75rem;
}

.sf-card p {
  font-size: 0.84rem;
  color: var(--md-default-fg-color--light);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.sf-card a {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--md-accent-fg-color);
  text-decoration: none;
}
.sf-card a:hover { text-decoration: underline; }

.sf-card {
  position: relative;
}
.sf-card .sf-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.md-content__inner { padding-top: 0 !important; }
</style>

{% else %}
  {{ super() }}
{% endif %}
{% endblock %}
