@font-face {
  font-family: Inter;
  src: url('assets/inter.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5f6f1;
  --white: #fff;
  --ink: #172822;
  --muted: #57665d;
  --line: #e1e6de;
  --sidebar: #152722;
  --sidebar-soft: #bdd0c4;
  --lime: #d9eab7;
  --serif: 'Instrument Serif', Georgia, serif;
  font: 100%/1.5 Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 14.375rem minmax(0, 1fr); }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid #62853b; outline-offset: 4px; }
.sidebar :focus-visible, .feature :focus-visible { outline-color: var(--lime); }
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  z-index: 2;
  inset: .75rem auto auto .75rem;
  padding: .55rem .75rem;
  border-radius: .4rem;
  color: var(--ink);
  background: var(--white);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2.3rem;
  padding: 1.75rem 1.1rem 1.35rem;
  background: var(--sidebar);
  color: #f6f8f0;
}

.brand { display: flex; align-items: center; gap: .65rem; width: fit-content; padding-left: .45rem; font-size: 1.25rem; font-weight: 650; letter-spacing: -.045em; }
.brand-mark { display: flex; align-items: center; justify-content: center; gap: 2px; width: 2.1rem; height: 2.1rem; border-radius: .55rem; background: var(--lime); }
.brand-mark i { width: 3px; height: .85rem; border-radius: 1px; background: #21382a; }
.brand-mark i:nth-child(2) { height: .95rem; }
.brand-mark i:last-child { transform: rotate(-15deg); margin-left: 1px; }

.navigation { display: grid; gap: .275rem; }
.nav-label { margin: 0 0 .45rem .72rem; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #9bb4a5; }
.navigation button {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 2.65rem;
  padding: .5rem .72rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  color: var(--sidebar-soft);
  background: transparent;
  text-align: left;
  font-size: .875rem;
  white-space: nowrap;
}
.navigation button:hover { color: #f2f5ed; background: #233a31; }
.navigation button[aria-pressed='true'] { color: #e2efce; border-color: #40584b; background: #2a4237; font-weight: 600; }
.nav-icon { position: relative; display: inline-block; flex: 0 0 .95rem; width: .95rem; height: .78rem; }
.nav-grid { height: .95rem; border: 1px solid currentColor; border-radius: .22rem; }
.nav-grid::before, .nav-grid::after { content: ''; position: absolute; background: currentColor; opacity: .75; }
.nav-grid::before { width: 1px; height: 100%; left: calc(50% - .5px); }
.nav-grid::after { height: 1px; width: 100%; top: calc(50% - .5px); }
.nav-folder { margin-top: .15rem; border: 1px solid currentColor; border-radius: .17rem; }
.nav-folder::before { content: ''; position: absolute; left: -1px; top: -.22rem; width: .48rem; height: .21rem; border: 1px solid currentColor; border-bottom: 0; border-radius: .18rem .18rem 0 0; }

.sidebar-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem .55rem .2rem;
  border-top: 1px solid #344b40;
}
.sidebar-foot strong, .sidebar-foot div span { display: block; }
.sidebar-foot strong { color: #eef4ea; font-size: .875rem; font-weight: 550; }
.sidebar-foot div span { color: #a9beb1; font-size: .8rem; }
.access-icon { position: relative; flex: 0 0 1rem; height: .75rem; margin-top: .2rem; border: 1px solid #b8cfbe; border-radius: .2rem; }
.access-icon::before { content: ''; position: absolute; left: .19rem; top: -.42rem; width: .5rem; height: .4rem; border: 1px solid #b8cfbe; border-bottom: 0; border-radius: .32rem .32rem 0 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.375rem;
  padding: .75rem clamp(1.4rem, 3.6vw, 3.75rem);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.breadcrumb { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.breadcrumb [aria-hidden] { color: #758678; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; min-width: 0; }
.search {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: min(19rem, 37vw);
  min-width: 0;
  padding: 0 .6rem 0 .8rem;
  border: 1px solid #dde4db;
  border-radius: .5rem;
  background: #f8f9f6;
}
.search:focus-within { outline: 2px solid #668949; outline-offset: 2px; }
.search-icon { position: relative; flex: 0 0 .73rem; height: .73rem; margin-right: .12rem; border: 1.5px solid #566c5d; border-radius: 50%; }
.search-icon::after { content: ''; position: absolute; right: -.27rem; bottom: -.13rem; width: .32rem; height: 1.5px; background: #566c5d; transform: rotate(50deg); }
.search input { width: 100%; min-width: 0; height: 2.5rem; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .875rem; }
.search input::placeholder { color: var(--muted); }
.search kbd { flex: none; padding: .15rem .36rem; border: 1px solid #e0e6dd; border-radius: .22rem; background: var(--white); color: #53665a; font: .75rem/1.3 Inter, system-ui, sans-serif; }
#sign-in, .login-form button[type='submit'] {
  padding: .55rem .95rem;
  border: 1px solid #203c30;
  border-radius: .45rem;
  color: #f5f8ef;
  background: #203c30;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}
#sign-in:hover, .login-form button[type='submit']:hover { background: #345445; }

.main { max-width: 87rem; margin: auto; padding: 2.25rem clamp(1.4rem, 3.6vw, 3.75rem) 3.5rem; }
.page-title { margin-bottom: 1.65rem; }
.page-title h1 { font: 400 clamp(2.9rem, 4.3vw, 4.1rem)/.98 var(--serif); letter-spacing: -.035em; }
.page-title p { margin-top: .75rem; color: var(--muted); }

.feature {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: 16.4rem;
  border: 1px solid #253c31;
  border-radius: .85rem;
  background: #20382d;
  color: #f7faef;
}
.feature-image {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 22%;
  background: #53635f url('assets/north-quay.jpg') center 54% / cover no-repeat;
}
.feature::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #20382d 5%, #20382d 23%, #20382df2 34%, #20382d77 59%, #20382d18 100%);
}
.feature-copy { width: min(32rem, 70%); padding: 1.65rem 2.15rem; }
.feature-label { color: #dfebcc; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .135em; }
.feature h2 { margin: .35rem 0 .35rem; font: 400 clamp(3.4rem, 5.2vw, 4.75rem)/.96 var(--serif); letter-spacing: -.035em; }
.feature-summary { max-width: 19.5rem; color: #e2eadf; }
.collection-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  margin-top: 1.2rem;
  padding: .42rem .9rem;
  border-radius: .4rem;
  background: var(--lime);
  color: #21372b;
  font-size: .875rem;
  font-weight: 650;
}
.collection-link:hover { background: #ecf4d8; }

.files { margin-top: 1.75rem; scroll-margin-top: 1rem; }
.file-bar { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .75rem; }
.file-heading { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .7rem; }
.file-heading h2 { font-size: 1.35rem; letter-spacing: -.035em; font-weight: 650; }
.file-count { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.sort { position: relative; }
.sort::after { content: ''; position: absolute; right: .7rem; top: 44%; width: .4rem; height: .4rem; transform: rotate(45deg); border-right: 1px solid #516557; border-bottom: 1px solid #516557; pointer-events: none; }
.sort select { appearance: none; min-height: 2.4rem; padding: .35rem 1.65rem .35rem .75rem; border: 1px solid #dce4da; border-radius: .4rem; color: var(--ink); background: var(--white); font-size: .875rem; }
.file-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: .72rem; background: var(--white); }
.file-table { width: 100%; border-collapse: collapse; text-align: left; }
.file-table thead { background: #edf0eb; }
.file-table th { color: #4d5d53; font-size: .875rem; font-weight: 580; }
.file-table th, .file-table td { padding: .72rem 1rem; }
.file-table tbody tr { border-top: 1px solid #e8ece5; }
.file-table tbody tr:hover { background: #f8faf6; }
.file-table td { color: var(--muted); font-size: .875rem; }
.file-size, .file-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.file-name {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 620;
  text-align: left;
}
.file-name:hover > span:last-child { text-decoration: underline; text-underline-offset: .25em; }
.format { display: grid; place-items: center; flex: 0 0 2.25rem; width: 2.25rem; height: 2rem; border-radius: .35rem; font-size: .675rem; letter-spacing: .025em; font-weight: 700; }
.format-pdf { background: #f8e7e4; color: #813f38; }
.format-txt { background: #e7eef6; color: #345777; }
.format-csv { background: #e5eee0; color: #3d6036; }
.file-action { text-align: right; }
.file-action a { display: inline-flex; align-items: center; min-height: 2rem; padding: .15rem .55rem; border-radius: .35rem; color: #344f3c; font-weight: 600; }
.file-action a:hover { background: #e9f0e5; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty button { margin-top: .6rem; padding: .38rem .75rem; border: 1px solid #d7e2d5; border-radius: .4rem; background: #f1f4ec; color: var(--ink); }

dialog { width: min(29rem, calc(100% - 2rem)); padding: 1.5rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--white); color: var(--ink); box-shadow: 0 1rem 3rem #12231930; }
dialog::backdrop { background: #11231cb3; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.dialog-top p { color: var(--muted); font-size: .875rem; }
.dialog-top button { padding: .25rem .5rem; border: 0; border-radius: .35rem; color: #344f3c; background: #edf1e9; font-size: .875rem; }
dialog h2 { font: 400 2.35rem/1.05 var(--serif); }
#dialog-summary { margin-top: .7rem; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }
.dialog-actions a { padding: .45rem .75rem; border: 1px solid #c6d9b0; border-radius: .4rem; color: var(--ink); background: #e3efd2; font-size: .875rem; font-weight: 600; }
.dialog-actions a:first-child { border-color: #dce5d9; background: #f4f6f1; }
.dialog-actions a:hover { border-color: #5f8054; }

#login-dialog { width: min(25rem, calc(100% - 2rem)); }
.login-brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.login-brand .brand-mark { width: 1.65rem; height: 1.65rem; border-radius: .4rem; }
#login-title { margin: .85rem 0 1.2rem; font-size: 3rem; }
.login-form { display: flex; flex-direction: column; gap: .4rem; }
.login-form label { color: var(--ink); font-size: .875rem; font-weight: 600; }
.login-form input { width: 100%; min-height: 2.7rem; padding: .45rem .65rem; border: 1px solid #cfdacf; border-radius: .45rem; color: var(--ink); background: #f8f9f6; }
.login-form input + label { margin-top: .5rem; }
.login-form button[type='submit'] { min-height: 2.7rem; margin-top: .65rem; }
.login-error:not(:empty) { margin-top: .5rem; padding: .5rem .65rem; border: 1px solid #ebccc5; border-radius: .4rem; color: #833b33; background: #fcefeb; font-size: .875rem; }

@media (max-width: 66rem) {
  body { grid-template-columns: 12.25rem minmax(0, 1fr); }
  .sidebar { padding-inline: .75rem; }
  .file-table th, .file-table td { padding-inline: .65rem; }
  .file-table .file-category { display: none; }
}

@media (max-width: 49rem) {
  body { display: block; }
  .sidebar { position: static; height: auto; gap: .65rem; padding: .85rem 1.1rem .65rem; }
  .brand { padding-left: .05rem; }
  .navigation { display: flex; gap: .3rem; overflow-x: auto; margin-inline: -.25rem; padding: .25rem; }
  .navigation button { gap: .45rem; min-height: 2.4rem; }
  .nav-label, .sidebar-foot { display: none; }
  .topbar { min-height: 3.65rem; padding-inline: 1.1rem; }
  .main { padding: 1.55rem 1.1rem 2rem; }
  .feature-copy { padding-inline: 1.5rem; }
}

@media (max-width: 32rem) {
  .navigation { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .breadcrumb, .search kbd, .file-table .file-date, .file-table .file-size { display: none; }
  .topbar-actions { width: 100%; }
  .search { width: 100%; }
  .page-title { margin-bottom: 1.25rem; }
  .feature { min-height: 15.5rem; }
  .feature-copy { width: 100%; padding: 1.35rem 1.1rem; }
  .feature-image { left: 0; background-position: 54% center; }
  .feature::after { background: linear-gradient(90deg, #20382dfa 0%, #20382de9 42%, #20382d88 100%); }
  .feature-summary { max-width: 16rem; }
  .files { margin-top: 1.4rem; }
  .file-table td, .file-table th { padding-block: .65rem; }
  .file-name { gap: .5rem; }
  .file-action a { min-height: 2.5rem; padding-inline: .25rem; }
}
