/* ==========================================================================
   PhoneGrade site - base layer
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--pg-header-h) + var(--pg-4));
}

body {
    font-family: var(--pg-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--pg-text);
    background: var(--pg-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--pg-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--pg-accent);
    outline-offset: 3px;
    border-radius: var(--pg-r-sm);
}

::selection {
    background: var(--pg-blue-100);
    color: var(--pg-text);
}

/* Skip link, visible only when focused. */
.pg-skip {
    position: absolute;
    left: var(--pg-4);
    top: -100px;
    z-index: 200;
    padding: var(--pg-3) var(--pg-4);
    background: var(--pg-accent);
    color: #fff;
    border-radius: var(--pg-r-md);
    font-weight: 600;
    transition: top 0.15s ease;
}

.pg-skip:focus {
    top: var(--pg-4);
    text-decoration: none;
}

.pg-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.pg-container {
    width: 100%;
    max-width: var(--pg-max);
    margin-inline: auto;
    padding-inline: var(--pg-5);
}

.pg-container--narrow {
    max-width: var(--pg-max-narrow);
}

.pg-section {
    padding-block: var(--pg-20);
}

.pg-section--tight {
    padding-block: var(--pg-16);
}

.pg-section--dark {
    background: var(--pg-inv-bg);
    color: var(--pg-inv-text);
}

.pg-section--subtle {
    background: var(--pg-surface-2);
}

.pg-section--bordered {
    border-top: 1px solid var(--pg-border);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

/* The hero headline. Capped below 3.4rem on purpose: at 4rem the longest
 * headline on the site wraps to one or two words a line in the hero's copy
 * column, which reads as a layout fault rather than as confident type. Below
 * that cap it lands on two lines at every width the hero is two columns. */
.pg-display {
    font-size: clamp(2rem, 1.3rem + 2.6vw, 3.4rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
    font-weight: 800;
    text-wrap: balance;
}

/*
 * A two-line headline is broken at the writer's chosen point, never at whatever
 * point the column happens to end. Each line is its own string in the locale
 * files, because a headline split across two translated sentences cannot be
 * wrapped by the browser without the break landing somewhere a different
 * language would never put it.
 *
 * The last line keeps the display size; the first drops one step, because a
 * full-size first line followed by a smaller second line reads as a mistake
 * rather than as emphasis.
 */
.pg-display > span {
    display: block;
}

.pg-display > span + span {
    font-size: 0.72em;
    color: var(--pg-inv-accent);
    letter-spacing: -0.03em;
}

.pg-section:not(.pg-hero):not(.pg-pagehead) .pg-display > span + span,
.pg-pagehead .pg-display > span + span {
    color: var(--pg-accent);
}

.pg-h1 {
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -0.028em;
    font-weight: 800;
    text-wrap: balance;
}

.pg-h2 {
    font-size: clamp(1.4rem, 1.15rem + 1vw, 1.95rem);
    line-height: 1.2;
    letter-spacing: -0.022em;
    font-weight: 750;
    text-wrap: balance;
}

.pg-h3 {
    font-size: 1.16rem;
    line-height: 1.3;
    letter-spacing: -0.014em;
    font-weight: 700;
}

.pg-h4 {
    font-size: 0.95rem;
    line-height: 1.35;
    font-weight: 700;
}

.pg-lede {
    font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.18rem);
    line-height: 1.6;
    color: var(--pg-text-2);
    text-wrap: pretty;
}

.pg-section--dark .pg-lede {
    color: var(--pg-inv-text-2);
}

.pg-body {
    color: var(--pg-text-2);
    text-wrap: pretty;
}

/* Body copy inside an inverted band needs the inverted secondary, not the light
 * one. Without this the slate-500 that reads correctly on a white card sits at
 * about 3.4 to 1 against the dark card, which is under the 4.5 threshold for
 * body text. */
.pg-section--dark .pg-body,
.pg-section--dark .pg-feature p,
.pg-section--dark .pg-step p,
.pg-section--dark .pg-shot__caption,
.pg-section--dark .pg-plan__features li {
    color: var(--pg-inv-text-2);
}

.pg-section--dark .pg-small,
.pg-section--dark .pg-stat__label {
    color: var(--pg-inv-text-2);
}

.pg-section--dark .pg-micro {
    color: var(--pg-slate-500);
}

.pg-small {
    font-size: 0.875rem;
    line-height: 1.55;
}

.pg-micro {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--pg-text-3);
}

.pg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--pg-2);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--pg-accent);
    margin-bottom: var(--pg-3);
}

.pg-eyebrow--dark {
    color: var(--pg-inv-accent);
}

.pg-eyebrow::before {
    content: '';
    width: 18px;
    height: 2px;
    border-radius: var(--pg-r-full);
    background: currentColor;
    opacity: 0.55;
}

.pg-measure {
    max-width: 62ch;
}

.pg-measure-tight {
    max-width: 48ch;
}

.pg-strong {
    font-weight: 700;
    color: var(--pg-text);
}

.pg-mono {
    font-family: var(--pg-mono);
    font-size: 0.92em;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Section header
   -------------------------------------------------------------------------- */

.pg-section-head {
    max-width: 62ch;
    margin-bottom: var(--pg-10);
}

.pg-section-head--center {
    margin-inline: auto;
    text-align: center;
}

.pg-section-head .pg-lede {
    margin-top: var(--pg-4);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--pg-2);
    height: 46px;
    padding-inline: var(--pg-5);
    border: 1px solid transparent;
    border-radius: var(--pg-r-md);
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
        transform 0.1s ease, box-shadow 0.15s ease;
}

.pg-btn:hover {
    text-decoration: none;
}

.pg-btn:active {
    transform: translateY(1px);
}

.pg-btn--primary {
    background: var(--pg-accent);
    color: var(--pg-accent-contrast);
    box-shadow: var(--pg-sh-sm);
}

.pg-btn--primary:hover {
    background: var(--pg-accent-hover);
    box-shadow: var(--pg-sh-md);
}

.pg-btn--dark {
    background: var(--pg-slate-900);
    color: #fff;
}

.pg-btn--dark:hover {
    background: var(--pg-slate-800);
}

.pg-section--dark .pg-btn--dark {
    background: #fff;
    color: var(--pg-slate-900);
}

.pg-section--dark .pg-btn--dark:hover {
    background: var(--pg-slate-100);
}

.pg-btn--secondary {
    background: var(--pg-surface);
    color: var(--pg-text);
    border-color: var(--pg-border-strong);
}

.pg-btn--secondary:hover {
    background: var(--pg-surface-2);
    border-color: var(--pg-slate-400);
}

.pg-btn--ghost {
    background: transparent;
    color: var(--pg-text);
    border-color: var(--pg-border-strong);
}

.pg-btn--ghost:hover {
    background: var(--pg-surface-2);
}

.pg-btn--on-dark {
    background: transparent;
    color: var(--pg-inv-text);
    border-color: var(--pg-inv-border);
}

.pg-btn--on-dark:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--pg-slate-500);
}

.pg-btn--lg {
    height: 52px;
    padding-inline: var(--pg-6);
    font-size: 1rem;
}

.pg-btn--sm {
    height: 38px;
    padding-inline: var(--pg-4);
    font-size: 0.86rem;
}

.pg-btn--block {
    width: 100%;
}

.pg-btn[disabled],
.pg-btn[aria-disabled='true'] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.pg-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pg-3);
    margin-top: var(--pg-6);
}

.pg-btn-row--center {
    justify-content: center;
}

/* Inline text link with an arrow that nudges on hover. */
.pg-arrow-link {
    display: inline-flex;
    align-items: center;
    gap: var(--pg-2);
    font-weight: 650;
}

.pg-arrow-link svg {
    transition: transform 0.15s ease;
}

.pg-arrow-link:hover {
    text-decoration: none;
}

.pg-arrow-link:hover svg {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.pg-card {
    background: var(--pg-surface);
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-r-lg);
    padding: var(--pg-6);
}

.pg-card--pad-lg {
    padding: var(--pg-8);
}

.pg-card--flush {
    padding: 0;
    overflow: hidden;
}

.pg-card--raised {
    box-shadow: var(--pg-sh-md);
}

.pg-section--dark .pg-card {
    background: var(--pg-inv-surface);
    border-color: var(--pg-inv-border);
}

/* --------------------------------------------------------------------------
   Badges and pills
   -------------------------------------------------------------------------- */

.pg-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--pg-1);
    padding: 3px var(--pg-2);
    border-radius: var(--pg-r-sm);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.pg-badge--neutral {
    background: var(--pg-surface-2);
    color: var(--pg-text-2);
}

.pg-badge--accent {
    background: var(--pg-blue-50);
    color: var(--pg-accent-hover);
}

.pg-badge--success {
    background: var(--pg-green-100);
    color: var(--pg-green-800);
}

.pg-badge--warning {
    background: var(--pg-amber-100);
    color: var(--pg-amber-800);
}

.pg-badge--danger {
    background: var(--pg-red-100);
    color: var(--pg-red-800);
}

.pg-badge--outline {
    background: transparent;
    border: 1px solid var(--pg-border-strong);
    color: var(--pg-text-2);
}

.pg-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pg-2);
}

/* --------------------------------------------------------------------------
   Grids
   -------------------------------------------------------------------------- */

.pg-grid {
    display: grid;
    gap: var(--pg-5);
}

.pg-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pg-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pg-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pg-grid--auto {
    grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
}

.pg-grid--auto-sm {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

@media (max-width: 900px) {
    .pg-grid--3,
    .pg-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .pg-grid--2,
    .pg-grid--3,
    .pg-grid--4 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Icon tile, used by feature and value cards
   -------------------------------------------------------------------------- */

.pg-icon-tile {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--pg-r-md);
    background: var(--pg-blue-50);
    color: var(--pg-accent);
    margin-bottom: var(--pg-4);
}

.pg-section--dark .pg-icon-tile {
    background: rgba(96, 165, 250, 0.14);
    color: var(--pg-inv-accent);
}

.pg-icon-tile svg {
    width: 22px;
    height: 22px;
}

/* --------------------------------------------------------------------------
   Definition list, used for requirement style rows
   -------------------------------------------------------------------------- */

.pg-dl {
    display: grid;
    gap: 0;
}

.pg-dl__row {
    display: grid;
    gap: var(--pg-1);
    padding-block: var(--pg-3);
    border-bottom: 1px solid var(--pg-border);
}

.pg-dl__row:last-child {
    border-bottom: 0;
}

.pg-dl__key {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--pg-text-3);
}

.pg-dl__val {
    font-weight: 600;
}

@media (min-width: 560px) {
    .pg-dl__row--inline {
        grid-template-columns: minmax(140px, 0.45fr) 1fr;
        gap: var(--pg-4);
        align-items: baseline;
    }
}

/* --------------------------------------------------------------------------
   Checklist
   -------------------------------------------------------------------------- */

.pg-checklist {
    list-style: none;
    display: grid;
    gap: var(--pg-3);
}

.pg-checklist li {
    display: flex;
    gap: var(--pg-3);
    align-items: flex-start;
    font-size: 0.95rem;
}

.pg-checklist li svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    color: var(--pg-green-600);
}

.pg-section--dark .pg-checklist li svg {
    color: var(--pg-green-500);
}

.pg-checklist--muted li svg {
    color: var(--pg-text-3);
}

/* --------------------------------------------------------------------------
   Callout
   -------------------------------------------------------------------------- */

.pg-callout {
    display: flex;
    gap: var(--pg-4);
    padding: var(--pg-5);
    border-radius: var(--pg-r-lg);
    border: 1px solid var(--pg-border);
    background: var(--pg-surface-2);
}

.pg-callout__icon {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--pg-accent);
}

.pg-callout--accent {
    background: var(--pg-blue-50);
    border-color: var(--pg-blue-100);
}

.pg-section--dark .pg-callout--accent {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.28);
}

.pg-callout--warning {
    background: var(--pg-amber-100);
    border-color: color-mix(in srgb, var(--pg-amber-500) 34%, transparent);
}

.pg-section--dark .pg-callout--warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.28);
}

.pg-callout--warning .pg-callout__icon {
    color: var(--pg-amber-600);
}

.pg-callout__title {
    font-weight: 700;
    margin-bottom: var(--pg-1);
}

.pg-callout__body {
    font-size: 0.94rem;
    color: var(--pg-text-2);
}

.pg-section--dark .pg-callout__body {
    color: var(--pg-inv-text-2);
}

.pg-callout__body a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Stat
   -------------------------------------------------------------------------- */

.pg-stat__value {
    font-size: clamp(1.7rem, 1.4rem + 1vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.pg-stat__label {
    margin-top: var(--pg-2);
    font-size: 0.85rem;
    color: var(--pg-text-2);
}

.pg-section--dark .pg-stat__label {
    color: var(--pg-inv-text-2);
}

/* --------------------------------------------------------------------------
   Figures and screenshots
   -------------------------------------------------------------------------- */

.pg-shot {
    position: relative;
    border-radius: var(--pg-r-lg);
    overflow: hidden;
    border: 1px solid var(--pg-border);
    background: var(--pg-slate-900);
    box-shadow: var(--pg-sh-lg);
}

.pg-shot img {
    width: 100%;
    display: block;
}

.pg-shot__caption {
    margin-top: var(--pg-3);
    font-size: 0.85rem;
    color: var(--pg-text-3);
    text-align: center;
}

/* A window chrome strip, so a screenshot reads as a desktop app. */
.pg-shot--framed {
    padding-top: 30px;
    background: linear-gradient(180deg, #1c2436 0%, #0f172a 100%);
}

.pg-shot--framed::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 30px;
    background-image: radial-gradient(circle at 14px 15px, #64748b 0 4px, transparent 4.5px),
        radial-gradient(circle at 30px 15px, #f87171 0 4px, transparent 4.5px),
        radial-gradient(circle at 46px 15px, #fbbf24 0 4px, transparent 4.5px);
    background-repeat: no-repeat;
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Table
   -------------------------------------------------------------------------- */

.pg-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--pg-border);
    border-radius: var(--pg-r-lg);
    background: var(--pg-surface);
}

.pg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
    min-width: 480px;
}

.pg-table caption {
    padding: var(--pg-4) var(--pg-5) 0;
    text-align: left;
    font-size: 0.85rem;
    color: var(--pg-text-3);
}

.pg-table th,
.pg-table td {
    padding: var(--pg-4) var(--pg-5);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--pg-border);
}

.pg-table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--pg-text-3);
    background: var(--pg-surface-2);
    white-space: nowrap;
}

.pg-table tbody tr:last-child td {
    border-bottom: 0;
}

.pg-table__num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.pg-faq {
    border-top: 1px solid var(--pg-border);
}

.pg-faq__item {
    border-bottom: 1px solid var(--pg-border);
}

.pg-faq__q {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--pg-4);
    width: 100%;
    padding: var(--pg-5) 0;
    background: none;
    border: 0;
    text-align: left;
    font-size: 1.02rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    cursor: pointer;
}

.pg-faq__q:hover {
    color: var(--pg-accent);
}

.pg-faq__icon {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 3px;
    color: var(--pg-text-3);
    transition: transform 0.2s ease;
}

.pg-faq__item[open] .pg-faq__icon,
.pg-faq__q[aria-expanded='true'] .pg-faq__icon {
    transform: rotate(45deg);
    color: var(--pg-accent);
}

.pg-faq__a {
    padding-bottom: var(--pg-5);
    color: var(--pg-text-2);
    max-width: 68ch;
}

.pg-faq__a > * + * {
    margin-top: var(--pg-3);
}

.pg-faq__a a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.pg-footer {
    background: var(--pg-inv-bg);
    color: var(--pg-inv-text);
    padding-block: var(--pg-12) var(--pg-8);
    font-size: 0.92rem;
}

.pg-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: var(--pg-8);
    padding-bottom: var(--pg-10);
    border-bottom: 1px solid var(--pg-inv-border);
}

@media (max-width: 860px) {
    .pg-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .pg-footer__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--pg-8);
    }
}

.pg-footer__col h3 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pg-inv-text-2);
    margin-bottom: var(--pg-3);
}

.pg-footer__col ul {
    list-style: none;
    display: grid;
    gap: var(--pg-2);
}

.pg-footer__col a {
    color: var(--pg-inv-text);
}

.pg-footer__col a:hover {
    color: var(--pg-inv-accent);
}

.pg-footer__brand p {
    margin-top: var(--pg-3);
    color: var(--pg-inv-text-2);
    max-width: 34ch;
}

.pg-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pg-3) var(--pg-6);
    align-items: center;
    justify-content: space-between;
    padding-top: var(--pg-6);
    color: var(--pg-inv-text-2);
    font-size: 0.85rem;
}

.pg-footer__bottom p {
    margin: 0;
}

.pg-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: var(--pg-4);
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
