// Methodology page — the trust contract, the data sources, the math.
// This is what every score on the site links back to. Visible from /#/methodology
// and from the article footer + footer link.

function MethodologyPage({ onNav }) {
  return (
    <div className="page-insights-v2 article-detail">
      <section className="article-detail-hero">
        <div className="article-detail-inner">
          <button className="article-back" onClick={() => onNav("home")}>← Back home</button>
          <div className="article-meta-row">
            <span className="insight-tag">v1.0</span>
            <span className="article-cat">Methodology</span>
          </div>
          <h1 className="article-title-big">How Shipping Clarity scores carriers — and how we honor the trust drivers place in us.</h1>
          <p className="article-dek">
            Every carrier in our directory is rated on the same nine metrics, weighted
            by the use case at hand, with the data behind every score made public.
            This page explains exactly how that works — including the trust contract
            with the drivers, dispatchers, and dock workers who contribute ground-truth
            signal to the platform.
          </p>
          <div className="article-byline">
            <span className="author-dot" />
            <span><strong>Shipping Clarity Editorial</strong> · v1.0, last updated April 2026</span>
          </div>
        </div>
      </section>

      <section className="article-body">
        <div className="article-body-inner">
          <h2 className="article-h2">The nine metrics</h2>
          <p className="article-p">Every carrier in every city is scored 0–100 on:</p>
          <ol className="method-list">
            <li><strong>On-time delivery</strong> — does the package arrive when promised?</li>
            <li><strong>Damage rate</strong> — does it arrive intact?</li>
            <li><strong>Customer service</strong> — when something goes wrong, can you reach a human?</li>
            <li><strong>Tracking quality</strong> — can you see where your shipment is, in real time?</li>
            <li><strong>Transit time</strong> — how fast, accounting for the city's geography?</li>
            <li><strong>Price</strong> — what does the same shipment actually cost?</li>
            <li><strong>Pickup reliability</strong> — do they show up in the window they promised?</li>
            <li><strong>Professionalism</strong> — driver and dock conduct, equipment condition?</li>
            <li><strong>Infrastructure</strong> — the local operational reality: hub status, capacity, redundancy, lane health.</li>
          </ol>
          <p className="article-p">
            Each metric is itself the weighted sum of multiple <strong>factors</strong> —
            discrete, measurable inputs from public data, sampled shipments, surveys, and verified
            driver intel.
          </p>

          <h2 className="article-h2">Driver Protections — the trust contract</h2>
          <p className="article-p">
            Drivers, dispatchers, and dock workers are the source of the operational truth on this
            site. Their willingness to share what they know depends on us protecting them.
            <strong> The rules below are not aspirational — they're how the platform is built in code.</strong>
          </p>
          <h3 className="article-h3">Drivers choose the visibility of every tip</h3>
          <p className="article-p">When you submit a tip on this site, you choose what happens to it:</p>
          <ul className="method-list">
            <li><strong>Sealed (default)</strong> — your tip is used only as anonymous data. Carriers see counts and severity (<em>"Reports of dock conditions, severity Moderate, 7 in Q1 2026"</em>), never your words, never any way to identify you. The pattern informs the carrier's score and our editorial direction; the text stays under lock.</li>
            <li><strong>Public (you opt in)</strong> — your tip is published on the terminal page, anonymously. We then formally contact the carrier for their response and publish it alongside, as a piece of journalism. You accept that your employer may see what you reported, even though your name is never attached.</li>
          </ul>
          <p className="article-p">
            The public path is the only way carriers ever see verbatim driver words on this site,
            and it requires an explicit choice from you on a checkbox that's off by default.
          </p>

          <h3 className="article-h3">You can always delete your data</h3>
          <p className="article-p">
            You receive a token at submission time. Use it any time to remove your contribution.
          </p>
          <ul className="method-list">
            <li><strong>Sealed tips</strong> — full hard delete. Your row is removed; only the anonymous severity-tagged count remains in our aggregates.</li>
            <li><strong>Public tips not yet through editorial outreach</strong> — full hard delete.</li>
            <li><strong>Published journalism with a carrier response</strong> — your link to the story is severed, your identifying data scrubbed. The published reporting stays in the public record per journalism standards, with a visible note that the original reporter has withdrawn.</li>
          </ul>
          <p className="article-p">
            No accounts required. No deletion fee at any tier. Carriers can never pay to suppress
            submissions, and we monitor for patterns that look like coordinated retraction
            campaigns.
          </p>

          <h3 className="article-h3">What carriers see — and don't see</h3>
          <p className="article-p"><strong>A subscribed carrier can see:</strong></p>
          <ul className="method-list">
            <li>Already-public mentions of the carrier, where they exist — we surface what's already in the open, not recreate exposure.</li>
            <li>Published journalism that drew from on-site tips, after the editorial process and the carrier's own response.</li>
            <li>Aggregate counts of sealed reports at their facilities, by intel type and severity.</li>
          </ul>
          <p className="article-p"><strong>A carrier can never see:</strong></p>
          <ul className="method-list">
            <li>Verbatim text from a sealed submission.</li>
            <li>The identity, IP, email, or device of any submitter.</li>
            <li>Aggregates so granular they identify a single driver (we suppress small-N windows).</li>
            <li>A direct feed of intel as it arrives.</li>
          </ul>

          <h3 className="article-h3">What we never do</h3>
          <ul className="method-list">
            <li>Sell the raw intel feed at any subscription tier.</li>
            <li>Allow carriers to "buy out" specific reports.</li>
            <li>Tell carriers when a driver retracts a tip.</li>
            <li>Let scoring or badge outcomes be influenced by sponsorship.</li>
          </ul>

          <h2 className="article-h2">How we build the picture</h2>
          <p className="article-p">Every score has a basis. We blend four classes of input:</p>
          <ul className="method-list">
            <li><strong>Public-record data</strong> — federal regulatory filings, SEC disclosures, and other public-record sources. Covers fleet size, terminal locations, sortation facilities, capex, layoffs, import/export volume.</li>
            <li><strong>Sampled</strong> — our own test shipments through each carrier on standardized routes. Covers transit time, tracking quality, damage rate, price.</li>
            <li><strong>Survey</strong> — verified shipper-submitted reviews and complaints on this site. Covers customer service, pickup reliability, professionalism, damage stories.</li>
            <li><strong>Operator network</strong> — verified driver-submitted intel. Covers local hub status, capacity issues, lane conditions, the stuff people on the dock and behind the wheel know first.</li>
          </ul>
          <p className="article-p">
            Each row of factor data is verified by an editor before it surfaces. We don't disclose
            specific feeds at the row level — that's our pipeline, and exposing it would let
            carriers game the inputs. The methodology is open; the sources are not.
          </p>

          <h3 className="article-h3">Operator-network signal · how we listen</h3>
          <p className="article-p">
            Drivers, dispatchers, and dock workers have always talked to each other in public — on
            forums, in subreddits dedicated to their carrier, on industry message boards. We listen to
            the parts of that conversation that are already public, paraphrase the patterns, and never
            republish a verbatim post or a username on this site.
          </p>
          <p className="article-p">
            Specifically, we follow these rules — they're how the platform is built in code, not
            aspirations:
          </p>
          <ul className="method-list">
            <li><strong>Public-only.</strong> We consume RSS syndication feeds the platforms publish for exactly this kind of consumption. We don't scrape HTML, we don't hit rate-limited API endpoints, and we don't bypass any access control.</li>
            <li><strong>Polite by construction.</strong> Our ingester identifies itself with a working contact email in the User-Agent and paces requests at 2+ seconds apart. We honor each platform's robots.txt.</li>
            <li><strong>Aggregated, not republished.</strong> What surfaces publicly is a count and a paraphrased gist (<em>"three corroborated reports of carrier X refusing pickups in metro Y over seven days"</em>). The verbatim post text and any user identifier stay under lock; only the editor sees them.</li>
            <li><strong>Never used to train models.</strong> The classified output feeds our editorial pipeline and our carrier scores. It is never used to train, fine-tune, or seed any foundation or commercial model — internally or externally.</li>
            <li><strong>Operator-deletable.</strong> If a driver realizes a post they made publicly was caught in our ingest and they don't want it in our store, they can email <a href="mailto:tips@shippingclarity.com">tips@shippingclarity.com</a> and we hard-delete it the same week. Same trust contract as the on-site tip line.</li>
          </ul>
          <p className="article-p">
            This posture sits squarely in the editorial fair-use tradition that journalists and
            industry analysts have used to write about public forum discourse for decades: factual
            public posts, paraphrased extracts, no commercial republication, no privacy invasion.
            It's the same posture <em>FreightWaves</em>, <em>JOC</em>, and the trade press use when
            they cite "what drivers are saying online" — we're just doing it at scale and with the
            data integrity to make it count toward a carrier's score.
          </p>

          <h2 className="article-h2">How scores are computed</h2>
          <pre className="method-formula">{`Carrier Score = Σ (Metric Score × Use Case Weight)
Metric Score   = Σ (Factor Value × Factor Weight)`}</pre>
          <p className="article-p">
            That's it. There's no human override on the math. Scores are computed by a database
            view that recomputes whenever underlying data updates. If we change a weight, every
            historical score recomputes — and we publish the change in the methodology changelog
            at the bottom of this page.
          </p>

          <h2 className="article-h2">What sponsorship does — and doesn't — do</h2>
          <p className="article-p"><strong>Does:</strong></p>
          <ul className="method-list">
            <li>Lets carriers amplify a badge they earned (bigger placement, ad units, badge licensing).</li>
            <li>Pays for the journalism and the data work.</li>
          </ul>
          <p className="article-p"><strong>Does not:</strong></p>
          <ul className="method-list">
            <li>Alter scores, weights, or ranks. Ever.</li>
            <li>Affect whether a carrier wins a Best in Class award.</li>
            <li>Change the verdict tone — sponsored profiles get the same honest "trade-off" calls as everyone else.</li>
          </ul>

          <h2 className="article-h2">What's missing in v1.0</h2>
          <p className="article-p">We're being upfront:</p>
          <ul className="method-list">
            <li><strong>Sampled shipments</strong> are not yet at the volume we want them. Currently sampling 500/quarter; target is 5,000/quarter by year-end.</li>
            <li><strong>Shipper surveys</strong> require traffic to mean anything. We weight them lightly until we have meaningful volume — usually 50+ verified responses per (carrier, city, quarter).</li>
            <li><strong>Operator-network intel</strong> is helpful but unverified at intake. Tips raise <em>confidence</em> on facts already supported by other public sources (regulatory filings, news clusters, official advisories); they rarely move a score on their own.</li>
            <li><strong>International coverage</strong> is currently strongest at LAX, JFK, and SFO. Other ports come online quarterly.</li>
          </ul>

          <h2 className="article-h2">Questions, corrections, disputes</h2>
          <ul className="method-list">
            <li>Carriers who believe a factor value is wrong can submit a correction request. We respond within 5 business days with the source we used and either accept or reject the correction with a written explanation.</li>
            <li>Shippers who think a verdict is misleading can flag it the same way.</li>
            <li>Methodology disputes (e.g. "you're weighting price too high for International") are public; they go in the changelog with our response.</li>
          </ul>

          <p className="article-p" style={{ marginTop: 40, fontStyle: "italic", color: "var(--ink-soft)" }}>
            The credibility of this site rests on every score being defensible. We're committed to making that real.
          </p>

          <div className="article-footer">
            <div className="article-cta">
              <h3>Ready to see this in action?</h3>
              <p>Subscribe to your metro's Pulse for the daily breakdown — every score, every carrier, every change.</p>
              <button className="btn-primary" onClick={() => onNav("home")}>Back to home →</button>
            </div>
          </div>
        </div>
      </section>
    </div>
  );
}

window.MethodologyPage = MethodologyPage;
