Khunndev
Sisyphus
Fix iOS Safari: viewport vh fallback, grain overlay scoping, and a smaller display size.
b425317
Raw History Blame Contribute Delete
17.1 kB
@import 'tailwindcss';
/* ════════════════════════════════════════════════════════════════════
NPI PIPE COUNT β€” Refined-light precision-instrument design system
───────────────────────────────────────────────────────────────────
Aesthetic: Linear / Stripe / Vercel-grade light SaaS. Confident,
precise, quietly luxurious. The COUNT NUMBER is the product hero β†’
it gets a confident display/mono treatment (IBM Plex Mono).
Typography:
β€’ IBM Plex Sans Thai β€” display + body (full Thai script support,
bilingual Thai/EN UI). Refined-technical IBM design language.
β€’ IBM Plex Mono β€” numeric/technical accents: count figures,
tabular data, dimension readouts.
This file is the SINGLE source of truth for theme tokens. Every
component reads var(--*). Phase 2 applies this system to screens.
Token names are the contract β€” never rename/remove, only extend.
════════════════════════════════════════════════════════════════════ */
:root {
/* ── Type families ────────────────────────────────────────────────
Fallback chain keeps Thai glyphs readable before webfonts load and
on offline first-load (offline-first PWA): Leelawadee UI (Win),
Thonburi (macOS), Garuda (Linux) all ship Thai. */
--font-sans: 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont,
'SF Pro Text', 'Segoe UI', system-ui, 'Leelawadee UI', 'Thonburi',
'Garuda', sans-serif;
--font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', 'Cascadia Code',
'Roboto Mono', 'DejaVu Sans Mono', 'Leelawadee UI', monospace;
/* ── Type scale (font sizes) ────────────────────────────────────── */
--text-2xs: 0.625rem; /* 10px β€” micro / fine print */
--text-xs: 0.6875rem; /* 11px β€” eyebrows, table meta */
--text-sm: 0.8125rem; /* 13px β€” captions, secondary text */
--text-base: 0.9375rem; /* 15px β€” body */
--text-md: 1rem; /* 16px β€” emphasized body, button labels */
--text-lg: 1.125rem; /* 18px β€” card titles */
--text-xl: 1.375rem; /* 22px β€” section heads */
--text-2xl: 1.75rem; /* 28px β€” page heads */
--text-display: clamp(2.25rem, 11vw, 3.25rem); /* hero COUNT number (capped for small screens) */
/* ── Line heights ───────────────────────────────────────────────── */
--leading-none: 1;
--leading-tight: 1.15;
--leading-snug: 1.35;
--leading-normal: 1.5;
--leading-relaxed: 1.625;
/* ── Letter spacing ─────────────────────────────────────────────── */
--tracking-tight: -0.02em;
--tracking-snug: -0.01em;
--tracking-normal: 0;
--tracking-wide: 0.04em;
--tracking-wider: 0.08em;
/* ── Font weights ───────────────────────────────────────────────── */
--weight-light: 300;
--weight-regular: 400;
--weight-medium: 500;
--weight-semibold: 600;
--weight-bold: 700;
/* ── Type presets (one-line `font:` recipes; family baked in so the
shorthand never resets it). Apply: `font: var(--type-h2);`
Add letter-spacing / text-transform / font-variant-numeric
separately where needed. ────────────────────────────────────── */
--type-display: 700 var(--text-display) / 1 var(--font-mono);
--type-h1: 700 var(--text-2xl) / var(--leading-tight) var(--font-sans);
--type-h2: 600 var(--text-xl) / var(--leading-snug) var(--font-sans);
--type-h3: 600 var(--text-lg) / var(--leading-snug) var(--font-sans);
--type-body: 400 var(--text-base) / var(--leading-normal) var(--font-sans);
--type-body-em: 500 var(--text-md) / var(--leading-normal) var(--font-sans);
--type-label: 600 var(--text-xs) / var(--leading-none) var(--font-sans);
--type-count: 700 var(--text-display) / 1 var(--font-mono);
/* ══ Canvas / atmosphere ══════════════════════════════════════════
Cool near-white with a faint navy tint + soft gradient mesh on the
body (see body rule) for premium depth β€” never flat #eef0f4. */
--bg: #f4f6fa;
--bg-gradient:
radial-gradient(115% 72% at 50% -8%, rgba(0, 49, 77, 0.06), transparent 58%),
radial-gradient(82% 56% at 100% 102%, rgba(90, 147, 181, 0.055), transparent 52%),
radial-gradient(70% 50% at 0% 100%, rgba(37, 99, 235, 0.03), transparent 50%);
--header-bg: #ffffff;
--surface: #ffffff;
--surface-2: #f7f9fc;
--surface-active: #eef3f8;
--surface-sunken: #eef1f6; /* NEW β€” recessed/inset panels */
/* Hairlines & borders β€” refined cooler */
--hairline: #e6eaf1;
--hairline-strong: #d4dbe6; /* NEW */
--border: #d4dbe6;
/* ── Text ───────────────────────────────────────────────────────── */
--text: #1e293b;
--text-dim: #5b6678;
--text-faint: #94a3b8;
--text-inverse: #ffffff;
/* ── Brand β€” navy (refined-light, NOT a recolor) ────────────────── */
--brand: #00314d;
--brand-hover: #00263c;
--brand-light: #e8f1f6;
--brand-muted: #5a93b5;
--brand-ring: rgba(0, 49, 77, 0.22);
/* ── Semantic ───────────────────────────────────────────────────── */
--success: #16a34a;
--success-light: #dcfce7;
--info: #2563eb;
--info-light: #dbeafe;
--danger: #dc2626;
--danger-light: #fee2e2;
--warning: #d97706;
--warning-light: #fef3c7;
--ios-toggle: #00314d;
/* ── Shape ──────────────────────────────────────────────────────── */
--r-sm: 0.625rem;
--r-md: 0.875rem;
--r-lg: 1rem;
--r-xl: 1.25rem;
--r-pill: 9999px; /* NEW */
/* ── Elevation β€” premium multi-layer shadows (soft + tight pairs) ─ */
--shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
--shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 6px 14px rgba(15, 23, 42, 0.08);
--shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.05), 0 14px 32px rgba(15, 23, 42, 0.10);
--shadow-xl: 0 8px 16px rgba(15, 23, 42, 0.06), 0 26px 52px rgba(15, 23, 42, 0.14);
--shadow-brand: 0 2px 6px rgba(0, 49, 77, 0.18), 0 10px 26px rgba(0, 49, 77, 0.30);
--shadow-inset: inset 0 1px 2px rgba(15, 23, 42, 0.06); /* NEW β€” sunken */
/* ── Grain / noise texture (premium tell; use sparingly) ──────────
Tiny inline fractal-noise SVG. Apply via `.grain` utility class on
a positioned parent β€” keeps text crisp (don't blanket the app). */
--grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
/* ── Motion ───────────────────────────────────────────────────────
Refined, snappier, spring-like easings for a precise-instrument
feel. Legacy names preserved; new ones added. */
--ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
--ease-smooth: cubic-bezier(0.4, 0, 0.2, 1); /* NEW β€” material standard */
--ease-snap: cubic-bezier(0.2, 0.9, 0.3, 1); /* NEW β€” snappy press */
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* NEW β€” overshoot */
/* root surface defaults */
font-family: var(--font-sans);
color: var(--text);
background: var(--bg);
-webkit-tap-highlight-color: transparent;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
font-optical-sizing: auto;
}
html {
overscroll-behavior: none;
}
body {
margin: 0;
min-height: 100vh;
min-height: 100dvh;
color: var(--text);
/* Cool near-white base + subtle gradient mesh = premium depth tell */
background-color: var(--bg);
background-image: var(--bg-gradient);
background-repeat: no-repeat;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
-webkit-user-select: none;
user-select: none;
}
input,
textarea {
-webkit-user-select: text;
user-select: text;
}
#root {
min-height: 100vh;
min-height: 100dvh;
}
button {
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
input[type='number'] {
-moz-appearance: textfield;
}
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.native-scroll {
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
}
.native-scroll::-webkit-scrollbar {
display: none;
}
/* ── Grain overlay utility ──────────────────────────────────────────
Apply `.grain` to a positioned (relative/absolute) container to lay
a whisper of fractal noise over it. pointer-events:none keeps it
non-interactive; z-index keeps it behind content if needed. */
.grain {
/* Establish positioning + stacking context so the ::after texture is always
scoped to THIS element (not a distant ancestor) and sits behind content.
Without this, .grain on a non-positioned parent let the ::after anchor to
a distant ancestor and blanket the screen β€” a known iOS Safari rendering
hazard with mix-blend-mode on large layers. */
position: relative;
isolation: isolate;
}
.grain::after {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
background-image: var(--grain);
background-size: 160px 160px;
background-repeat: repeat;
opacity: 0.04;
pointer-events: none;
z-index: -1;
}
/* ════════════════════════════════════════════════════════════════════
Reusable UI primitives β€” refined with premium depth
════════════════════════════════════════════════════════════════════ */
.ct-header {
background: var(--header-bg);
border-bottom: 1px solid var(--hairline);
box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), var(--shadow-sm);
}
.ct-card {
background: var(--surface);
border: 1px solid var(--hairline);
border-radius: var(--r-lg);
box-shadow: var(--shadow-sm);
}
.ct-section-label {
font-size: var(--text-xs);
line-height: var(--leading-none);
font-weight: var(--weight-semibold);
letter-spacing: var(--tracking-wider);
text-transform: uppercase;
color: var(--text-faint);
}
.ct-btn-primary {
display: flex;
align-items: center;
justify-content: center;
gap: 0.75rem;
min-height: 3.5rem;
width: 100%;
border-radius: var(--r-lg);
/* Subtle top-lit navy gradient β†’ pressable, quietly luxurious */
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 55%),
var(--brand);
color: var(--text-inverse);
font-size: var(--text-md);
font-weight: var(--weight-bold);
letter-spacing: var(--tracking-snug);
box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, 0.16);
transition: transform 0.2s var(--ease-snap), box-shadow 0.2s var(--ease-out),
background 0.2s var(--ease-out);
}
.ct-btn-primary:active:not(:disabled) {
transform: scale(0.98);
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 55%),
var(--brand-hover);
box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.ct-btn-secondary {
display: flex;
align-items: center;
justify-content: center;
gap: 0.75rem;
min-height: 3.5rem;
width: 100%;
border-radius: var(--r-lg);
border: 1px solid var(--border);
background: var(--surface);
color: var(--text);
font-size: var(--text-md);
font-weight: var(--weight-semibold);
letter-spacing: var(--tracking-snug);
box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.8);
transition: transform 0.2s var(--ease-snap), background 0.2s var(--ease-out),
box-shadow 0.2s var(--ease-out);
}
.ct-btn-secondary:active:not(:disabled) {
transform: scale(0.98);
background: var(--surface-2);
box-shadow: var(--shadow-xs);
}
.ct-btn-ghost {
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--r-md);
background: var(--surface-2);
border: 1px solid var(--hairline);
color: var(--text-dim);
font-weight: var(--weight-semibold);
transition: background 0.18s var(--ease-out), transform 0.18s var(--ease-snap),
color 0.18s var(--ease-out);
}
.ct-btn-ghost:active {
transform: scale(0.96);
background: var(--surface-active);
}
.ct-badge {
display: inline-flex;
align-items: center;
gap: 0.375rem;
border-radius: var(--r-pill);
padding: 0.25rem 0.75rem;
font-size: var(--text-sm);
font-weight: var(--weight-semibold);
letter-spacing: var(--tracking-snug);
}
.ct-badge--brand { background: var(--brand-light); color: var(--brand); }
.ct-badge--success { background: var(--success-light); color: var(--success); }
.ct-badge--info { background: var(--info-light); color: var(--info); }
.ct-badge--warning { background: var(--warning-light); color: var(--warning); }
.ct-badge--danger { background: var(--danger-light); color: var(--danger); }
/* ── Count display β€” the product hero ───────────────────────────────
Ready path for the big count figure: confident display mono with
tabular figures so digits don't jitter as the number animates. */
.ct-count {
font: var(--type-count);
font-variant-numeric: tabular-nums;
letter-spacing: var(--tracking-tight);
color: var(--brand);
}
/* ── Navigation transitions ───────────────────────────────────────── */
@keyframes nav-push {
from { opacity: 0; transform: translateX(28px); }
to { opacity: 1; transform: translateX(0); }
}
@keyframes nav-pop {
from { opacity: 0; transform: translateX(-28px); }
to { opacity: 1; transform: translateX(0); }
}
.nav-push { animation: nav-push 0.34s var(--ease-ios) both; }
.nav-pop { animation: nav-pop 0.30s var(--ease-ios) both; }
@keyframes drawer-in {
from { transform: translateX(100%); }
to { transform: translateX(0); }
}
.drawer-enter { animation: drawer-in 0.36s var(--ease-ios) both; }
@keyframes sheet-up {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
.sheet-enter { animation: sheet-up 0.40s var(--ease-ios) both; }
.overlay-enter { animation: fade-in 0.22s var(--ease-smooth) both; }
@keyframes rise {
from { opacity: 0; transform: translateY(16px); }
to { opacity: 1; transform: translateY(0); }
}
.rise-enter { animation: rise 0.32s var(--ease-out) both; }
@keyframes breathe {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.03); }
}
@keyframes glow-pulse {
0%, 100% { opacity: 0.5; transform: scale(1); }
50% { opacity: 0.75; transform: scale(1.06); }
}
@keyframes spin {
to { transform: rotate(360deg); }
}
@keyframes track-slide {
0% { transform: translateX(-200%); }
60% { transform: translateX(380%); }
100% { transform: translateX(380%); }
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.001ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.001ms !important;
}
}