/* Jepona survey. Apple-style restraint in Jepona's colours. The one flourish is
   the aura: a soft glow that grows as she answers, from the "Dress your aura" line. */

@font-face { font-family: "Montserrat"; src: url(../fonts/montserrat-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(../fonts/plex-arabic-300.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(../fonts/plex-arabic-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(../fonts/plex-arabic-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(../fonts/plex-arabic-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
	--bg: #FAF8F5;
	--card: #FFFFFF;
	--ink: #25383A;
	--ink-2: #5C6A6B;
	--line: #E6E0D8;
	--tan: #A0815C;
	--tan-d: #7A6040;
	--blush: #EBD9D3;
	--warm: #C9A793;
	--err: #A63D32;
	--ease: cubic-bezier(.22, 1, .36, 1);
	--font: "Montserrat", "Plex Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--p: 0;
	--bar: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
	background: var(--bg);
	color: var(--ink);
	font: 400 17px/1.5 var(--font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
	overflow-x: hidden;
}
html[lang="ar"] body { line-height: 1.65; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--tan-d); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* The aura */
.aura { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aura i {
	position: absolute; display: block; border-radius: 50%;
	filter: blur(70px);
	transition: transform 1.4s var(--ease), opacity 1.4s var(--ease);
	will-change: transform;
}
.aura i:nth-child(1) { width: 70vmax; height: 70vmax; background: var(--blush); inset-block-end: -46vmax; inset-inline-start: -14vmax; opacity: calc(.42 + var(--p) * .4); transform: scale(calc(.7 + var(--p) * .55)); }
.aura i:nth-child(2) { width: 54vmax; height: 54vmax; background: var(--warm); inset-block-end: -40vmax; inset-inline-end: -12vmax; opacity: calc(.16 + var(--p) * .3); transform: scale(calc(.7 + var(--p) * .6)); }
.aura i:nth-child(3) { width: 40vmax; height: 40vmax; background: #E9CFA6; inset-block-end: -30vmax; inset-inline-start: 26vmax; opacity: calc(.12 + var(--p) * .26); transform: scale(calc(.7 + var(--p) * .6)); }
body.is-intro .aura i:nth-child(1), body.is-done .aura i:nth-child(1) { transform: scale(1.3); opacity: .8; }
body.is-intro .aura i:nth-child(2), body.is-done .aura i:nth-child(2) { transform: scale(1.3); opacity: .46; }
body.is-intro .aura i:nth-child(3), body.is-done .aura i:nth-child(3) { transform: scale(1.3); opacity: .42; }

/* Top bar */
.bar {
	position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 10;
	padding-block-start: env(safe-area-inset-top);
	background: rgba(250, 248, 245, .74);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
}
.bar-in {
	position: relative; display: flex; align-items: center; justify-content: space-between;
	height: var(--bar); max-width: 980px; margin: 0 auto; padding: 0 12px;
}
.logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: 32px; width: auto; display: block; }
.back, .lang {
	display: inline-flex; align-items: center; gap: 2px;
	min-height: 44px; padding: 0 8px; border: 0; background: none;
	font-size: 15px; font-weight: 500; color: var(--tan-d); border-radius: 10px;
}
.back[hidden] { display: inline-flex; visibility: hidden; }
.lang { margin-inline-start: auto; }
[dir="rtl"] .back svg { transform: scaleX(-1); }
.progress { height: 2px; background: rgba(160, 129, 92, .16); }
.progress[hidden] { display: block; visibility: hidden; }
.progress span {
	display: block; height: 100%; width: calc(var(--p) * 100%);
	background: var(--tan); transition: width .6s var(--ease);
}

/* Screens */
.app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; }
.screen {
	min-height: 100vh; min-height: 100dvh;
	display: flex; flex-direction: column;
	width: 100%; max-width: 620px; margin: 0 auto;
	padding: calc(var(--bar) + env(safe-area-inset-top) + 44px) 20px calc(112px + env(safe-area-inset-bottom));
}
.screen.enter { animation: rise .6s var(--ease) backwards; }
.screen.enter-back { animation: fall .6s var(--ease) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fall { from { opacity: 0; transform: translateY(-26px); } to { opacity: 1; transform: none; } }

/* Intro and thanks */
.hero { justify-content: center; align-items: center; text-align: center; max-width: 860px; padding-block-end: calc(40px + env(safe-area-inset-bottom)); }
.hero h1 {
	margin: 0; font-size: clamp(40px, 8.4vw, 76px); line-height: 1.06;
	font-weight: 200; letter-spacing: -.035em; text-wrap: balance;
}
html[lang="ar"] .hero h1 { font-weight: 300; letter-spacing: 0; line-height: 1.22; font-size: clamp(38px, 7.6vw, 68px); }
.hero p { margin: 22px auto 0; max-width: 34em; font-size: clamp(17px, 2.2vw, 21px); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.hero .actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.hero .time { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.linkish { border: 0; background: none; padding: 12px; font-size: 15px; font-weight: 500; color: var(--tan-d); border-radius: 10px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: 0 34px; border-radius: 999px;
	border: 1px solid var(--ink); background: var(--ink); color: #FBFAF7;
	font-size: 17px; font-weight: 500; text-decoration: none;
	transition: transform .25s var(--ease), background-color .2s, opacity .2s;
}
@media (hover: hover) { .btn:hover { background: #1B2B2D; } }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .32; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); }
@media (hover: hover) { .btn.ghost:hover { background: rgba(37, 56, 58, .06); } }

/* Questions */
.q { margin: 0; font-size: clamp(29px, 5.4vw, 42px); line-height: 1.14; font-weight: 300; letter-spacing: -.028em; text-wrap: balance; }
html[lang="ar"] .q { font-weight: 400; letter-spacing: 0; line-height: 1.32; font-size: clamp(27px, 5vw, 38px); }
.help { margin: 12px 0 0; font-size: 16px; color: var(--ink-2); text-wrap: pretty; }
.field { margin-top: 30px; }

.opts { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span {
	display: flex; align-items: center; justify-content: space-between; gap: 14px;
	min-height: 60px; padding: 14px 18px;
	background: var(--card); border-radius: 14px;
	box-shadow: 0 0 0 1px var(--line);
	font-size: 17px; font-weight: 400; line-height: 1.3;
	transition: box-shadow .18s ease, transform .25s var(--ease);
}
@media (hover: hover) { .opt:hover span { box-shadow: 0 0 0 1px var(--tan); } }
.opt:active span { transform: scale(.99); }
.opt input:checked + span { box-shadow: 0 0 0 2px var(--ink); font-weight: 500; }
.opt input:focus-visible + span { outline: 2px solid var(--tan-d); outline-offset: 3px; }
.opt b { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color .18s, box-shadow .18s; position: relative; }
.opt input[type="checkbox"] + span b { border-radius: 7px; }
.opt input:checked + span b { background: var(--ink); box-shadow: none; }
.opt input:checked + span b::after {
	content: ""; position: absolute; left: 7.5px; top: 4px; width: 7px; height: 12px;
	border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg);
}

.opts.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chips .opt span { min-height: 46px; padding: 10px 17px; border-radius: 999px; font-size: 15.5px; }
.chips .opt b { display: none; }
.chips .opt input:checked + span { background: var(--ink); color: #FBFAF7; box-shadow: none; }

/* Counters */
.counters { display: grid; gap: 10px; }
.counter {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 16px 16px 16px 20px; background: var(--card); border-radius: 14px; box-shadow: 0 0 0 1px var(--line);
}
[dir="rtl"] .counter { padding: 16px 20px 16px 16px; }
.counter .lbl { min-width: 0; font-size: 17px; line-height: 1.3; }
.counter small { display: block; margin-top: 3px; font-size: 14px; color: var(--ink-2); }
.stepper { display: flex; align-items: center; gap: 4px; flex: none; direction: ltr; }
.stepper button {
	width: 44px; height: 44px; border-radius: 50%; border: 0;
	background: #F1EDE7; color: var(--ink); font-size: 24px; line-height: 1; font-weight: 300;
	display: grid; place-items: center; transition: transform .2s var(--ease), background-color .15s;
}
@media (hover: hover) { .stepper button:hover { background: #E8E2D9; } }
.stepper button:active { transform: scale(.9); }
.stepper button:disabled { opacity: .36; cursor: default; }
.stepper input {
	width: 48px; border: 0; background: none; text-align: center; padding: 0;
	font-size: 25px; font-weight: 400; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Text */
.input {
	display: block; width: 100%; padding: 16px 18px; border: 0; border-radius: 14px;
	background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: 17px;
	transition: box-shadow .18s; appearance: none;
}
.input:focus { outline: none; box-shadow: 0 0 0 2px var(--ink); }
.input::placeholder { color: #7D8788; }
textarea.input { min-height: 150px; resize: vertical; line-height: 1.5; }
.stack { display: grid; gap: 10px; }
.note { margin: 10px 2px 0; font-size: 14.5px; color: var(--err); }
.note:empty { display: none; }

/* Continue */
.foot {
	position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 5;
	padding: 28px 20px calc(18px + env(safe-area-inset-bottom));
	background: linear-gradient(to top, rgba(250, 248, 245, .9) 45%, rgba(250, 248, 245, 0));
	pointer-events: none;
}
.foot-in { max-width: 580px; margin: 0 auto; pointer-events: auto; }
.foot .btn { width: 100%; }
.foot .note { text-align: center; margin: 0 0 10px; }

.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.noscript { padding: 120px 20px; text-align: center; }

@media (min-width: 720px) {
	.screen { padding-block-start: calc(var(--bar) + 84px); }
	.hero { padding-block-start: var(--bar); }
	.foot { background: none; }
	.foot-in { display: flex; justify-content: flex-end; flex-wrap: wrap; }
	.foot .btn { width: auto; min-width: 180px; }
	.foot .note { width: 100%; text-align: end; }
	.opts.two { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
	.opt span { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
	.screen.enter, .screen.enter-back { animation: none; }
	.aura i, .progress span, .btn, .opt span { transition: none; }
}
