:root {
  --night: #0a1119;
  --navy: #15212e;
  --navy-hi: #1f3040;
  --mint: #7dd6cb;
  --mint-deep: #3fa596;
  --sun: #f5c97a;
  --ink: #e9f1f0;
  --mute: #7f909d;
  --line: rgba(233, 241, 240, 0.1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { background: var(--night); color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(60vmax 45vmax at 50% 34%, rgba(125, 214, 203, 0.09), transparent 70%),
    radial-gradient(120vmax 80vmax at 50% 120%, #0f1a25, transparent 70%),
    var(--night);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; border-radius: 4px; }

.stage {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto auto auto;
  justify-items: center;
  padding: 0 16px;
}

/* ---------- Hero ---------- */

.hero {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12vh 0 8vh;
}

.tile-wrap {
  --rx: 0deg; --ry: 0deg; --sx: 50%; --sy: 30%;
  position: relative;
  width: clamp(150px, 24vmin, 230px);
  aspect-ratio: 1;
  perspective: 900px;
}

.glow {
  position: absolute;
  inset: 15% 10% -35%;
  background: radial-gradient(closest-side, rgba(125, 214, 203, 0.38), rgba(125, 214, 203, 0.08) 60%, transparent);
  filter: blur(30px);
  opacity: 0;
  animation: glow-in 2.4s 0.9s cubic-bezier(.2, .7, .2, 1) forwards;
}

.tile {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 23%;
  background:
    linear-gradient(160deg, var(--navy-hi) 0%, var(--navy) 55%, #101a25 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 40px 80px -30px rgba(0, 0, 0, 0.8),
    0 0 0 0.5px rgba(125, 214, 203, 0.15);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.6s cubic-bezier(.2, .7, .2, 1);
  overflow: hidden;
  animation: tile-in 1.4s cubic-bezier(.16, 1, .3, 1) both;
  -webkit-box-reflect: below 18px linear-gradient(transparent 62%, rgba(255, 255, 255, 0.07));
}

.sheen {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--sx) var(--sy), rgba(255, 255, 255, 0.10), transparent 55%);
  pointer-events: none;
}

.tile-mark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--mint);
  overflow: visible;
}

.tile-mark .stem,
.tile-mark .dot { transform-box: fill-box; transform-origin: 50% 100%; }
.tile-mark .stem { animation: mark-in 1.2s 0.3s cubic-bezier(.16, 1, .3, 1) both; }
/* the dot lands last */
.tile-mark .dot { animation: dot-in 0.9s 1.1s cubic-bezier(.34, 1.56, .64, 1) both; }

.wordmark {
  margin: 56px 0 0;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #c7d6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise 1.2s 0.7s cubic-bezier(.16, 1, .3, 1) both;
}

.services {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--mute);
  animation: rise 1.2s 0.95s cubic-bezier(.16, 1, .3, 1) both;
}

.services li { padding: 0 22px; position: relative; }
.services li + li::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 1px; height: 0.95em;
  transform: translateY(-50%);
  background: var(--line);
}

/* ---------- Projects ---------- */

.work {
  width: 100%;
  max-width: 760px;
  padding: 36px 0 44px;
  border-top: 1px solid var(--line);
  animation: rise 1.2s 1.4s cubic-bezier(.16, 1, .3, 1) both;
}

.work-title {
  margin: 0 0 26px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mute);
  letter-spacing: 0.01em;
}

.apps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: clamp(24px, 6vw, 64px);
}

.app {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 20px -8px rgba(0, 0, 0, 0.7);
}

.icon-teacher rect:first-child { fill: #1b2a39; }
.icon-teacher use, .icon-teacher .g { fill: var(--mint); }
.icon-student rect:first-child { fill: #111822; }
.icon-student use, .icon-student .g { fill: var(--sun); }
.icon-ai rect:first-child { fill: var(--mint); }
.icon-ai use { fill: #13202b; }

.app-name {
  display: flex;
  flex-direction: column;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.app-name span { font-weight: 400; color: var(--mute); font-size: 0.82rem; }

.about {
  max-width: 560px;
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #5d6d79;
  animation: rise 1.2s 1.6s cubic-bezier(.16, 1, .3, 1) both;
}
.about a { color: var(--mute); text-decoration: none; }
.about a:hover { color: var(--ink); }

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

.foot {
  width: 100%;
  max-width: 760px;
  display: flex;
  justify-content: space-between;
  padding: 18px 0 calc(22px + env(safe-area-inset-bottom));
  font-size: 0.78rem;
  color: #5d6d79;
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

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

@keyframes tile-in {
  from { opacity: 0; transform: translateY(24px) scale(0.9); filter: blur(12px); }
  to   { opacity: 1; filter: blur(0); }
}
@keyframes mark-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes dot-in {
  0%   { opacity: 0; transform: translateY(-140%) scale(0.6); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes glow-in { to { opacity: 1; } }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .glow { opacity: 1; }
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .hero { padding: 10vh 0 6vh; }
  .wordmark { margin-top: 44px; }
  .services { flex-direction: column; gap: 8px; }
  .services li { padding: 0; }
  .services li + li::before { display: none; }
  .apps { flex-direction: column; align-items: flex-start; width: max-content; margin: 0 auto; gap: 18px; }
  .foot { flex-direction: column; align-items: center; gap: 6px; }
}
