/* ========================================
   liamhowell.com
   ======================================== */

:root {
    --navy: #17334a;
    --terracotta: #9c5038;
    --forest: #4a7332;
    --slate: #3e5f82;
    --gray: #575766;
    --teal: #2b6585;
    --plum: #7a4b6a;
    --olive: #6b5d2e;
    --accent: var(--navy);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: 'Lato', sans-serif;
    color: #333;
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.5s ease, border-color 0.5s ease;
}
a:hover {
    border-bottom-color: var(--accent);
}

.noselect {
    -webkit-user-select: none;
    user-select: none;
}

.clickable {
    cursor: pointer;
}

/* ========================================
   Header accent band
   ======================================== */
.header-accent {
    position: relative;
    background: var(--accent);
    color: white;
    padding: 40px 35px 80px;
    clip-path: polygon(0 0, 100% 0, 100% 65%, 0 100%);
    transition: background 0.5s ease;
}

.header-inner {
    font-family: 'Bree Serif', serif;
}

.header-accent .name {
    font-size: 2.2em;
    line-height: 1.1;
}

.header-accent .title {
    font-size: 1.2em;
    font-weight: normal;
    opacity: 0.75;
    margin-top: 4px;
}

.header-accent .wave {
    position: relative;
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.header-accent .wave:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Two nested spans so the wave (outer) and the high-five (inner) live on
   different elements. Their transforms compose multiplicatively via the
   DOM tree, so when the high-five starts and ends at the identity
   transform, the visible rotation at those moments is exactly whatever
   the wave is doing — no snap at either boundary. Both need identical
   box geometry so transform-origin: 50% 90% lands on the same physical
   pixel. */
.wave-glyph-wrap {
    display: inline-block;
    line-height: 1;
    transform-origin: 50% 90%;
    animation: wave-hand 6s ease-in-out 0.6s infinite;
    will-change: transform;
}

.wave-glyph {
    display: inline-block;
    font-size: 2.8em;
    line-height: 1;
    transform-origin: 50% 90%;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
    will-change: transform;
}

@keyframes wave-hand {
    0%   { transform: rotate(0deg); }
    4%   { transform: rotate(-14deg); }
    9%   { transform: rotate(12deg); }
    13%  { transform: rotate(-10deg); }
    18%  { transform: rotate(10deg); }
    22%  { transform: rotate(-6deg); }
    27%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Ripple (drawn as a pseudo-element on the button) */
.wave::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
    pointer-events: none;
}

/* Sparks (small particles, built via multiple box-shadows on ::before) */
.wave::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffdd55;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    box-shadow:
        0 -28px 0 0 #ffdd55,
         24px -14px 0 0 #ff9aa2,
         24px  14px 0 0 #c9ff46,
         0  28px 0 0 #fff1a8,
        -24px  14px 0 0 #ffffff,
        -24px -14px 0 0 #8ee3c8;
}

.wave.is-high-five .wave-glyph {
    animation: wave-high-five 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wave.is-high-five::after {
    animation: wave-ripple 0.55s ease-out;
}

.wave.is-high-five::before {
    animation: wave-spark 0.6s ease-out;
}

@keyframes wave-high-five {
    0%   { transform: rotate(0deg)    scale(1);    }
    18%  { transform: rotate(-22deg)  scale(1.08); }
    38%  { transform: rotate(16deg)   scale(1.4);  }
    60%  { transform: rotate(-4deg)   scale(0.95); }
    100% { transform: rotate(0deg)    scale(1);    }
}

@keyframes wave-ripple {
    0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.9; border-width: 3px; }
    100% { transform: translate(-50%, -50%) scale(3.2); opacity: 0;   border-width: 1px; }
}

@keyframes wave-spark {
    0%   { opacity: 0;   transform: translate(-50%, -50%) scale(0.2); }
    25%  { opacity: 1; }
    100% { opacity: 0;   transform: translate(-50%, -50%) scale(1.6); }
}

@media (prefers-reduced-motion: reduce) {
    .wave-glyph-wrap,
    .wave-glyph { animation: none; }
    .wave.is-high-five .wave-glyph,
    .wave.is-high-five::after,
    .wave.is-high-five::before { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    .wave { animation: none; }
}

/* ========================================
   Main content
   ======================================== */
.content {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 80px;
    font-size: 1.15em;
    line-height: 1.6;
}

.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo {
    margin-bottom: 40px;
}

.photo-trigger {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: zoom-in;
    border-radius: 50%;
    display: block;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.photo-trigger:hover,
.photo-trigger:focus-visible {
    transform: scale(1.02);
    box-shadow: 0 8px 28px rgba(23, 51, 74, 0.18);
    outline: none;
}

.photo img {
    display: block;
    width: 220px;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    aspect-ratio: 1;
}

.photo-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 20, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: photo-modal-in 0.18s ease-out;
}

.photo-modal[hidden] {
    display: none;
}

.photo-modal-img {
    max-width: min(92vw, 1200px);
    max-height: 92vh;
    height: auto;
    width: auto;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
    animation: photo-modal-img-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.photo-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.photo-modal-close:hover,
.photo-modal-close:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

@keyframes photo-modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes photo-modal-img-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .photo-modal,
    .photo-modal-img,
    .photo-trigger {
        animation: none;
        transition: none;
    }
}

.bio {
    width: 100%;
    max-width: 540px;
}

.about {
    margin-bottom: 36px;
}

.about h2, .links h2 {
    font-family: 'Bree Serif', serif;
    font-size: 1.3em;
    margin-bottom: 8px;
    color: var(--accent);
    transition: color 0.5s ease;
}

.about p {
    color: #444;
}

.links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.links a {
    font-size: 0.95em;
}

/* ========================================
   Section heading (shared by Building / Previously)
   ======================================== */
.section-heading {
    font-family: 'Bree Serif', serif;
    font-size: 1.05em;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6e6ea;
    transition: color 0.5s ease;
}

/* ========================================
   Building (project cards with animations)
   ======================================== */
.projects {
    margin-top: 64px;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    box-shadow: 0 10px 30px rgba(20, 20, 30, 0.08);
    transform: translateY(-2px);
    border-color: #dadae3;
    border-bottom-color: var(--accent);
}

.project-card:hover .project-name {
    color: var(--accent);
}

.project-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f6f7fa;
    overflow: hidden;
    border-bottom: 1px solid #ececf0;
}

.project-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 14px 18px 16px;
}

.project-name {
    font-family: 'Bree Serif', serif;
    font-size: 1.25em;
    line-height: 1.1;
    color: #222;
    transition: color 0.2s ease;
}

.project-tag {
    font-size: 0.85em;
    color: #888;
}

/* ----- SendTax animation ----- */
#sendtax-stage {
    --st-blue: #4456ff;
    --st-pop: #c9ff46;
    --st-ink: #051047;
    --st-mist: #eef1fb;
}

.st-dropzone {
    position: absolute;
    left: 50%;
    top: 18%;
    transform: translateX(-50%);
    width: 56%;
    height: 50%;
    border: 2px dashed #b9bfd8;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.st-dz-label {
    font-size: 0.78em;
    color: #9aa1bc;
    letter-spacing: 0.04em;
    transition: opacity 0.3s ease;
}

#sendtax-stage.st-state-drop .st-dropzone,
#sendtax-stage.st-state-scan .st-dropzone,
#sendtax-stage.st-state-classified .st-dropzone {
    border-color: var(--st-blue);
    background: #f4f6ff;
}

#sendtax-stage.st-state-drop .st-dz-label,
#sendtax-stage.st-state-scan .st-dz-label,
#sendtax-stage.st-state-classified .st-dz-label {
    opacity: 0;
}

.st-doc {
    position: absolute;
    left: 50%;
    top: -32%;
    transform: translate(-50%, 0) rotate(-6deg);
    width: 28%;
    aspect-ratio: 3 / 4;
    background: #fff;
    border: 1px solid #d4d8ea;
    border-radius: 4px;
    box-shadow: 0 6px 18px rgba(20, 30, 70, 0.08);
    /* padding % resolves against the STAGE's width (the containing block),
       not the doc's own width, so these have to stay small — otherwise the
       sides eat nearly the whole doc and the stripes collapse to squares. */
    padding: 10% 3% 0;
    display: flex;
    flex-direction: column;
    gap: 5%;
    opacity: 0;
    transition: top 0.9s cubic-bezier(0.4, 0.05, 0.2, 1),
                transform 0.9s cubic-bezier(0.4, 0.05, 0.2, 1),
                opacity 0.5s ease;
}

.st-doc-stripe {
    height: 4%;
    background: #e3e7f3;
    border-radius: 2px;
}

.st-doc-stripe:nth-child(2) { width: 80%; }
.st-doc-stripe:nth-child(3) { width: 60%; }

#sendtax-stage.st-state-drop .st-doc,
#sendtax-stage.st-state-scan .st-doc,
#sendtax-stage.st-state-classified .st-doc {
    opacity: 1;
    top: 24%;
    transform: translate(-50%, 0) rotate(0deg);
}

#sendtax-stage.st-state-listing .st-doc,
#sendtax-stage.st-state-done .st-doc {
    opacity: 0;
    transform: translate(-50%, -10px) rotate(0deg);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#sendtax-stage.st-state-listing .st-dropzone,
#sendtax-stage.st-state-done .st-dropzone {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.st-scan {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: var(--st-pop);
    box-shadow: 0 0 12px var(--st-pop), 0 0 24px rgba(201, 255, 70, 0.4);
    opacity: 0;
}

#sendtax-stage.st-state-scan .st-scan {
    animation: st-scan-sweep 1.2s ease-in-out forwards;
}

@keyframes st-scan-sweep {
    0%   { top: 0;                   opacity: 0; }
    10%  {                            opacity: 1; }
    90%  {                            opacity: 1; }
    100% { top: calc(100% - 3px);    opacity: 0; }
}

.st-badge {
    position: absolute;
    left: 50%;
    top: 10%;
    transform: translateX(-50%) scale(0.6);
    background: var(--st-ink);
    color: #fff;
    font-size: 0.78em;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.st-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--st-pop);
    box-shadow: 0 0 6px var(--st-pop);
}

#sendtax-stage.st-state-classified .st-badge {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

#sendtax-stage.st-state-listing .st-badge,
#sendtax-stage.st-state-done .st-badge {
    opacity: 0;
}

.st-checklist {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    list-style: none;
    width: 64%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.st-checklist li {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e3e7f3;
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 0.88em;
    color: #444;
    transform: translateX(-12px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease, border-color 0.3s ease;
}

#sendtax-stage.st-state-listing .st-checklist,
#sendtax-stage.st-state-done .st-checklist {
    opacity: 1;
}

#sendtax-stage.st-state-listing .st-checklist li,
#sendtax-stage.st-state-done .st-checklist li {
    transform: translateX(0);
    opacity: 1;
}

#sendtax-stage.st-state-listing .st-checklist li:nth-child(1) { transition-delay: 0s; }
#sendtax-stage.st-state-listing .st-checklist li:nth-child(2) { transition-delay: 0.08s; }
#sendtax-stage.st-state-listing .st-checklist li:nth-child(3) { transition-delay: 0.16s; }

.st-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid #c8cee0;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.st-check::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.st-checklist li.is-checked .st-check {
    background: var(--st-blue);
    border-color: var(--st-blue);
}

.st-checklist li.is-checked .st-check::after {
    transform: rotate(45deg) scale(1);
}

.st-checklist li.is-checked {
    border-color: #cfd6f0;
}

/* ----- Govroll animation ----- */
#govroll-stage {
    --gr-yea: #2f9e5f;
    --gr-nay: #c4453a;
    --gr-ink: #1a2433;
    --gr-muted: #cfd3dd;
    background: #fbfbfd;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gr-bill {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#govroll-stage.gr-state-bill .gr-bill,
#govroll-stage.gr-state-voting .gr-bill,
#govroll-stage.gr-state-done .gr-bill {
    opacity: 1;
    transform: translateY(0);
}

.gr-bill-id {
    font-family: 'Bree Serif', serif;
    color: var(--gr-ink);
    font-size: 0.95em;
}

.gr-bill-title {
    font-size: 0.82em;
    color: #6a7180;
    line-height: 1.2;
}

.gr-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-auto-rows: 1fr;
    gap: 5px;
    align-content: center;
    padding: 4px 2px;
}

.gr-cell {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--gr-muted);
    transform: scale(0.7);
    opacity: 0.5;
    transition: background 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

#govroll-stage.gr-state-voting .gr-cell,
#govroll-stage.gr-state-done .gr-cell {
    transform: scale(1);
    opacity: 1;
}

.gr-cell.is-yea { background: var(--gr-yea); }
.gr-cell.is-nay { background: var(--gr-nay); }

.gr-tally {
    display: flex;
    justify-content: space-between;
    font-size: 0.82em;
    color: #6a7180;
    font-variant-numeric: tabular-nums;
    padding: 0 2px;
}

.gr-tally b {
    color: var(--gr-ink);
    margin-left: 4px;
    font-weight: 600;
}

.gr-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -1px;
}

.gr-dot--yea { background: var(--gr-yea); }
.gr-dot--nay { background: var(--gr-nay); }

.gr-result {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.6) rotate(-8deg);
    font-family: 'Bree Serif', serif;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 0.18em;
    padding: 8px 20px;
    border: 3px solid currentColor;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 18px rgba(20, 30, 70, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#govroll-stage.gr-state-passed .gr-result { color: var(--gr-yea); }
#govroll-stage.gr-state-failed .gr-result { color: var(--gr-nay); }

#govroll-stage.gr-state-done .gr-result {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(1) rotate(-8deg);
}

/* ========================================
   Previously (prior work)
   ======================================== */
.prior-work {
    margin-top: 64px;
}

.prior-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.prior-item {
    padding-left: 14px;
    border-left: 2px solid #ececf0;
}

.prior-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.prior-company {
    font-family: 'Bree Serif', serif;
    font-size: 1.05em;
    color: var(--accent);
    transition: color 0.5s ease;
}

.prior-role {
    font-size: 0.9em;
    color: #555;
}

.prior-years {
    font-size: 0.8em;
    color: #999;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.prior-blurb {
    color: #555;
    font-size: 0.92em;
    line-height: 1.55;
}

/* ========================================
   Responsive
   ======================================== */
@media (min-width: 640px) {
    .header-accent {
        padding: 48px 48px 100px;
        clip-path: polygon(0 0, 100% 0, 100% 55%, 0 100%);
    }

    .header-accent .name {
        font-size: 2.8em;
    }

    .header-accent .title {
        font-size: 1.4em;
    }

    .header-accent .wave .wave-glyph {
        font-size: 3.4em;
    }
}

@media (min-width: 700px) {
    .content {
        padding-top: 48px;
    }

    .intro {
        flex-direction: row;
        align-items: flex-start;
        gap: 48px;
    }

    .photo {
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .photo img {
        width: 260px;
    }

    .project-grid {
        grid-template-columns: 1fr 1fr;
        gap: 22px;
    }
}

@media (min-width: 1000px) {
    .photo img {
        width: 300px;
    }

    .content {
        padding-top: 56px;
    }

    .intro {
        gap: 64px;
    }
}
