/* NoteDrifter website: Home page. */

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative; min-height: clamp(620px, 58vw, 800px); display: grid; place-items: center; overflow: hidden;
  padding: calc(var(--header-h) + 36px) 20px 80px; text-align: center;
}
.hero-backdrop {
  position: absolute; inset: -6% 0; will-change: translate;
  background: linear-gradient(180deg, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, .12) 58%, #000 96%), url('assets/images/crystal-hero.png') center 44% / cover no-repeat;
  translate: 0 calc(var(--sy, 0) * .28px);
  animation: crystal-drift 30s ease-in-out infinite alternate;
}
.hero::after { /* soft vignette so the glass and title always read */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 50% 48%, rgba(0, 0, 0, .34), transparent 70%);
}
.hero-shards { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.shard {
  position: absolute; display: block; --depth: 1;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, .14));
  translate: calc(var(--px, 0) * var(--depth) * 18px) calc(var(--py, 0) * var(--depth) * 14px + var(--sy, 0) * var(--depth) * -.12px);
  transition: translate .38s var(--out);
  animation: float-shard 8s ease-in-out infinite alternate;
}
.shard-one { --rot: -5deg; --depth: 1.3; left: 9%; top: 32%; width: 155px; height: 170px; clip-path: polygon(4% 4%, 98% 35%, 38% 99%); }
.shard-two { --rot: 4deg; --depth: .8; right: 17%; top: 20%; width: 125px; height: 158px; clip-path: polygon(8% 3%, 100% 48%, 29% 98%); animation-delay: -3s; }
.shard-three { --rot: -2deg; --depth: 1.6; right: 7%; top: 57%; width: 115px; height: 110px; clip-path: polygon(50% 0, 100% 72%, 0 100%); animation-delay: -5s; }

.hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.hero-mark { display: flex; align-items: flex-end; gap: 8px; height: 104px; margin-bottom: 14px; filter: drop-shadow(0 0 12px rgba(255, 255, 255, .55)); }
.hero-mark i { display: block; width: 28px; height: 68px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), 0 0 18px rgba(255, 255, 255, .38); transform-origin: 50% 100%; }
.hero-mark i:nth-child(2) { transform: translateY(-11px); }
.hero-mark i:nth-child(3) { transform: translateY(-22px); }
.motion-ready .hero-mark i { animation: key-strike 1.3s var(--spring) calc(var(--k) * 110ms + 100ms) backwards, key-idle 6.5s ease-in-out calc(var(--k) * 260ms + 2.4s) infinite; }
.hero-mark i:nth-child(1) { --k: 0; } .hero-mark i:nth-child(2) { --k: 1; } .hero-mark i:nth-child(3) { --k: 2; }

.hero h1 { margin: 0; font: 400 clamp(62px, 7.6vw, 98px)/1 var(--display); text-shadow: 0 0 17px rgba(255, 255, 255, .5); }
.hero h1 .ch { --ch-delay: 125ms; }
.hero p { margin: 12px 0 40px; font-size: clamp(22px, 2.5vw, 30px); color: rgba(255, 255, 255, .88); letter-spacing: .01em; }
.hero-button { min-width: 250px; min-height: 62px; padding-inline: 34px; font-size: 28px; }
.hero-button.glass { background-color: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .62); }
.hero-button:hover { background-color: rgba(255, 255, 255, .08); }
.hero-demo-link {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 26px;
  color: rgba(255, 255, 255, .7); font-size: 17px; transition: color .4s;
}
.hero-demo-link:hover { color: #fff; }
.hero-demo-link .chevron { width: 16px; height: 16px; animation: float-y 2.6s ease-in-out infinite; }
.hero-demo-link { translate: 0 0; transition: color .4s, translate .6s var(--out); }
.hero-demo-link:hover { translate: 0 3px; }

/* ------------------------------------------------------------------ about */
.reading-width { max-width: 820px; margin: 0 auto; padding-inline: 30px; }
.about { padding-top: 96px; padding-bottom: 110px; }
.about-intro { margin: 0 0 56px; font-size: clamp(24px, 2.4vw, 31px); line-height: 1.38; color: rgba(255, 255, 255, .9); text-align: center; text-wrap: balance; }
.interface-concepts { max-width: 760px; margin: 0 auto 64px; }
.concept-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.concept-images img {
  display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--hairline);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.concept-images img:hover { --zoom: 1.03; border-color: rgba(255, 255, 255, .4); box-shadow: 0 24px 60px rgba(0, 0, 0, .7), 0 0 30px rgba(216, 215, 221, .14); }
.interface-concepts figcaption { margin-top: 14px; color: var(--soft); text-align: center; font-size: 15px; font-style: italic; }
.about h2 { margin: 54px 0 30px; font: 400 clamp(38px, 4.2vw, 54px)/1.2 var(--display); text-align: center; }

/* the three qualities sit as glass cards, a little wider than the reading column */
.qualities {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  margin-inline: calc((100% - min(1080px, 100vw - 40px)) / 2);
}
.qualities article {
  padding: 28px 26px 30px; border: 1px solid var(--hairline); border-radius: var(--r-card);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
}
.qualities article:hover { --zoom: 1.025; border-color: rgba(255, 255, 255, .38); box-shadow: 0 22px 44px rgba(0, 0, 0, .55), 0 0 30px rgba(216, 215, 221, .12); }
.qualities h3, .quality-num { translate: 0 0; transition: translate .58s var(--out), color .42s; }
.qualities article:hover h3, .qualities article:focus-within h3 { translate: 4px 0; }
.qualities article:hover .quality-num, .qualities article:focus-within .quality-num { translate: 0 -3px; color: rgba(255,255,255,.8); }
.quality-num { display: block; margin-bottom: 22px; font: 400 15px/1 var(--display); letter-spacing: .2em; color: var(--soft); }
.qualities h3 { margin: 0 0 10px; font: 400 30px/1.2 var(--display); }
.qualities p { margin: 0; font-size: 19px; line-height: 1.55; }

/* ------------------------------------------------------------------- demo */
.demo-section { max-width: 1140px; margin: auto; padding: 40px 30px 120px; }
.section-title { display: flex; align-items: center; gap: 26px; }
.section-title span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55)); }
.section-title span { position: relative; overflow: hidden; }
.section-title span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #fff, transparent); translate: -100% 0; animation: line-glimmer 6s ease-in-out infinite; }
.section-title span:last-child { scale: -1 1; }
.section-title h2 { margin: 0; font: 400 clamp(36px, 5.5vw, 68px)/1.1 var(--display); text-align: center; text-shadow: 0 0 14px rgba(255, 255, 255, .25); }
.section-lead { max-width: 740px; margin: 24px auto 38px; font-size: 20px; line-height: 1.5; text-align: center; text-wrap: balance; }

.demo {
  overflow: hidden; border: 1px solid var(--line); border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 20, 22, .82), rgba(8, 8, 9, .9));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .03) inset;
}
.demo-stage { position: relative; margin: 10px 10px 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.demo-stage canvas { display: block; width: 100%; height: 100%; }
.demo-loading {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; background: #050505;
  color: transparent; font: 400 22px var(--display);
  background-image: linear-gradient(105deg, rgba(255, 255, 255, .35) 30%, #fff 50%, rgba(255, 255, 255, .35) 70%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; animation: sheen 2.4s linear infinite;
}
.demo-loading[hidden] { display: none; }

.transport { display: flex; align-items: center; gap: 16px; padding: 14px 20px 6px; }
.icon-button {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%; background: rgba(255, 255, 255, .04);
  transition: border-color .4s, background-color .4s, box-shadow .6s var(--out), scale .8s var(--spring);
}
.icon-button:hover { border-color: #fff; background: rgba(255, 255, 255, .1); box-shadow: var(--glow); scale: 1.08; }
.icon-button:active { scale: .92; transition-duration: .4s, .4s, .6s, .25s; }
.icon-button svg { width: 16px; height: 16px; display: block; }
.icon-button [data-play-icon] { display: grid; place-items: center; }
.icon-button [data-play-icon] svg { animation: pop-in .26s var(--out); }
.time { font: 400 15px var(--body); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo-status, .demo-note { margin: 0; padding: 2px 22px 14px; font-size: 15px; line-height: 1.45; color: var(--soft); }

/* sliders: a hairline track that fills white, with a glowing knob (demo.js sets --p) */
.demo input[type=range] { --p: 0%; -webkit-appearance: none; appearance: none; height: 24px; margin: 0; background: transparent; cursor: pointer; }
.demo input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, #fff var(--p), rgba(255, 255, 255, .2) var(--p)); }
.demo input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; margin-top: -6px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .1), 0 0 12px rgba(255, 255, 255, .55); transition: scale .6s var(--spring), box-shadow .4s;
}
.demo input[type=range]:hover::-webkit-slider-thumb { scale: 1.2; box-shadow: 0 0 0 7px rgba(255, 255, 255, .14), 0 0 16px rgba(255, 255, 255, .7); }
.demo input[type=range]:active::-webkit-slider-thumb { scale: 1.35; }
.demo input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .2); }
.demo input[type=range]::-moz-range-progress { height: 3px; border-radius: 3px; background: #fff; }
.demo input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, .55); }
.transport input[type=range] { flex: 1; min-width: 50px; }

/* styles: material cards, then preset pills */
.style-picker { margin-top: 6px; padding: 26px 22px 22px; border-top: 1px solid var(--hairline); }
.style-picker-heading h3 { margin: 0 0 6px; font: 400 30px/1.2 var(--display); }
.style-picker-heading p { margin: 0 0 18px; font-size: 16px; color: var(--soft); }
.preset-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.preset-card {
  min-width: 0; padding: 0 0 10px; overflow: hidden; text-align: left;
  border: 1px solid var(--hairline); border-radius: 14px; background: rgba(255, 255, 255, .03); color: var(--muted);
}
.preset-card canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #050505; transition: scale 1.8s var(--out), filter .8s; filter: saturate(.92); }
.preset-card span { display: block; padding: 9px 11px 0; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; transition: color .4s, text-shadow .4s; }
.preset-card:hover { --zoom: 1.04; border-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .06); box-shadow: 0 18px 40px rgba(0, 0, 0, .55), 0 0 26px rgba(216, 215, 221, .14); }
.preset-card:hover canvas { scale: 1.08; filter: saturate(1.12) brightness(1.06); }
.preset-card:hover span { color: #fff; }
.preset-card[aria-pressed=true] { border-color: #fff; background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 1px #fff, 0 0 26px rgba(255, 255, 255, .2); }
.preset-card[aria-pressed=true] span { color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, .6); }
.preset-variants {
  display: inline-flex; flex-wrap: wrap; gap: 3px; margin-top: 16px; padding: 3px;
  border: 1px solid var(--hairline); border-radius: 999px; background: rgba(0, 0, 0, .5);
}
.preset-variants:empty { display: none; }
.preset-variant {
  padding: 7px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 16px;
  transition: color .4s, background-color .45s, box-shadow .5s;
  animation: pop-in .6s var(--spring) calc(var(--i, 0) * 50ms) backwards;
}
.preset-variant:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.preset-variant[aria-pressed=true] { color: #fff; background: rgba(255, 255, 255, .15); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }

/* settings */
.demo-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; padding: 22px; border-top: 1px solid var(--hairline); }
.demo-setting { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.demo-setting label { font-size: 16px; color: var(--text); }
.demo-setting select {
  width: 100%; min-width: 0; padding: 11px 40px 11px 14px; appearance: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-ctl); background-color: rgba(255, 255, 255, .04); color: #fff; font-size: 17px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23fff' stroke-width='1.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  transition: border-color .4s, background-color .4s, box-shadow .6s var(--out);
}
.demo-setting select:hover { border-color: var(--line-strong); background-color: rgba(255, 255, 255, .07); }
.demo-setting select:focus-visible { border-color: #fff; box-shadow: var(--glow); outline: none; }
.demo-setting select option { background: #111; color: #fff; }
.demo-setting input[type=color] {
  width: 44px; height: 44px; padding: 3px; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent;
  transition: scale .8s var(--spring), box-shadow .5s;
}
.demo-setting input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.demo-setting input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.demo-setting input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
.demo-setting input[type=color]:hover { scale: 1.1; box-shadow: var(--glow); }
.range-setting label { display: flex; justify-content: space-between; gap: 8px; }
.range-setting output { color: var(--soft); font-variant-numeric: tabular-nums; }
.range-setting input { width: 100%; }
.demo-note { padding-top: 14px; border-top: 1px solid var(--hairline); }

/* --------------------------------------------------------------- keyframes */
@keyframes crystal-drift { from { scale: 1; } to { scale: 1.04; } }
@keyframes float-shard { from { transform: rotate(var(--rot, 0deg)) translateY(-7px); } to { transform: rotate(calc(var(--rot, 0deg) + 2deg)) translateY(10px); } }
@keyframes line-glimmer { 0%, 15% { translate: -100% 0; } 65%, 100% { translate: 100% 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero-demo-link:hover, .qualities article:hover h3, .qualities article:hover .quality-num { translate: 0 0; }
}

/* ------------------------------------------------------------------ narrow */
@media (max-width: 900px) {
  .preset-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .qualities { grid-template-columns: 1fr; margin-inline: 0; }
}
@media (max-width: 700px) {
  .hero { min-height: 620px; }
  .hero-backdrop { background-position: 58% center; }
  .shard-one { left: -20px; top: 30%; width: 120px; height: 135px; }
  .shard-two { right: -15px; top: 21%; width: 95px; height: 120px; }
  .shard-three { display: none; }
  .hero h1 { font-size: 62px; }
  .hero p { font-size: 22px; }
  .hero-button { min-width: 220px; font-size: 25px; }
  .reading-width { padding-inline: 20px; }
  .about { padding-top: 70px; padding-bottom: 78px; }
  .demo-section { padding: 16px 16px 84px; }
  .section-title { gap: 14px; }
  .section-title h2 { font-size: 40px; }
  .demo { border-radius: 18px; }
  .demo-stage { margin: 6px 6px 0; border-radius: 12px; }
  .demo-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px 16px; }
  .transport { flex-wrap: wrap; gap: 10px 14px; padding: 12px 14px 4px; }
  .transport input[type=range] { min-width: 50%; }
  .style-picker { padding: 22px 16px 18px; }
  .demo-status, .demo-note { padding-inline: 16px; }
}
@media (max-width: 550px) {
  .concept-images { grid-template-columns: 1fr; gap: 12px; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .preset-card span { font-size: 15px; }
}
@media (max-width: 400px) {
  .hero h1 { font-size: 52px; }
  .demo-settings { gap: 16px; }
  .time { font-size: 13px; }
}
