/* ==========================================================================
   FTL · Shared Stylesheet
   Used by:
     - ftl-landing.html      (the projects index)
     - widget-template.html  (per-widget preview pages)
   ========================================================================== */


/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root {
  --bg: #fff8e7;
  --ink: #0a0a0a;
  --orange: #ff3e00;
  --yellow: #ffd60a;
  --blue: #1d4ed8;
  --green: #2d8f63;
  --pink: #ff7eb6;
}


/* ==========================================================================
   2. RESET + BASE
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Archivo', sans-serif;
  min-height: 100vh;
  position: relative;
}

/* subtle grain overlay (applies to every page) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.06;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 32px 80px;
  position: relative;
  z-index: 2;
}


/* ==========================================================================
   3. HEADER (shared)
   ========================================================================== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 56px;
  padding: 16px 0;
  border-bottom: 2px solid var(--ink);
}
.logo {
  font-family: 'Caprasimo', serif;
  font-size: 32px;
  color: var(--orange);
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo a {
  color: inherit;
  text-decoration: none;
}
.header-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
}
.header-link {
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.header-link:hover { color: var(--orange); }


/* ==========================================================================
   4. PILLS + STATUS DOT (shared)
   ========================================================================== */
.pill {
  background: var(--ink);
  color: var(--bg);
  padding: 7px 14px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.pill-dot {
  width: 6px; height: 6px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }


/* ==========================================================================
   5. SECTION HEAD (shared)
   ========================================================================== */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-label {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  display: inline-block;
  padding: 8px 16px;
  border-radius: 100px;
}
.section-meta {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}


/* ==========================================================================
   6. HERO (shared base + page variants)
   ========================================================================== */
.hero {
  margin-bottom: 64px;
  position: relative;
}
.hero h1 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  margin-bottom: 28px;
  font-size: clamp(56px, 11vw, 156px); /* landing default */
}
.hero h1 .accent {
  color: var(--orange);
  font-family: 'Caprasimo', serif;
  font-weight: 400;
  text-transform: none;
  font-style: italic;
  letter-spacing: -0.02em;
}
.hero h1 .highlight {
  background: var(--yellow);
  padding: 0 14px 6px;
  display: inline-block;
  transform: rotate(-1.5deg);
  margin: 0 4px;
}
.hero-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  align-items: flex-end;
  justify-content: space-between;
}
.hero p {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.4;
  max-width: 580px;
  font-weight: 500;
}

/* shared stat / meta column */
.hero-stats,
.hero-meta {
  display: flex;
  gap: 32px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hero-meta { gap: 28px; }
.hero-stat-num,
.hero-meta-num {
  display: block;
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--orange);
  margin-bottom: 4px;
}
.hero-stat-num { font-size: 32px; }
.hero-meta-num { font-size: 26px; }

/* widget-template hero variant: smaller h1 + breadcrumbs above it */
.hero--widget { margin-bottom: 48px; }
.hero--widget h1 {
  font-size: clamp(44px, 8vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}
.hero--widget p {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.45;
}

.crumbs {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  opacity: 0.7;
}
.crumbs a {
  color: var(--ink);
  text-decoration: none;
}
.crumbs a:hover { color: var(--orange); }
.crumbs .sep { margin: 0 10px; opacity: 0.4; }


/* ==========================================================================
   7. PROJECT LINK BASE (shared)
   ========================================================================== */
.project-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ==========================================================================
   8. LANDING ONLY · PROJECTS GRID
   ========================================================================== */
.projects-area {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  min-height: 620px;
  margin-bottom: 96px;
}
.featured-card {
  grid-column: 1;
  grid-row: 1 / span 2;
  background: var(--orange);
  color: #fff;
  border-radius: 28px;
  padding: 48px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.featured-card:hover { transform: rotate(-0.5deg) scale(1.005); }
.featured-card::after {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  background: var(--yellow);
  border-radius: 50%;
  bottom: -120px; right: -100px;
  opacity: 0.25;
  transition: transform 0.6s ease;
}
.featured-card:hover::after { transform: scale(1.15); }

.featured-top { position: relative; z-index: 2; }
.featured-tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.featured-tag {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  color: var(--orange);
  padding: 7px 13px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.featured-tag.alt {
  background: var(--ink);
  color: #fff;
}
.featured-card h2 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(60px, 9vw, 132px);
  line-height: 0.82;
  margin-bottom: 28px;
  letter-spacing: -0.05em;
}
.featured-card .desc {
  font-size: 18px;
  line-height: 1.45;
  max-width: 520px;
  margin-bottom: 32px;
  font-weight: 500;
}
.featured-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  padding-top: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
}
.featured-bottom .arrow {
  font-size: 28px;
  transition: transform 0.3s;
  line-height: 1;
}
.featured-card:hover .arrow { transform: translateX(8px); }

/* secondary cards */
.secondary-card {
  border-radius: 20px;
  padding: 28px 26px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.secondary-card:hover { transform: scale(1.025) rotate(-0.8deg); }
.secondary-card.go     { background: var(--blue);   color: #fff; }
.secondary-card.pwl    { background: var(--yellow); color: var(--ink); }
.secondary-card.ppm    { background: var(--ink);    color: var(--bg); }
.secondary-card.signal { background: var(--green);  color: #fff; }

.secondary-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.secondary-card .num {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  opacity: 0.7;
  font-weight: 700;
}
.secondary-card .pub-name {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
  margin-bottom: 8px;
}
.secondary-card h3 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 0.88;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}
.secondary-card .desc {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.92;
  font-weight: 500;
}
.secondary-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1.5px solid currentColor;
  padding-top: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
  margin-top: 20px;
}
.secondary-bottom .arrow {
  font-size: 18px;
  transition: transform 0.3s;
}
.secondary-card:hover .arrow { transform: translateX(6px); }


/* ==========================================================================
   9. LANDING ONLY · WIDGETS LIST
   ========================================================================== */
.widgets-section { margin-bottom: 64px; }
.widgets-area {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.widget-card {
  background: var(--bg);
  border: 2px solid var(--ink);
  padding: 22px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  min-height: 160px;
  justify-content: space-between;
}
.widget-card:hover {
  background: var(--yellow);
  transform: rotate(-1.5deg) translateY(-3px);
  box-shadow: 4px 4px 0 var(--ink);
}
.widget-card .widget-num {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.6;
}
.widget-card h4 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-top: 8px;
}
.widget-card .widget-desc {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.7;
  margin-top: 6px;
}


/* ==========================================================================
   10. WIDGET TEMPLATE ONLY · TOOLBAR + SIZE TOGGLE
   ========================================================================== */
.toolbar {
  background: var(--ink);
  color: var(--bg);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.toolbar-left {
  display: flex;
  gap: 14px;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.toolbar-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}

.size-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
}
.size-btn {
  background: transparent;
  border: none;
  color: var(--bg);
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 9px 18px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.size-btn:hover { color: var(--yellow); }
.size-btn.active {
  background: var(--orange);
  color: #fff;
}
.size-btn.active:hover { color: #fff; }
.size-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.size-btn .px {
  font-weight: 400;
  opacity: 0.7;
  font-size: 10px;
}
.size-btn.active .px { opacity: 0.9; }


/* ==========================================================================
   11. WIDGET TEMPLATE ONLY · STAGE + IFRAME SHELL
   ========================================================================== */
.stage {
  background: #f1e9d0;
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: 40px 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 600px;
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(10,10,10,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,10,10,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}

.frame-shell {
  background: #fff;
  border-radius: 14px;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
  position: relative;
  width: 100%;
  transition: max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.frame-shell.size-mobile  { max-width: 356px; }
.frame-shell.size-general { max-width: 600px; }

.frame-chrome {
  background: var(--ink);
  color: var(--bg);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
}
.chrome-dots { display: inline-flex; gap: 5px; }
.chrome-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.chrome-dots span:nth-child(1) { background: #ff5f56; }
.chrome-dots span:nth-child(2) { background: #ffbd2e; }
.chrome-dots span:nth-child(3) { background: #27c93f; }
.chrome-url {
  flex: 1;
  text-align: center;
  opacity: 0.6;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chrome-size {
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.frame-shell iframe {
  display: block;
  width: 100%;
  height: 700px;
  border: 0;
  background: #fff;
}


/* ==========================================================================
   12. WIDGET TEMPLATE ONLY · NOTES
   ========================================================================== */
.notes {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.note-card {
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 20px 22px;
}
.note-card .note-num {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.6;
  margin-bottom: 8px;
}
.note-card h4 {
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 16px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.note-card p {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  opacity: 0.75;
}
.note-card code {
  background: var(--yellow);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
}


/* ==========================================================================
   13. FOOTER (shared)
   ========================================================================== */
.footer {
  border-top: 2px solid var(--ink);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
}
.footer-mark {
  font-family: 'Caprasimo', serif;
  font-size: 18px;
  color: var(--orange);
}
.footer-meta {
  display: flex;
  gap: 24px;
}
.footer a {
  color: var(--ink);
  text-decoration: none;
}
.footer a:hover { color: var(--orange); }

/* widget-template footer needs extra top space since it follows the notes grid */
.footer--widget { margin-top: 80px; }


/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
  .projects-area {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    min-height: auto;
  }
  .featured-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .container { padding: 20px 18px 60px; }
  .header { margin-bottom: 36px; }
  .header-link { display: none; }

  /* landing */
  .featured-card { padding: 32px 26px; border-radius: 22px; }
  .projects-area {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 64px;
  }
  .secondary-card { padding: 24px 22px; }
  .hero { margin-bottom: 48px; }
  .hero-stats { gap: 24px; }
  .hero-stat-num { font-size: 24px; }

  /* widget template */
  .stage { padding: 24px 12px; border-radius: 18px; }
  .toolbar { padding: 12px 14px; }
  .size-btn { padding: 8px 14px; font-size: 11px; }
  .size-btn .px { display: none; }
}


/* ==========================================================================
   15. ENTRY ANIMATIONS
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* shared elements rise on load */
.header        { animation: rise 0.6s ease both; }
.hero          { animation: rise 0.7s 0.1s ease both; }
.footer        { animation: rise 0.6s 0.6s ease both; }

/* landing-specific stagger */
.featured-card        { animation: rise 0.7s 0.2s  ease both; }
.secondary-card.go    { animation: rise 0.6s 0.3s  ease both; }
.secondary-card.pwl   { animation: rise 0.6s 0.35s ease both; }
.secondary-card.ppm   { animation: rise 0.6s 0.4s  ease both; }
.secondary-card.signal{ animation: rise 0.6s 0.45s ease both; }
.widgets-section      { animation: rise 0.6s 0.5s  ease both; }

/* widget-template-specific stagger */
.toolbar { animation: rise 0.6s 0.2s ease both; }
.stage   { animation: rise 0.6s 0.3s ease both; }
.notes   { animation: rise 0.6s 0.4s ease both; }
