/* ─── Mini Split Sizing Calculator — site shell styles ───
   Shared by every page. On the homepage this file MUST be linked BEFORE
   app.css (the calculator's generated Tailwind) so utilities win ties.

   Worksheet design tokens:
   paper   #F6F4EE  page ground (graph-paper grid drawn on top)
   ink     #16211E  hero band, footer, headings
   teal    #0D6E6E  brand accent (matches the calculator UI)
   mist    #7FA39C  muted labels on ink
   rule    #D8D3CB  hairlines (same stock the calculator's borders use)
   copper  #D98B4F  one stamp of warmth: the "free" cell in the title block */
:root {
    --paper: #F6F4EE;
    --ink: #16211E;
    --teal: #0D6E6E;
    --teal-deep: #095555;
    --mist: #7FA39C;
    --rule: #D8D3CB;
    --copper: #D98B4F;
    --body-text: #3E4642;
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

html, body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pan-x;
    margin: 0;
    padding: 0;
    height: auto;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* Engineering-pad ground: faint teal graph grid over warm paper. */
body {
    background-color: var(--paper);
    background-image:
        linear-gradient(to right, rgba(13, 110, 110, 0.055) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(13, 110, 110, 0.055) 1px, transparent 1px);
    background-size: 36px 36px;
}

/* ─── Site header (Ben likes this — do not restyle) ─── */
.mss-header {
    background: #F0EBE3;
    border-bottom: 1px solid #D8D3CB;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.mss-header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 72px;
}
.mss-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1C1C1A;
    padding: 12px 0;
}
.mss-brand svg { flex-shrink: 0; }
.mss-brand span {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(16px, 2.6vw, 22px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.mss-nav {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 32px);
}
.mss-nav a {
    color: #2C2B28;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(15px, 1.2vw, 18px);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}
.mss-nav a:hover { color: #0D6E6E; }
.mss-shop-cta {
    display: inline-flex;
    align-items: center;
    background: #0D6E6E;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 980px;
    transition: background 0.2s;
}
.mss-shop-cta:hover { background: #095555; color: #fff !important; }
@media (max-width: 760px) {
    .mss-nav .mss-anchor { display: none; }
    .mss-shop-cta { padding: 9px 14px; font-size: 14px; }
}

/* ─── Hero: the worksheet's cover — ink band with a drafting grid ─── */
.mss-hero {
    position: relative;
    background: var(--ink);
    color: #fff;
    padding: clamp(40px, 7vw, 68px) 20px clamp(34px, 5vw, 52px);
    overflow: hidden;
}
.mss-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(127, 208, 200, 0.09) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(127, 208, 200, 0.09) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}
.mss-hero-inner {
    position: relative;
    max-width: 1080px;
    margin: 0 auto;
    text-align: center;
}
.mss-hero-eyebrow {
    font-family: var(--mono);
    font-weight: 600;
    font-size: clamp(10.5px, 1.6vw, 12.5px);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--mist);
    margin: 0 0 18px;
}
.mss-hero h1 {
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: clamp(30px, 5.6vw, 54px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin: 0 0 14px;
    color: #fff;
}
.mss-hero .calc-lead {
    font-size: clamp(16px, 3.2vw, 20px);
    line-height: 1.5;
    color: #AFC2BD;
    max-width: 760px;
    margin: 0 auto;
}
@media (max-width: 640px) {
    .mss-eyebrow-tail { display: none; }
}
/* Slimmer band for the inner pages. */
.mss-hero--page { padding: clamp(30px, 5vw, 46px) 20px clamp(28px, 4vw, 40px); }
.mss-hero--page h1 { font-size: clamp(26px, 4.6vw, 42px); }

/* Title block: the boxed corner stamp every engineering drawing carries.
   A 1px gap over a light background renders the cell rules. */
.mss-titleblock {
    margin: 30px auto 0;
    max-width: 900px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.mss-titleblock .cell {
    background: var(--ink);
    padding: 12px 16px 13px;
    text-align: left;
}
.mss-titleblock .cell dt {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--mist);
    margin: 0 0 4px;
}
.mss-titleblock .cell dd {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14.5px;
    color: #fff;
    margin: 0;
}
.mss-titleblock .cell.is-free dd { color: var(--copper); }
@media (max-width: 760px) {
    .mss-titleblock { grid-template-columns: 1fr 1fr; }
}

* {
    -webkit-overflow-scrolling: touch;
}
body, #root {
    touch-action: pan-y pan-x;
}
#root {
    min-height: 700px;
    display: block;
}
@media (max-width: 768px) {
    #root {
        min-height: 850px;
    }
}
input, select {
    font-size: 16px !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* Apple-style blur + shadows (used by the calculator app) */
.apple-blur {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.apple-shadow {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.apple-shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Mobile responsive fixes for product cards (calculator app) */
@media (max-width: 640px) {
    .product-card-mobile {
        flex-direction: column !important;
        text-align: center !important;
    }
    .product-card-mobile img {
        width: 100% !important;
        max-width: 200px !important;
        margin: 0 auto !important;
    }
    .product-card-mobile > div {
        width: 100% !important;
    }
    .product-card-mobile .bg-[#0D6E6E] {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

/* ─── Calculator container ─── */
.calc-split {
    max-width: 1400px;
    margin: 30px auto 0;
    padding: 0 20px;
}
@media (max-width: 640px) {
    .calc-lead-more { display: none; }
    .calc-split { padding: 0 10px; margin-top: 20px; }
}

/* ─── Worksheet sheets: ruled panels instead of floating cards ─── */
.mss-prose {
    max-width: 900px;
    margin: 60px auto 0;
    padding: 0 20px;
    color: #1C1C1A;
}
.mss-prose--page { margin-top: 44px; }
.sheet {
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 38px 44px 40px;
    margin-bottom: 28px;
    box-shadow: 0 1px 0 rgba(22, 33, 30, 0.05);
}
@media (max-width: 640px) {
    .sheet { padding: 26px 20px 28px; }
}
.sheet-tag {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--teal);
    margin: 0 0 12px;
}
.sheet-tag::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
}
.sheet h2 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(24px, 4.6vw, 33px);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 18px;
}
.sheet h3 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(17px, 3vw, 20px);
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    margin: 0 0 8px;
}
.sheet p, .sheet li {
    font-size: clamp(15px, 1.9vw, 16.5px);
    line-height: 1.7;
    color: var(--body-text);
}
.sheet p { margin: 0 0 16px; }
.sheet p:last-child { margin-bottom: 0; }
.sheet a {
    color: var(--teal);
    text-decoration: underline;
    text-decoration-color: rgba(13, 110, 110, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s;
}
.sheet a:hover { text-decoration-color: var(--teal); }
a:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Method steps: the content IS a sequence, so the numerals carry meaning. */
.steps {
    list-style: none;
    counter-reset: step;
    margin: 0 0 16px;
    padding: 0;
}
.steps li {
    counter-increment: step;
    position: relative;
    padding: 0 0 0 58px;
    margin: 0 0 16px;
}
.steps li:last-child { margin-bottom: 0; }
.steps li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 1px;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 13px;
    color: var(--teal);
    border: 1px solid rgba(13, 110, 110, 0.35);
    border-radius: 4px;
    padding: 3px 7px;
    line-height: 1;
}
.note {
    border: 1px solid var(--rule);
    border-left: 3px solid var(--teal);
    border-radius: 6px;
    background: rgba(13, 110, 110, 0.04);
    padding: 16px 20px;
    margin-top: 24px;
}
.note p { margin: 0; font-size: 15.5px; color: #1C1C1A; }

/* FAQ: ruled worksheet rows, answers always visible. */
.faq-item {
    border-top: 1px solid var(--rule);
    padding: 20px 0;
}
.faq-item:last-child { padding-bottom: 4px; }
.faq-item p { margin: 0; }

/* Reference index: a drawing index, not a card grid. */
.ref-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
}
.ref-list a {
    display: block;
    border-top: 1px solid var(--rule);
    padding: 15px 4px 16px;
    text-decoration: none;
    transition: background 0.15s;
}
.ref-list a:hover { background: rgba(13, 110, 110, 0.045); }
.ref-list .ref-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: var(--ink);
}
.ref-list a:hover .ref-title { color: var(--teal); }
.ref-list .ref-title::after {
    content: "↗";
    font-family: var(--mono);
    font-size: 13px;
    color: var(--teal);
}
.ref-list .ref-desc {
    font-size: 14px;
    color: #6E6A63;
    line-height: 1.5;
    margin: 4px 0 0;
}
@media (max-width: 700px) {
    .ref-list { grid-template-columns: 1fr; column-gap: 0; }
}

/* Big teal action button (inner pages' path back to the calculator). */
.mss-cta-btn {
    display: inline-block;
    background: var(--teal);
    color: #fff !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none !important;
    padding: 13px 28px;
    border-radius: 980px;
    transition: background 0.2s;
}
.mss-cta-btn:hover { background: var(--teal-deep); }

/* ─── Footer ─── */
.mss-footer {
    background: var(--ink);
    color: #f5f5f7;
    padding: 44px 20px 40px;
    margin-top: 80px;
    border-top: 3px solid var(--teal);
}
.mss-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}
.mss-footer a {
    color: #7FD0C8;
    text-decoration: none;
}
.mss-footer a:hover { text-decoration: underline; }
.mss-footer .mss-footer-contact {
    margin: 18px 0 0;
    font-size: 14.5px;
    color: #CFD8D4;
}
.mss-footer .mss-footer-contact a { color: #f5f5f7; font-weight: 600; }
.mss-footer .mss-fineprint {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--mist);
    margin-top: 20px;
    line-height: 1.7;
}

/* ─── Contact form (About page) ─── */
.contact-form { margin-top: 22px; }
.contact-form .cf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 640px) {
    .contact-form .cf-row { grid-template-columns: 1fr; }
    .contact-form button.mss-cta-btn { width: 100%; }
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: #fff;
    color: #1C1C1A;
    font-size: 16px;
    line-height: 1.5;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--teal);
    outline-offset: 1px;
}
.contact-form textarea { resize: vertical; margin-bottom: 16px; }
.contact-form button.mss-cta-btn { border: none; cursor: pointer; }
.contact-form button.mss-cta-btn:disabled { background: #9DB3AC; cursor: default; }
.cf-status { font-size: 15px; font-weight: 600; color: var(--teal-deep); margin: 14px 0 0; }
.cf-alt {
    font-size: 14.5px;
    color: #67716B;
    line-height: 1.7;
    border-top: 1px solid var(--rule);
    padding-top: 16px;
    margin-top: 26px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
