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

:root {
  --ink: #0f0e0d;
  --paper: #f5f0e8;
  --mid: #c8bfb0;
  --accent: #2a2520;
  --fade: #8a8074;
}

html, body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
}

/* grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 100;
  opacity: 0.5;
}

.page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(2rem, 5vw, 4rem);
}

.center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
}

/* SVG squiggle */
.squiggle {
  width: clamp(120px, 22vw, 240px);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  opacity: 0;
  animation: drawIn 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.squiggle path {
  stroke: var(--ink);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: dash 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes dash {
  to { stroke-dashoffset: 0; }
}

@keyframes drawIn {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  100% { opacity: 1; }
}

.label {
  font-family: 'DM Mono', monospace;
  font-weight: 300;
  font-size: clamp(0.6rem, 1.1vw, 0.72rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fade);
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  opacity: 0;
  animation: fadeUp 0.7s ease 1.4s forwards;
}

h1 {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 5.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 14ch;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.6s forwards;
}

h1 em {
  font-style: normal;
  color: var(--fade);
}

.sub {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
  font-weight: 300;
  color: var(--fade);
  line-height: 1.7;
  max-width: 38ch;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.9s forwards;
}

/* landing page: platform row — same typography as .sub, slightly wider tracking */
.platforms {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  font-family: 'DM Mono', monospace;
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
  font-weight: 300;
  color: var(--fade);
  letter-spacing: 0.08em;
  line-height: 1.7;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.9s forwards;
}

.footer {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  opacity: 0;
  animation: fadeUp 0.7s ease 2.2s forwards;
}

.sig {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
}

.meta {
  text-align: right;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  line-height: 1.8;
}

.meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.meta a:hover,
.meta a:focus-visible {
  border-bottom-color: currentColor;
}

/* thin horizontal rule */
.rule {
  width: 100%;
  height: 1px;
  background: var(--mid);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeIn 0.5s ease 2.1s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@media (max-width: 480px) {
  .footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .meta { text-align: left; }
}

/* root page: app card list */
.apps {
  list-style: none;
  margin-top: clamp(2rem, 4vw, 3rem);
  margin-bottom: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  width: 100%;
  max-width: 56ch;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.9s forwards;
}

.app,
.app-link {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.5rem);
  text-decoration: none;
  color: inherit;
}

.app-icon {
  width: clamp(56px, 9vw, 88px);
  height: clamp(56px, 9vw, 88px);
  border-radius: 18%;
  flex: 0 0 auto;
  object-fit: cover;
  background: var(--mid);
}

.app-icon--placeholder {
  display: grid;
  place-items: center;
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--fade);
  background: transparent;
  border: 1px dashed var(--mid);
}

.app-text {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.app-name {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.1;
  color: var(--ink);
}

.app-name .arrow {
  font-style: normal;
  color: var(--fade);
  margin-left: 0.25em;
  display: inline-block;
  transition: transform 0.2s ease, color 0.2s ease;
}

.app-link:hover .arrow,
.app-link:focus-visible .arrow {
  transform: translateX(4px);
  color: var(--ink);
}

.app-tag {
  font-family: 'DM Mono', monospace;
  font-weight: 300;
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
  color: var(--fade);
  line-height: 1.6;
}

.app-tag em {
  font-style: normal;
  color: var(--ink);
}

/* subpage: app icon hero (replaces .squiggle slot) */
.app-hero-icon {
  width: clamp(96px, 16vw, 160px);
  height: auto;
  border-radius: 22%;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  opacity: 0;
  animation: fadeUp 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}
