#!/usr/bin/env python3
# ---------------------------------------------------------------------------
# hero-inner.html — option sheet for the INNER SERVICE hero (Car Accident
# Claims). Round 1: A1–A6.
#
# Every option carries the same five things, so the comparison is about layout
# and nothing else:
#   1 breadcrumb   2 the practice hexagon (.hex, geometry fixed)
#   3 the h1       4 a photograph        5 the contact block
#
# Copy is the live page's or home_v1's; nothing here is newly written.
# ---------------------------------------------------------------------------
import io, sys

OUT = "/srv/apps/leaguelaw/wp-content/prototype/hero-inner.html"

PHOTO = "/wp-content/uploads/passengerclaim.png"   # 1688×1125, monochrome
PHOTO2 = "img/injuries-thumb-clean.jpg"            # 411×258
TEL = "tel:+12508880002"

CSS = r"""
  :root { --orange:#EF6D3E; --teal:#46ADC8; --brown:#423C37; --deep:#B44A33;
          --paper:#F9F9F9; --line:#E4E1DC; --muted:#6B6B6B; }
  * { box-sizing:border-box; margin:0; padding:0; }
  body { background:#ECEAE5; font-family:"Open Sans",sans-serif; color:var(--muted);
         min-width:1380px; padding-bottom:90px; }
  a { text-decoration:none; color:inherit; } img { display:block; }
  h1,h2,h3 { font-weight:inherit; }
  .wrap { width:1280px; margin:0 auto; position:relative; }

  .page-head { max-width:1320px; margin:44px auto 0; }
  .page-head h1 { font-family:Raleway,sans-serif; font-weight:800; font-size:26px; color:var(--brown); }
  .page-head p { font-size:14px; margin-top:8px; max-width:92ch; line-height:1.75; }
  .box { margin-top:16px; font-size:13px; background:#fff; border-left:3px solid var(--teal);
         padding:13px 17px; max-width:92ch; line-height:1.85; }
  .box.warn { border-left-color:var(--orange); }
  .box.ask { border-left-color:var(--brown); }
  .box b { color:var(--brown); }
  .box ul { margin:6px 0 0 18px; } .box li { margin-bottom:4px; }
  .box code { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px; background:#F2F0EB; padding:1px 5px; }
  .box table { border-collapse:collapse; margin-top:8px; font-size:12.5px; }
  .box td, .box th { border:1px solid var(--line); padding:5px 10px; text-align:left; }
  .box th { background:#F6F4EF; font-family:Raleway,sans-serif; font-size:11.5px;
            letter-spacing:.06em; text-transform:uppercase; color:var(--brown); }
  .swatch { display:inline-block; width:13px; height:13px; vertical-align:-2px; margin-right:6px;
            border:1px solid rgba(0,0,0,.12); }

  .roundhead { max-width:1320px; margin:64px auto 0; border-top:2px solid var(--brown); padding-top:14px;
               font-family:Raleway,sans-serif; font-weight:800; font-size:14px; letter-spacing:.14em;
               text-transform:uppercase; color:var(--brown); }
  .opt { margin:44px 0 0; }
  .opt-label { max-width:1320px; margin:0 auto 10px; display:flex; align-items:baseline; gap:14px; flex-wrap:wrap; }
  .opt-label .tag { font-family:Raleway,sans-serif; font-weight:800; font-size:15px; letter-spacing:.08em;
                    color:#fff; background:var(--brown); padding:5px 14px; }
  .opt-label .name { font-family:Raleway,sans-serif; font-weight:700; font-size:16px; color:var(--brown); }
  .opt-label .h { font-family:Raleway,sans-serif; font-weight:800; font-size:11px; letter-spacing:.1em;
                  color:#fff; background:var(--teal); padding:4px 9px; white-space:nowrap; }
  .opt-label .what { font-size:13px; max-width:82ch; line-height:1.65; flex-basis:100%; }
  .opt-note { max-width:82ch; margin:10px auto 0; font-size:12.5px; line-height:1.7; color:var(--muted);
              border-left:2px solid var(--line); padding-left:12px; }
  .opt-note b { color:var(--brown); }
  .stage { width:100%; box-shadow:0 10px 28px rgba(66,60,55,.10); overflow:hidden; background:#fff; }

  /* ---------- header stand-in (93px, same as every other sheet) ---------- */
  .sh { padding:22px 0; background:var(--paper); border-bottom:1px solid var(--line); }
  .sh .wrap { display:flex; justify-content:space-between; align-items:center; }
  .sh .logo img { height:48px; width:auto; }
  .snav { display:flex; gap:30px; font-family:Raleway,sans-serif; font-weight:600; font-size:13px;
          letter-spacing:.06em; text-transform:uppercase; color:var(--brown); }
  .snav .cur { color:var(--orange); box-shadow:inset 0 -2px 0 var(--orange); }
  .sphone { text-align:right; font-family:Raleway,sans-serif; }
  .sphone .cn { display:block; color:var(--teal); font-weight:600; font-size:12.5px; letter-spacing:.14em; }
  .sphone .num { color:var(--orange); font-weight:800; font-size:24px; }

  /* =====================================================================
     THE HEXAGON, FIXED.
     A regular pointy-top hexagon has height 2R and width √3·R, so
        width / height = √3 / 2 = 0.8660254   — always.
     The live site draws it 50×65 (ratio 0.769): its diagonal sides come out
     8.3% shorter than its vertical sides, which is the squash. Declaring the
     RATIO instead of a second pixel value makes it impossible to get wrong.
     The glyph is centred by the flexbox alone — the live 3px nudge is gone;
     on a pointy-top hexagon the geometric centre IS the optical centre.
     ===================================================================== */
  .hex { aspect-ratio:.8660254; display:flex; align-items:center; justify-content:center;
         clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%); flex:none; }
  .hex i { line-height:1; display:block; }
  .hex.s { width:56px; }  .hex.s i { font-size:24px; }
  .hex.m { width:66px; }  .hex.m i { font-size:28px; }
  .hex.o { background:var(--orange); color:#fff; }
  .hex.t { background:var(--teal);   color:#fff; }
  .hex.w { background:#fff;          color:var(--orange); }

  /* ---------- shared hero pieces ---------- */
  /* line-height is DECLARED, not inherited: the hero has to render at the same
     height on any host page, and a host that sets an absolute body line-height
     (the live-site replica sets 23.1px) would otherwise grow the breadcrumb
     strip by 11px. 12px is exactly what `normal` renders here. */
  .crumbs { display:flex; align-items:center; gap:9px; font-family:Raleway,sans-serif; font-weight:700;
            font-size:10.5px; line-height:12px; letter-spacing:.14em; text-transform:uppercase; }
  .crumbs i { width:6px; height:6.93px; background:currentColor; opacity:.45; display:block; flex:none;
              clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%); }
  .crumbs.dark { color:#A8A29A; } .crumbs.dark .here { color:var(--brown); }
  .crumbs.light { color:rgba(255,255,255,.72); } .crumbs.light .here { color:#fff; }
  .cbar { background:#fff; border-bottom:1px solid var(--line); padding:14px 0; }
  .cbar2 { background:var(--brown); padding:11px 0; }

  .htitle { font-family:Raleway,sans-serif; font-weight:300; letter-spacing:.09em; text-transform:uppercase;
            line-height:1.14; }
  .hsub { font-family:Raleway,sans-serif; font-weight:700; line-height:1.45; }
  .hrule { display:block; height:1px; background:currentColor; opacity:.38; }

  /* contact block — same parts everywhere: eyebrow · phone · availability ·
     two fields · two buttons */
  .cc .eyeb { font-family:Raleway,sans-serif; font-weight:600; font-size:12.5px; letter-spacing:.13em;
              text-transform:uppercase; display:block; }
  .cc .num  { font-family:Raleway,sans-serif; font-weight:800; font-size:34px; letter-spacing:.01em;
              display:block; margin:3px 0 4px; }
  .cc .avail{ font-size:12.5px; line-height:1.65; display:block; }
  .cc .frow { display:flex; gap:9px; margin:15px 0 9px; }
  .cc input { flex:1; min-width:0; border:0; font-family:"Open Sans",sans-serif; font-size:13px;
              padding:11px 12px; color:#444; outline:none; background:#fff; }
  .cc input::placeholder { color:#9A948B; }
  .cc .btns { display:flex; gap:9px; }
  .cc .btn { flex:1; text-align:center; font-family:Raleway,sans-serif; font-weight:700; font-size:12.5px;
             letter-spacing:.06em; text-transform:uppercase; padding:12px 10px; cursor:pointer; }
  .cc .btn.solid { background:var(--orange); color:#fff; }
  .cc .btn.ghost { border:1px solid rgba(255,255,255,.55); color:#fff; }
  .cc .btn.ghostd{ border:1px solid var(--line); color:var(--brown); }
  .cc.on-brown { color:#fff; } .cc.on-brown .eyeb { color:#EFE9E2; } .cc.on-brown .avail { color:#C9C3BB; }
  .cc.on-deep  { color:#fff; } .cc.on-deep  .eyeb { color:#FBE3D8; } .cc.on-deep  .avail { color:#FBE3D8; }
  .cc.on-white .eyeb { color:var(--teal); } .cc.on-white .num { color:var(--orange); }
  .cc.on-white .avail { color:var(--muted); }
  .cc.on-white input { border:1px solid var(--line); }

  .phtag { position:absolute; left:10px; bottom:10px; background:rgba(66,60,55,.74); color:#fff;
           font-size:9.5px; letter-spacing:.08em; text-transform:uppercase; padding:4px 8px; z-index:3; }

  /* ---------- A1 · three panels, the reference mapped ---------- */
  .a1 .band { display:flex; height:300px; }
  /* padding-left resolves against the BAND (full width), so the type starts
     exactly on the container's left edge at any viewport */
  .a1 .tp { width:520px; flex:none; background:var(--orange); color:#fff;
            padding:38px 54px 38px calc((100% - 1280px)/2);
            position:relative; display:flex; flex-direction:column; justify-content:center; }
  .a1 .tp .hex { margin-bottom:16px; }
  .a1 .tp .htitle { font-size:38px; }
  .a1 .tp .hsub { font-size:20px; margin-top:14px; }
  .a1 .tp .hrule { margin:14px 0; width:110px; }
  /* the diagonal cut of the reference. z-index so the wedge paints OVER the
     photograph, which follows it in the DOM */
  .a1 .tp { z-index:2; }
  .a1 .tp:after { content:""; position:absolute; top:0; right:-38px; bottom:0; width:38px;
                  background:var(--orange); clip-path:polygon(0 0,100% 0,0 100%); }
  .a1 .ph { width:330px; flex:none; position:relative; overflow:hidden; }
  .a1 .ph img { width:100%; height:100%; object-fit:cover; }
  .a1 .cp { flex:1; background:var(--brown); display:flex; align-items:center; justify-content:flex-end;
            padding-right:calc((100% - 1280px)/2); }
  .a1 .cp .cc { width:430px; }

  /* ---------- A2 · same panels, brown breadcrumb bar, no white strip ------ */
  .a2 .band { display:flex; height:290px; }
  .a2 .tp { width:520px; flex:none; background:var(--deep); color:#fff;
            padding:34px 54px 34px calc((100% - 1280px)/2);
            display:flex; flex-direction:column; justify-content:center; }
  .a2 .tp .htitle { font-size:34px; }
  .a2 .tp .hsub { font-size:14px; font-weight:400; margin-top:12px; opacity:.92; }
  .a2 .tp .hrule { margin:13px 0; width:96px; }
  .a2 .tp .hexrow { display:flex; align-items:center; gap:14px; margin-bottom:14px; }
  .a2 .tp .hexrow span.k { font-family:Raleway,sans-serif; font-weight:700; font-size:11.5px;
                           letter-spacing:.18em; text-transform:uppercase; }
  .a2 .ph { width:340px; flex:none; position:relative; overflow:hidden; }
  .a2 .ph img { width:100%; height:100%; object-fit:cover; }
  .a2 .cp { flex:1; background:var(--brown); display:flex; align-items:center; justify-content:flex-end;
            padding-right:calc((100% - 1280px)/2); }
  .a2 .cp .cc { width:430px; }

  /* ---------- A3 · one photograph, two cards floating on it -------------- */
  .a3 .band { position:relative; height:360px; overflow:hidden; }
  .a3 .band > img { width:100%; height:100%; object-fit:cover; object-position:50% 26%; }
  .a3 .sc { position:absolute; inset:0; background:linear-gradient(90deg,rgba(24,20,17,.62) 0,rgba(24,20,17,.30) 46%,rgba(24,20,17,.62) 100%); }
  .a3 .lay { position:absolute; inset:0; }
  .a3 .lay .wrap { height:100%; display:flex; align-items:center; justify-content:space-between; }
  .a3 .crumbs { position:absolute; top:22px; left:50%; transform:translateX(-640px); }
  .a3 .card { background:var(--orange); color:#fff; padding:26px 30px; width:430px; }
  .a3 .card .hex { margin-bottom:14px; }
  .a3 .card .htitle { font-size:32px; }
  .a3 .card .hsub { font-size:19px; margin-top:12px; }
  .a3 .ccard { background:var(--brown); width:430px; padding:26px 30px; }

  /* ---------- A4 · half brown, half photograph with an inset card -------- */
  .a4 .band { display:flex; height:380px; }
  .a4 .lft { width:720px; flex:none; background:var(--brown); color:#fff; display:flex; align-items:center;
             padding-left:calc((100% - 1280px)/2); padding-right:60px; }
  .a4 .lft .crumbs { margin-bottom:20px; }
  .a4 .lft .hexrow { display:flex; align-items:center; gap:16px; margin-bottom:16px; }
  .a4 .lft .htitle { font-size:36px; }
  .a4 .lft .hsub { font-size:15px; font-weight:400; margin-top:14px; color:#C9C3BB; max-width:46ch; }
  .a4 .lft .ph2 { display:inline-flex; align-items:baseline; gap:10px; margin-top:18px;
                  font-family:Raleway,sans-serif; }
  .a4 .lft .ph2 .cn { color:var(--teal); font-weight:600; font-size:11px; letter-spacing:.16em;
                      text-transform:uppercase; }
  .a4 .lft .ph2 .n { color:#fff; font-weight:800; font-size:26px; }
  .a4 .rgt { flex:1; position:relative; overflow:hidden; }
  .a4 .rgt img { width:100%; height:100%; object-fit:cover; }
  .a4 .rgt .cc { position:absolute; right:calc((100vw - 1280px)/2); bottom:0; width:430px; background:#fff;
                 border-top:4px solid var(--orange); padding:22px 26px 24px; }

  /* ---------- A5 · the light one: type on paper, photograph as a strip --- */
  .a5 .top { background:#fff; padding:30px 0 40px; }
  .a5 .cols { display:flex; align-items:flex-start; }
  .a5 .lcol { width:768px; flex:none; padding-right:64px; }
  .a5 .lcol .hexrow { display:flex; align-items:center; gap:18px; margin:16px 0 16px; }
  .a5 .lcol .htitle { font-size:40px; color:var(--brown); }
  .a5 .lcol .hsub { font-size:21px; font-weight:400; color:var(--brown); margin-bottom:12px; }
  .a5 .lcol p.lede { font-size:15.5px; line-height:1.85; color:var(--muted); max-width:64ch; }
  .a5 .rcol { flex:1; padding-left:60px; border-left:1px solid var(--line); }
  .a5 .strip { position:relative; height:220px; overflow:hidden; }
  .a5 .strip img { width:100%; height:100%; object-fit:cover; object-position:50% 22%; }

  /* ---------- A6 · photograph + a contact ribbon straddling its edge ----- */
  .a6 .band { position:relative; height:330px; overflow:hidden; }
  .a6 .band .phtag { bottom:auto; top:12px; left:auto; right:12px; }
  .a6 .band img { width:100%; height:100%; object-fit:cover; object-position:50% 24%; }
  .a6 .sc { position:absolute; inset:0; background:linear-gradient(180deg,rgba(24,20,17,.66) 0,rgba(24,20,17,.44) 55%,rgba(24,20,17,.72) 100%); }
  .a6 .mid { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center;
             justify-content:center; color:#fff; text-align:center; padding-bottom:44px; }
  .a6 .mid .crumbs { margin-bottom:18px; }
  .a6 .mid .hex { margin-bottom:16px; }
  .a6 .mid .htitle { font-size:40px; }
  .a6 .mid .hsub { font-size:16px; font-weight:400; margin-top:12px; opacity:.9; }
  .a6 .ribwrap { margin-top:-58px; position:relative; z-index:2; padding-bottom:34px; background:#fff; }
  .a6 .rib { background:var(--brown); padding:20px 34px; display:flex; align-items:center; gap:30px; }
  .a6 .rib .l { flex:none; color:#fff; }
  .a6 .rib .l .eyeb { font-family:Raleway,sans-serif; font-weight:600; font-size:11.5px;
                      letter-spacing:.13em; text-transform:uppercase; color:#EFE9E2; display:block; }
  .a6 .rib .l .num { font-family:Raleway,sans-serif; font-weight:800; font-size:30px; color:#fff; display:block; }
  .a6 .rib .r { flex:1; display:flex; gap:9px; }
  .a6 .rib .r input { flex:1; min-width:0; border:0; font-family:"Open Sans",sans-serif; font-size:13px;
                      padding:12px; outline:none; }
  .a6 .rib .r .btn { flex:none; font-family:Raleway,sans-serif; font-weight:700; font-size:12.5px;
                     letter-spacing:.06em; text-transform:uppercase; padding:12px 18px; cursor:pointer; }
  .a6 .rib .r .btn.solid { background:var(--orange); color:#fff; }
  .a6 .rib .r .btn.ghost { border:1px solid rgba(255,255,255,.55); color:#fff; }
"""

CRUMBS = ('<nav class="crumbs %s"><a href="/">Home</a><i></i><a href="/our-services/">What We Do</a>'
          '<i></i><a href="/our-services/bc-injury-claims/">Injury Claims</a><i></i>'
          '<span class="here">Car Accident Claims</span></nav>')

TITLE = '<h1 class="htitle">Car Accident Claims</h1>'
DECK  = 'League &amp; Williams are Experienced Car Accident Injury Claims Lawyers'
LEDE  = ('Our team of lawyers are experienced in car accident injury claims &amp; work to ensure that '
         'injured victims recover their fullest potential. Free consultations.')


def hexicon(size="s", tone="o"):
    return '<span class="hex %s %s"><i class="fa fa-car"></i></span>' % (size, tone)


def contact(tone, ghost="ghost"):
    return (
        '<div class="cc %s">'
        '<span class="eyeb">Contact us today for a consultation</span>'
        '<a class="num" href="%s">250-888-0002</a>'
        '<span class="avail">Free consultations for injury &amp; estate litigation</span>'
        '<div class="frow"><input placeholder="Your name"><input placeholder="Your number"></div>'
        '<div class="btns"><span class="btn solid">Call Me Back</span>'
        '<span class="btn %s">Book Consultation</span></div>'
        '</div>' % (tone, TEL, ghost))


def header(cur="Injuries"):
    nav = "".join('<a href="#"%s>%s</a>' % (' class="cur"' if n == cur else '', n)
                  for n in ["Injuries", "Estates", "Business", "Marine", "Real Estate", "Your Team"])
    return ('<header class="sh"><div class="wrap"><a class="logo" href="#">'
            '<img src="/wp-content/uploads/logo.png" alt="League and Williams Lawyers"></a>'
            '<nav class="snav">%s</nav><div class="sphone"><span class="cn">CALL NOW</span>'
            '<span class="num">250-888-0002</span></div></div></header>' % nav)


def photo(cls=""):
    return ('<img src="%s" alt=""><span class="phtag">Placeholder &middot; November shoot</span>'
            % PHOTO)


# ---------------------------------------------------------------------------
def A1():
    return (
        '<section class="a1">' + header() +
        '<div class="cbar"><div class="wrap">' + (CRUMBS % "dark") + '</div></div>'
        '<div class="band">'
          '<div class="tp"><div class="in">' + hexicon("m", "w") +
            '<span class="hrule"></span>' + TITLE +
            '<span class="hrule"></span>'
            '<p class="hsub">Injuries</p></div></div>'
          '<div class="ph">' + photo() + '</div>'
          '<div class="cp">' + contact("on-brown") + '</div>'
        '</div></section>')


def A2():
    return (
        '<section class="a2">' + header() +
        '<div class="cbar2"><div class="wrap">' + (CRUMBS % "light") + '</div></div>'
        '<div class="band">'
          '<div class="tp"><div class="in">'
            '<div class="hexrow">' + hexicon("s", "w") + '<span class="k">Injuries</span></div>'
            '<span class="hrule"></span>' + TITLE +
            '<p class="hsub">' + DECK + '</p></div></div>'
          '<div class="ph">' + photo() + '</div>'
          '<div class="cp">' + contact("on-brown") + '</div>'
        '</div></section>')


def A3():
    return (
        '<section class="a3">' + header() +
        '<div class="band">' + photo() + '<span class="sc"></span>'
          '<div class="lay">' + (CRUMBS % "light") +
            '<div class="wrap">'
              '<div class="card">' + hexicon("s", "w") + TITLE +
                '<p class="hsub">Injuries</p></div>'
              '<div class="ccard">' + contact("on-brown") + '</div>'
            '</div></div>'
        '</div></section>')


def A4():
    return (
        '<section class="a4">' + header() +
        '<div class="band">'
          '<div class="lft"><div>' + (CRUMBS % "light") +
            '<div class="hexrow">' + hexicon("m", "o") + TITLE + '</div>'
            '<p class="hsub">' + DECK + '</p>'
            '<span class="ph2"><span class="cn">Call now</span><a class="n" href="' + TEL + '">250-888-0002</a></span>'
          '</div></div>'
          '<div class="rgt">' + photo() + contact("on-white", "ghostd") + '</div>'
        '</div></section>')


def A5():
    return (
        '<section class="a5">' + header() +
        '<div class="top"><div class="wrap">' + (CRUMBS % "dark") +
          '<div class="cols">'
            '<div class="lcol">'
              '<div class="hexrow">' + hexicon("m", "t") + TITLE + '</div>'
              '<p class="hsub">' + DECK + '</p>'
              '<p class="lede">' + LEDE + '</p>'
            '</div>'
            '<div class="rcol">' + contact("on-white", "ghostd") + '</div>'
          '</div></div></div>'
        '<div class="strip">' + photo() + '</div></section>')


def A6():
    return (
        '<section class="a6">' + header() +
        '<div class="band">' + photo() + '<span class="sc"></span>'
          '<div class="mid">' + (CRUMBS % "light") + hexicon("m", "o") + TITLE +
            '<p class="hsub">' + DECK + '</p></div>'
        '</div>'
        '<div class="ribwrap"><div class="wrap"><div class="rib">'
          '<div class="l"><span class="eyeb">Contact us today for a consultation</span>'
          '<a class="num" href="' + TEL + '">250-888-0002</a></div>'
          '<div class="r"><input placeholder="Your name"><input placeholder="Your number">'
          '<span class="btn solid">Call Me Back</span>'
          '<span class="btn ghost">Book Consultation</span></div>'
        '</div></div></div></section>')


OPTIONS = [
    ("A1", "The reference, mapped",
     "Brand orange · brown",
     "The three panels of Adi&rsquo;s reference, one for one: a colour block with the title, a "
     "photograph, and a contact block. Breadcrumb on a white strip above the band, so the hero itself "
     "stays as clean as the reference. The diagonal cut between panel and photograph is kept.",
     "The orange block carries <b>only large type</b>: the title at 38px and the sub-line at 20px bold. "
     "White on brand orange is <b>3.03:1</b> &mdash; it clears the 3:1 floor for large text and fails the "
     "4.5:1 floor for anything smaller, so the small contact copy sits on brown (<b>10.86:1</b>) instead. "
     "That is also why the reference&rsquo;s own arrangement works: bright block for the title, dark block "
     "for the details.", A1),

    ("A2", "Flush to the header",
     "Deep orange · brown",
     "The same three panels, but the breadcrumb becomes a slim brown bar directly under the header, so "
     "the hero starts at the header with no white gap. The title block uses the deepened orange, which "
     "lets the deck sit at reading size inside it.",
     "The deepened orange <b>#B44A33</b> is <b>5.29:1</b> against white &mdash; it holds body copy, which "
     "the brand orange cannot. That is the trade: A2 can put the page&rsquo;s real deck line in the colour "
     "block, A1 cannot. <b>It also introduces a colour the brand does not have yet</b>, so it is a "
     "decision for Adi, not a detail.", A2),

    ("A3", "Cards on the photograph",
     "One photograph",
     "One wide photograph across the whole band, with the title card and the contact card floating on "
     "it and the picture showing between them. Breadcrumb sits over the image, top left.",
     "A gradient scrim runs dark&ndash;light&ndash;dark so both cards land on the darker ends and the "
     "picture stays visible in the middle. The cards are solid, not translucent &mdash; a translucent "
     "card over a photograph is where contrast quietly stops being calculable.", A3),

    ("A4", "Half and half",
     "Brown · photograph",
     "No third panel: the left half is a brown block carrying breadcrumb, hexagon, title, deck and the "
     "phone; the right half is the photograph, with a white contact card inset into its lower corner.",
     "This is the only option where the contact block sits on <b>white</b>, so its small copy is at full "
     "contrast without any colour arithmetic. It is also the only one where the photograph gets half the "
     "band &mdash; worth seeing before the November shoot decides how good the pictures will be.", A4),

    ("A5", "The light one",
     "Paper · photograph as a strip",
     "Type on paper, the way home_v1 opens: breadcrumb, hexagon and title at left, the contact card at "
     "right across a hairline, and the photograph below as a full-bleed strip rather than a backdrop.",
     "This is the option that does <b>not</b> put a title over a picture. Darren&rsquo;s ban is on the "
     "homepage intro image; whether it reaches inner pages has never been decided, and A5 is the answer "
     "that does not need it decided. It is also the only option that carries the page&rsquo;s own lede "
     "sentence in the hero. <b>The strip is a hard crop:</b> 1440&times;220 is 6.5:1 out of a 3:2 "
     "photograph, so nothing in the library survives it well. If A5 is picked, the November shoot needs "
     "a wide master for this slot &mdash; that is a brief for the photographer, not a CSS problem.", A5),

    ("A6", "Photograph, then a ribbon",
     "Photograph · brown ribbon",
     "Title centred on a full-bleed photograph, and a single contact ribbon &mdash; phone, two fields, "
     "two buttons in one row &mdash; straddling the bottom edge of the picture.",
     "The ribbon overlaps the photograph by 58px, which is what stops the hero from reading as two "
     "stacked bands. The cost is that the ribbon is one row: it can hold two fields and two buttons or "
     "an availability line, not both.", A6),
]


def build():
    head = """<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<title>League Law &mdash; inner service hero options</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800&amp;family=Open+Sans:wght@400;600;700&amp;display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>__CSS__</style>
</head>
<body>

<div class="page-head">
  <h1>Inner service hero &mdash; options (Car Accident Claims)</h1>
  <p>Six ways to open an inner service page, from Adi&rsquo;s reference: a title, a photograph and
  contact information in the hero. Every option also carries the two things the reference does not
  have &mdash; a <b>breadcrumb</b> and the <b>practice hexagon</b> &mdash; and every option carries the
  same five parts, so what is being compared is the layout and nothing else.</p>

  <div class="box"><b>What each option must contain (checked mechanically):</b>
    <ul>
      <li>breadcrumb &mdash; Home &rsaquo; What We Do &rsaquo; Injury Claims &rsaquo; Car Accident Claims</li>
      <li>the practice hexagon, <code>.hex</code>, with the geometry fixed</li>
      <li>one <code>h1</code> &mdash; &ldquo;Car Accident Claims&rdquo;</li>
      <li>a photograph</li>
      <li>a contact block &mdash; eyebrow, phone, availability, two fields, two buttons</li>
    </ul>
  </div>

  <div class="box"><b>The hexagon is fixed, and it is fixed as a ratio.</b>
  A regular pointy-top hexagon has height 2R and width &radic;3&middot;R, so its box must always be
  <code>width / height = &radic;3 / 2 = 0.8660254</code>. The live site draws it <b>50&times;65</b>
  &mdash; ratio 0.769 &mdash; and at that ratio its four diagonal sides come out <b>8.3% shorter</b>
  than its two vertical sides. That is the squash. These options declare
  <code>aspect-ratio:.8660254</code> and set only a width, so the second number cannot drift.
  The glyph is centred by the flexbox alone; the live 3px nudge is gone, because on a pointy-top
  hexagon the geometric centre already is the optical centre.
  <table>
    <tr><th>drawn</th><th>ratio</th><th>diagonal side vs vertical side</th></tr>
    <tr><td>50 &times; 65 &mdash; the live site</td><td>0.769</td><td>&minus;8.3%</td></tr>
    <tr><td>95 &times; 110 &mdash; live, &ldquo;Get in touch&rdquo;</td><td>0.864</td><td>&minus;0.2%</td></tr>
    <tr><td>11 &times; 13 &mdash; home_v1 kicker dot</td><td>0.846</td><td>&minus;1.7%</td></tr>
    <tr><td>74 &times; 85 &mdash; home_v1 hive</td><td>0.871</td><td>+0.4%</td></tr>
    <tr><td><b>width + aspect-ratio</b> &mdash; these options</td><td><b>0.8660</b></td><td><b>0.0%</b></td></tr>
  </table>
  </div>

  <div class="box warn"><b>Which brand colours can hold text &mdash; measured, not guessed.</b>
  This decided the colour of every panel below.
  <table>
    <tr><th>white on</th><th>ratio</th><th>usable for</th></tr>
    <tr><td><span class="swatch" style="background:#423C37"></span>brown <code>#423C37</code></td><td><b>10.86:1</b></td><td>any size &mdash; the only brand colour that is safe everywhere</td></tr>
    <tr><td><span class="swatch" style="background:#B44A33"></span>deep orange <code>#B44A33</code></td><td><b>5.29:1</b></td><td>any size &mdash; but this colour is not in the brand yet</td></tr>
    <tr><td><span class="swatch" style="background:#EF6D3E"></span>brand orange <code>#EF6D3E</code></td><td><b>3.03:1</b></td><td>large text only (&ge;24px, or &ge;18.7px bold). <b>Fails for body copy.</b></td></tr>
    <tr><td><span class="swatch" style="background:#46ADC8"></span>teal <code>#46ADC8</code></td><td><b>2.60:1</b></td><td>nothing &mdash; fails even the large-text floor. Teal is a shape colour, not a text ground.</td></tr>
  </table>
  <b>One finding that is not about this sheet:</b> home_v1&rsquo;s contact band already sets its
  availability line and office note in <code>#FBE3D8</code> on brand orange &mdash; <b>2.47:1</b>.
  That is in the picked homepage design and wants fixing there too.
  </div>

  <div class="box ask"><b>Two things only Adi or the firm can settle:</b>
    <ul>
      <li><b>Does Darren&rsquo;s ban on the intro image reach inner pages?</b> It is documented for the
      homepage first screen. Five of these six put a photograph in the hero; A5 is the one that does not
      need the question answered.</li>
      <li><b>The availability line.</b> These use home_v1&rsquo;s approved
      &ldquo;Free consultations for injury &amp; estate litigation&rdquo;. A car-accident page would
      rather say it about car accidents &mdash; but that is the firm&rsquo;s sentence to write, not ours.</li>
    </ul>
  </div>

  <div class="box"><b>How much of the first screen each one eats.</b>
  Measured below the 93px header. On a 700px-tall viewport the first screen has
  <b>607px</b> to give away, so the last column is what is left for the page itself.
  <table>
    <tr><th>option</th><th>hero height</th><th>left for the page</th></tr>
    <tr><td>A2 &mdash; flush to the header</td><td>324px</td><td>283px</td></tr>
    <tr><td>A1 &mdash; the reference, mapped</td><td>341px</td><td>266px</td></tr>
    <tr><td>A3 &mdash; cards on the photograph</td><td>360px</td><td>247px</td></tr>
    <tr><td>A4 &mdash; half and half</td><td>380px</td><td>227px</td></tr>
    <tr><td>A6 &mdash; photograph, then a ribbon</td><td>395px</td><td>212px</td></tr>
    <tr><td>A5 &mdash; the light one</td><td><b>510px</b></td><td><b>97px</b></td></tr>
  </table>
  A5 is the calm one and the expensive one: it is the only option that carries the lede sentence, and
  paying for it costs almost the whole rest of the first screen.
  </div>

  <div class="box"><b>Photograph:</b> the same picture in every option on purpose &mdash; the option is
  what varies, not the picture. It is League&rsquo;s own <code>passengerclaim.png</code>, the closest
  thing in the library to the reference&rsquo;s approach of showing the <i>person</i> rather than the
  wreckage. Monochrome and a placeholder until the November colour shoot; labelled in every frame.</div>
</div>

<div class="roundhead">Round 1 &mdash; A1 &hellip; A6</div>
"""
    out = [head.replace("__CSS__", CSS)]
    for tag, name, hint, what, note, fn in OPTIONS:
        out.append(
            '\n<div class="opt">\n'
            '  <div class="opt-label"><span class="tag">%s</span><span class="name">%s</span>'
            '<span class="h">%s</span><span class="what">%s</span></div>\n'
            '  <div class="stage">%s</div>\n'
            '  <p class="opt-note">%s</p>\n'
            '</div>\n' % (tag, name, hint, what, fn(), note))
    out.append("\n</body>\n</html>\n")
    return "".join(out)


if __name__ == "__main__":
    html = build()
    dest = sys.argv[1] if len(sys.argv) > 1 else OUT
    io.open(dest, "w", encoding="utf-8").write(html)
    print("wrote %s (%d bytes)" % (dest, len(html)))
