/* Cole Harrill — portfolio */

:root {
  --base: #D6D6D3;          /* light gray wash; photos tint the page from here */
  --ink: #1A1A1A;
  --mid: #4F4F4C;           /* secondary text */
  --dim: #55554F;           /* list rows not in focus */
  --line: rgba(26, 26, 26, 0.12);
  --rule: rgba(26, 26, 26, 0.35);
  --mono: "Courier New", Courier, monospace;
  --side: 240px;
}

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

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

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font: 12px/1.45 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background-color 0.9s ease;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }

img { display: block; max-width: 100%; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Frame: sidebar + main ---------- */

.frame {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}

.sidebar-top { display: flex; flex-direction: column; gap: 48px; }

.brand { display: flex; flex-direction: column; gap: 6px; }
.brand-name { font-weight: bold; font-size: 13px; }

.nav { display: flex; flex-direction: column; gap: 6px; font-weight: bold; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }

.updated { color: var(--mid); font-size: 11px; }

.sidebar .menu-toggle { display: none; }

.main {
  min-width: 0;
  padding: 28px 40px 64px 16px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.topbar { display: flex; justify-content: flex-end; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  background: none;
  font-weight: bold;
  cursor: pointer;
}
.btn:hover { text-decoration: none; background: var(--ink); color: var(--base); }
.btn svg { width: 12px; height: 12px; }

.btn-solid { background: var(--ink); color: var(--base); border: 0; padding: 0 28px; min-height: 48px; }
.btn-solid:hover { background: #000; }

/* ---------- Table-style lists (photos, projects) ---------- */

.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.split > .list { flex: 1 1 460px; min-width: 0; }
.split > .preview { flex: 1 1 420px; min-width: 0; position: sticky; top: 28px; }

.list-head, .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) 56px;
  gap: 16px;
}
.list-head {
  padding-bottom: 10px;
  font-size: 11px;
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
}
.list-head .year, .row .year { text-align: right; }

.row {
  width: 100%;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s;
}
.row.is-active { color: #111; font-weight: bold; }
.row:focus-visible { outline-offset: -2px; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  font-size: 11px;
}
.pager button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pager button:disabled { opacity: 0.35; cursor: default; }
.pager-count { color: var(--mid); }

.preview { margin: 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.preview img { max-height: calc(100vh - 140px); width: auto; object-fit: contain; cursor: pointer; }
.caption { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 11px; }
.caption .title { font-weight: bold; }

/* ---------- Photography: desktop index vs mobile scroll ---------- */

.scroll-view { display: none; }

.work { display: flex; flex-direction: column; gap: 10px; }
.work-image { padding: 0; border: 0; background: none; cursor: pointer; width: 100%; }
.work-image img { width: 100%; height: auto; background: rgba(26, 26, 26, 0.06); }
.work .caption { justify-content: space-between; gap: 12px; }
.work .where { color: #3F3F3C; text-align: right; }

.load-more { width: 100%; min-height: 48px; }

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

.filters { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; }
.filters button { min-height: 44px; padding: 0 14px; border: 1px solid var(--ink); background: none; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--base); }

.projects .list-head, .project {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 48px 132px;
  gap: 16px;
}
.project {
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: #3F3F3C;
}
.project.is-active { color: #111; }
.project .name { display: flex; flex-direction: column; gap: 4px; }
.project .name strong { font-weight: bold; }
.project .sub { font-size: 11px; color: var(--mid); }
.project .file { text-align: right; }
.project .file a { text-decoration: underline; text-underline-offset: 3px; }
.project .file span { color: var(--mid); }
.project .cover-inline { display: none; }

.projects-preview { max-width: 420px; }
.projects-preview img { width: 100%; object-fit: cover; }
.projects-preview .meta { font-size: 11px; color: var(--mid); }
.ratio-portrait { aspect-ratio: 4 / 5; }
.ratio-square { aspect-ratio: 1 / 1; }

/* ---------- Contact ---------- */

.contact { display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-start; }
.contact-info { flex: 1 1 260px; max-width: 320px; display: flex; flex-direction: column; gap: 32px; padding-top: 72px; }
.contact-info p { margin: 0; line-height: 1.7; }
.contact-info dl { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 16px; font-size: 11px; }
.contact-info dt { color: var(--mid); }
.contact-info dd { margin: 0; }
.contact-info dd a { text-transform: none; text-decoration: underline; text-underline-offset: 3px; }

.form { flex: 999 1 480px; min-width: 0; max-width: 720px; display: flex; flex-direction: column; gap: 32px; }
.form fieldset { border: 0; margin: 0; padding: 0; }
.form legend { padding: 0; margin-bottom: 12px; font-weight: bold; }

.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.topic { position: relative; }
.topic input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.topic span {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 56px; padding: 0 16px; border: 1px solid var(--ink);
}
.topic span::after { content: "○"; font-size: 11px; }
.topic input:checked + span { background: var(--ink); color: var(--base); }
.topic input:checked + span::after { content: "●"; }
.topic input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.fields[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--mid); }
.field input, .field select, .field textarea {
  font: 12px/1.45 var(--mono);
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 0;
  min-height: 44px;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: 4px; }
.field-wide { grid-column: 1 / -1; }
.honeypot { display: none; }

.send { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.status { font-size: 11px; }

/* ---------- Entrance ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 28px 16px;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.intro.is-done { opacity: 0; visibility: hidden; }
.intro[hidden] { display: none; }

.intro img {
  height: min(520px, 52vh);
  width: auto;
  opacity: 0;
  animation: intro-photo 1.2s ease 3.4s forwards;
}
.intro-title {
  margin: 0;
  font-size: 20px;
  font-weight: normal;
  letter-spacing: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0 1ch;
}
.type { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; }
.type-name { font-weight: bold; animation: type-12 1s steps(12, end) 0.2s forwards; }
.type-bar { opacity: 0; animation: appear 0.1s linear 1.4s forwards; }
.type-line { animation: type-25 1.6s steps(25, end) 1.6s forwards; }
.cursor { display: inline-block; width: 1ch; opacity: 0; animation: appear 0.1s linear 3.3s forwards, blink 1s steps(1) 3.3s infinite; }
.intro-enter {
  min-height: 44px; padding: 0 12px; border: 0; background: none;
  font-size: 11px; letter-spacing: 0.08em; cursor: pointer;
}
.intro-enter:hover { text-decoration: underline; text-underline-offset: 4px; }

@keyframes type-12 { to { width: 12ch; } }
@keyframes type-25 { to { width: 25ch; } }
@keyframes appear { to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes intro-photo { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Phones and small tablets ---------- */

@media (max-width: 820px) {
  .frame { display: block; }

  .sidebar { position: static; height: auto; padding: 16px; gap: 0; }
  .sidebar-top { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0; }
  .brand { padding-top: 12px; }
  .brand-tag { font-size: 11px; }
  .sidebar .menu-toggle { display: inline-flex; min-width: 72px; }
  .nav { display: none; width: 100%; padding-top: 24px; gap: 0; font-size: 14px; }
  .nav a { min-height: 44px; display: flex; align-items: center; border-bottom: 1px solid rgba(26, 26, 26, 0.2); }
  .sidebar .updated { display: none; }
  .sidebar.is-open .nav { display: flex; }
  .sidebar.is-open .updated { display: block; padding-top: 16px; }

  .main { padding: 24px 16px 48px; gap: 32px; }
  .topbar { display: none; }

  .index-view { display: none; }
  .scroll-view { display: flex; flex-direction: column; gap: 64px; }

  .split > .preview { display: none; }
  .projects .list-head { display: none; }
  .project { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 24px 0; }
  .project .cover-inline { display: block; grid-area: 1 / 1 / 2 / -1; width: 100%; object-fit: cover; margin-bottom: 8px; }
  .project .name { grid-area: 2 / 1 / 3 / -1; }
  .project .kind { grid-area: 3 / 1; color: var(--mid); font-size: 11px; }
  .project .year { grid-area: 3 / 2; text-align: right; color: var(--mid); font-size: 11px; }
  .project .file { grid-area: 4 / 1 / 5 / -1; text-align: left; }

  .contact { gap: 40px; }
  .contact-info { padding-top: 0; max-width: none; }
  .topics, .fields { grid-template-columns: minmax(0, 1fr); }

  .footer-updated { display: block; padding: 24px 16px 32px; border-top: 1px solid rgba(26, 26, 26, 0.2); color: var(--mid); font-size: 11px; text-align: right; }
}

.footer-updated { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

.main:focus { outline: none; }
.topbar.has-filters { justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .topbar.has-filters { display: flex; }
  .topbar.has-filters .btn { display: none; }
}
