/* Sandbox by Cristian Perez — shell stylesheet.
   Scoped to Sandbox-owned pages (homepage, placeholders, 404).
   Integrated applications never load this file. */

:root {
  --paper: #fcf9f3;
  --paper-deep: #f4f0e7;
  --surface: #fffdf9;
  --ink: #2a2826;
  --graphite: #595552;
  --stone: #8b857d;
  --mist: #b9b3a9;
  --rule: #e4ded3;
  --rule-strong: #d3ccbf;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgb(42 40 38 / 0.04), 0 2px 6px rgb(42 40 38 / 0.04);
  --shadow-lg: 0 2px 4px rgb(42 40 38 / 0.04), 0 18px 40px -12px rgb(42 40 38 / 0.16);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
}

@view-transition { navigation: auto; }

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main { flex: 1; min-width: 0; width: 100%; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  /* keep content clear of the iPhone notch / rounded corners in landscape */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ------------------------------------------------------------ header */

.site-header { border-bottom: 1px solid var(--rule); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand__mark { width: 30px; height: auto; }
.brand__name {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--graphite);
}
.brand__text { display: inline-flex; flex-direction: row; align-items: baseline; gap: 12px; }
.brand__by {
  padding-left: 12px;
  border-left: 1px solid var(--rule-strong);
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--stone);
}

.site-nav { display: flex; gap: clamp(18px, 3vw, 36px); }
.site-nav a {
  position: relative;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--graphite);
  padding: 6px 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ------------------------------------------------------------ library */

.library { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(56px, 8vw, 96px); }

.library__intro { margin-bottom: 24px; }
.library__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.library__lede { margin: 8px 0 0; font-size: 15px; color: var(--stone); }

/* search + discipline filters */

.finder {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 560px;
}
.search__icon {
  position: absolute;
  left: 15px;
  color: var(--stone);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 46px;
  padding: 0 42px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 16px;          /* 16px or more stops iOS Safari zooming in on focus */
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--mist); }
.search input:hover { border-color: var(--mist); }
.search input:focus {
  outline: none;
  border-color: var(--graphite);
  box-shadow: 0 0 0 4px rgb(89 85 82 / 0.08);
}
.search input::-webkit-search-cancel-button { display: none; }
.search__key {
  position: absolute;
  right: 14px;
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--stone);
  transition: opacity 0.2s;
}
.search input:focus ~ .search__key,
.search input:not(:placeholder-shown) ~ .search__key { opacity: 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.chip {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  color: var(--graphite);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip:hover { border-color: var(--graphite); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* directory: compact rows, two columns on wide screens, always A–Z */

.directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.entry { border-bottom: 1px solid var(--rule); }
.entry[hidden] { display: none; }

.entry__link {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s var(--ease);
}
@media (hover: hover) {
  .entry__link:hover { background: var(--paper-deep); }
}
.entry__link:focus-visible { outline-offset: 0; border-radius: var(--radius-sm); }

.entry__logo {
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--art-bg, var(--paper-deep));
}
.entry__logo .art__logo { width: 76%; height: 76%; }
.entry__logo .art__logo--cover { width: 100%; height: 100%; }
.entry__logo .art__monogram {
  width: auto; aspect-ratio: auto;
  border: 0; border-radius: 0; box-shadow: none;
  font-size: 24px;
}

.entry__text { display: flex; flex-direction: column; min-width: 0; }
.entry__name {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
}
.entry__desc { margin-top: 3px; font-size: 14.5px; line-height: 1.5; color: var(--stone); }
.entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 8px;
  font-size: 12px;
}
.entry__discipline { letter-spacing: 0.04em; color: var(--stone); }
.entry__sep { color: var(--mist); }
.entry__launch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.entry__launch svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
@media (hover: hover) {
  .entry__link:hover .entry__launch svg { transform: translateX(3px); }
}
/* phone-only pieces of each row */
.entry__status, .entry__chev { display: none; }
.entry__soon { font-style: italic; color: var(--mist); }

/* logo artwork, shared with placeholder pages */

.art__logo { object-fit: contain; }
.art__logo--cover { object-fit: cover; }
.art__monogram {
  display: grid;
  place-items: center;
  width: clamp(96px, 30%, 132px);
  aspect-ratio: 1;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: 0.02em;
  color: var(--graphite);
  box-shadow: inset 0 0 0 6px var(--art-bg, var(--paper-deep)), inset 0 0 0 7px var(--rule);
}

/* labels used on placeholder pages */

.placeholder__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.card__category {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--graphite);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 1px solid var(--graphite);
}
.status--available::before { background: var(--graphite); }
.status--in-development::before { background: linear-gradient(90deg, var(--graphite) 50%, transparent 50%); }
.status--prototype::before { border-style: dashed; }

/* empty state */

.empty {
  padding: clamp(48px, 8vw, 88px) 24px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  text-align: center;
}
.empty__title {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 3.4vw, 36px);
  color: var(--ink);
}
.empty__text { margin: 8px auto 28px; max-width: 40ch; color: var(--stone); }

.button-quiet {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.button-quiet:hover { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------ footer */

.site-footer { border-top: 1px solid var(--rule); }
.site-footer__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  font-size: 13px;
  color: var(--stone);
}
.site-footer__inner p { margin: 0; flex: 1; }
.site-footer__inner { min-height: 72px; padding-bottom: env(safe-area-inset-bottom); }
.site-footer__mark img { width: 26px; height: auto; opacity: 0.85; }
.site-footer__link {
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  color: var(--graphite);
}
.site-footer__link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ------------------------------------------------------------ placeholder page */

.placeholder { padding: clamp(32px, 6vw, 64px) 0 clamp(72px, 10vw, 120px); }
.placeholder__inner { max-width: calc(720px + var(--gutter) * 2); }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--mist);
}
.crumbs a { color: var(--stone); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--graphite); }

.placeholder__art {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin-bottom: 36px;
  background: var(--art-bg, var(--paper-deep));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.placeholder__art .art__logo { width: 48%; height: 48%; }
.placeholder__art .art__monogram { width: clamp(120px, 26%, 168px); font-size: clamp(44px, 6vw, 60px); }

.placeholder__meta { justify-content: flex-start; gap: 18px; }
.placeholder__title {
  margin: 14px 0 12px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 6.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.placeholder__desc {
  margin: 0;
  max-width: 52ch;
  font-family: var(--serif);
  font-size: clamp(21px, 2.4vw, 25px);
  line-height: 1.4;
  color: var(--graphite);
}
.placeholder__note {
  margin: 40px 0;
  padding: 24px 26px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.placeholder__note p { margin: 0; font-size: 15px; color: var(--stone); }
.placeholder__note .placeholder__note-title {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite);
}

@media (prefers-reduced-motion: no-preference) {
  .placeholder__inner > * { animation: rise 0.9s var(--ease) both; }
  .placeholder__inner > :nth-child(2) { animation-delay: 0.08s; }
  .placeholder__inner > :nth-child(n + 3) { animation-delay: 0.16s; }
}

/* ------------------------------------------------------------ 404 */

.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px var(--gutter);
  text-align: center;
}
.notfound__mark { width: 96px; height: auto; margin-bottom: 40px; }
.notfound__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.05;
}
.notfound__text { margin: 16px 0 36px; max-width: 42ch; color: var(--stone); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 820px) {
  .directory { grid-template-columns: 1fr; }
}

/* Phones: a compact list built for one thumb.
   [logo 52] name / one-to-two-line description / discipline · status   [›] */
@media (max-width: 600px) {
  :root { --gutter: 16px; }

  .site-header__inner { height: 56px; }
  .brand { gap: 10px; }
  .brand__mark { width: 26px; }
  .brand__text { flex-direction: column; align-items: flex-start; gap: 1px; }
  .brand__name { font-size: 1.1875rem; line-height: 1.05; }
  .brand__by { padding-left: 0; border-left: 0; font-size: 0.8125rem; line-height: 1.1; }

  .library { padding-top: 20px; padding-bottom: 40px; }
  .library__intro { margin-bottom: 14px; }
  .library__title { font-size: 1.875rem; }
  .library__lede { margin-top: 4px; font-size: 0.875rem; line-height: 1.45; }

  .finder { gap: 10px; padding-bottom: 12px; margin-bottom: 0; }
  .search { max-width: none; }
  .search__icon { left: 14px; }
  .search input { height: 46px; padding: 0 16px 0 40px; }
  .search__key { display: none; }

  /* Chips scroll inside their own strip, bleeding to the screen edge with a
     soft fade, so they never widen the page. */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; height: 34px; padding: 0 12px; font-size: 0.8125rem; }
  .chip:last-child { margin-right: 20px; }

  .directory { display: block; }
  .entry__link {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    margin: 0;
    padding: 14px 0;
    border-radius: 0;
  }
  .entry__link:active { background: var(--paper-deep); }
  .entry__logo { width: 52px; height: 52px; flex-basis: 52px; border-radius: 12px; }
  .entry__logo .art__monogram { font-size: 1.25rem; }
  .entry__name {
    font-family: var(--sans);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.005em;
    overflow-wrap: anywhere;
  }
  .entry__desc {
    margin-top: 2px;
    font-size: 0.84375rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
  .entry__meta { margin-top: 5px; gap: 2px 6px; font-size: 0.71875rem; line-height: 1.3; }
  .entry__discipline { letter-spacing: 0.02em; }
  .entry__launch { display: none; }
  .entry__status { display: inline; color: var(--graphite); font-weight: 500; }
  .entry__soon { font-style: normal; color: var(--mist); }
  .entry__chev { display: grid; place-items: center; color: var(--mist); }
  .entry--pending .entry__chev { opacity: 0.5; }

  .empty { padding: 36px 16px; }
  .site-footer__inner { min-height: 60px; font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .site-nav a { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  @view-transition { navigation: none; }
}

@media print {
  .site-header, .finder { display: none; }
}
