:root {
  --bg: #171312;
  --surface: rgba(35, 28, 26, 0.78);
  --surface-strong: #241d1b;
  --text: #f6efe6;
  --muted: #d0c1b3;
  --line: rgba(246, 239, 230, 0.12);
  --accent: #d46d3a;
  --accent-dark: #f2b38f;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --content-width: min(1180px, calc(100vw - 2.5rem));
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: "Avenir Next", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(212, 109, 58, 0.22), transparent 24%),
    radial-gradient(circle at bottom right, rgba(113, 67, 43, 0.32), transparent 28%),
    linear-gradient(180deg, #120f0f 0%, #191413 46%, #0d0b0b 100%);
  min-height: 100vh;
}

body.quick-upload-page .site-nav {
  display: none;
}

body.quick-upload-page .site-header {
  justify-content: center;
}

body.home-page {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

body.home-page main {
  padding: 0;
  display: flex;
  align-items: stretch;
}

body.home-page .hero-home {
  margin-top: 0;
  min-height: 0;
  height: 100%;
  width: 100%;
  margin-inline: auto;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 70%);
}

.site-header,
main,
.flash-stack {
  width: var(--content-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 1rem;
}

.brand img {
  width: 176px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(29, 23, 22, 0.76);
  backdrop-filter: blur(12px);
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

main {
  padding: 1rem 0 4rem;
}

.hero,
.split-section,
.preview-section,
.page-intro,
.about-layout,
.auth-card,
.admin-card,
.admin-topbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
  gap: 2rem;
  padding: 2rem;
  overflow: hidden;
}

.hero-home {
  min-height: calc(100vh - 13rem);
  align-items: center;
}

body.home-page .hero {
  grid-template-columns: 1fr;
  align-content: center;
  gap: clamp(1rem, 2.5vh, 1.6rem);
  padding: clamp(1rem, 2.6vh, 2rem);
}

.hero-copy h1,
.page-intro h1,
.about-copy h1,
.auth-card h1,
.admin-topbar h1 {
  font-family: var(--display);
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: 0.96;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
}

.hero-text,
.page-intro p,
.body-copy p,
.about-copy p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-actions,
.section-heading,
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fffaf4;
  cursor: pointer;
}

.button-secondary {
  background: rgba(246, 239, 230, 0.08);
  color: var(--text);
}

.button-danger {
  background: #8a2f24;
}

.hero-card {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 0;
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  background: #120f0f;
}

body.home-page .hero-card {
  width: 100%;
  max-height: min(52vh, 560px);
}

body.home-page .hero-copy {
  width: min(760px, 100%);
}

body.home-page .hero-copy h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
}

.secret-admin-link {
  color: inherit;
  text-decoration: none;
  cursor: default;
}

.secret-admin-link:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 0.1em;
}

body.home-page .hero-text {
  max-width: 620px;
  margin-bottom: 0;
}

.hero-card img,
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 6px);
}

.eyebrow,
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--accent-dark);
  margin: 0 0 0.75rem;
}

.split-section,
.preview-section,
.page-intro,
.about-layout,
.auth-shell,
.admin-topbar,
.admin-grid {
  margin-top: 1.5rem;
}

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  padding: 1.75rem 2rem;
}

.split-section h2,
.preview-section h2,
.portfolio-section h2,
.admin-card h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 3rem);
  margin: 0;
}

.preview-section,
.page-intro,
.auth-card,
.admin-card,
.admin-topbar {
  padding: 1.5rem;
}

.compact-grid,
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.photo-tile,
.photo-card,
.feed-item,
.section-card,
.admin-photo-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.photo-tile img,
.photo-card img,
.feed-item img,
.section-card img,
.admin-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1.14;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.section-card-copy,
.admin-photo-copy {
  padding: 1rem;
}

.section-card-copy p,
.admin-photo-copy p,
.section-description,
.list-row p {
  color: var(--muted);
  margin: 0.4rem 0 0;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.feed-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.95rem;
}

.feed-signup-button {
  border: 1px solid rgba(246, 239, 230, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.16), rgba(212, 109, 58, 0.18)),
    rgba(18, 15, 15, 0.72);
  color: var(--text);
  padding: 0.78rem 1rem;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.feed-signup-button:hover {
  transform: translateY(-1px);
  border-color: rgba(246, 239, 230, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.22), rgba(212, 109, 58, 0.3)),
    rgba(18, 15, 15, 0.78);
}

.feed-item {
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  background: transparent;
  display: block;
  text-align: left;
}

.feed-photo-card {
  display: grid;
  gap: 0;
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  transition: transform 180ms ease, box-shadow 180ms ease;
  transform-origin: center;
}

.feed-photo-frame {
  margin: clamp(0.45rem, 1.35vw, 0.9rem) clamp(0.45rem, 1.35vw, 0.9rem) 0;
  background: #fff;
  aspect-ratio: 4 / 5;
  justify-self: stretch;
}

.feed-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e8e2d9;
}

.feed-item:hover .feed-photo-card {
  transform: scale(1.025);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.24);
}

.feed-photo-chin {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(0.32rem, 0.62vw, 0.72rem);
  align-items: center;
  padding: clamp(0.52rem, 1.25vw, 1.05rem) clamp(0.45rem, 1.35vw, 0.9rem);
  background: #fff;
  color: #111;
}

.feed-maker-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  width: clamp(36px, 5.65vw, 70px);
  min-width: 0;
  aspect-ratio: 1 / 1;
  height: auto;
  padding: 0;
  box-sizing: border-box;
  overflow: visible;
}

.feed-maker-name {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111;
}

.feed-maker-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.feed-photo-copy {
  display: grid;
  gap: clamp(0.12rem, 0.28vw, 0.32rem);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.feed-photo-primary,
.feed-photo-secondary {
  margin: 0;
  transform-origin: left center;
}

.feed-photo-primary {
  font-size: clamp(0.58rem, 1.2vw, 1rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.055em;
  white-space: nowrap;
  overflow: hidden;
}

.feed-photo-secondary {
  font-size: clamp(0.52rem, 1.05vw, 0.9rem);
  font-weight: 300;
  color: rgba(17, 17, 17, 0.84);
  line-height: 1.12;
  letter-spacing: -0.05em;
  white-space: nowrap;
  overflow: hidden;
}

.feed-sentinel {
  height: 1px;
}

.email-signup-modal {
  width: min(92vw, 470px);
  border: 1px solid rgba(246, 239, 230, 0.16);
  border-radius: 28px;
  padding: 0;
  color: var(--text);
  background: rgba(20, 16, 15, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
  overflow: visible;
}

.email-signup-modal::backdrop {
  background: rgba(2, 2, 3, 0.76);
  backdrop-filter: blur(8px);
}

.email-signup-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgba(246, 239, 230, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
}

.email-signup-card {
  display: grid;
  gap: 1rem;
  padding: 2rem;
}

.email-signup-card h2 {
  max-width: 10ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 8vw, 3.7rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.email-signup-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.email-signup-card label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}

.email-signup-card input {
  width: 100%;
  border: 1px solid rgba(246, 239, 230, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0.95rem 1rem;
}

.email-signup-card input:focus {
  outline: 2px solid rgba(212, 109, 58, 0.55);
  outline-offset: 2px;
}

.signup-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.email-signup-status {
  font-weight: 700;
}

.email-signup-status.is-error {
  color: #ffc6b8;
}

.lightbox {
  width: min(calc(100vw - 6rem), 840px, calc((100vh - 1rem) * 0.7643));
  max-height: calc(100vh - 1rem);
  border: none;
  padding: 0;
  background: transparent;
  color: #151311;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(2, 2, 3, 0.92);
  backdrop-filter: blur(6px);
}

.photo-spec-card {
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  padding: 4.5556% 4.5556% 0;
  width: 100%;
  box-sizing: border-box;
  container-type: inline-size;
  display: block;
  gap: 0;
  overflow: hidden;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.photo-spec-frame {
  background: #fff;
  border: 0;
  padding: 0;
  aspect-ratio: 4 / 5;
  min-height: 0;
  justify-self: center;
  width: 100%;
}

.photo-spec-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e8e2d9;
}

.photo-spec-footer {
  display: grid;
  grid-template-columns: 8.0685% minmax(0, 1fr);
  gap: 4.1565%;
  align-items: center;
  aspect-ratio: 1636 / 228;
  padding: 2.934% 0 2.934% 0.489%;
  box-sizing: border-box;
  background: #fff;
  overflow: hidden;
}

.photo-spec-brand {
  display: flex;
  align-items: center;
}

.maker-badge {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 7.576%;
  box-sizing: border-box;
}

.maker-logo-image {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.maker-badge.has-logo .maker-logo-image {
  display: block;
}

.maker-badge.has-logo .maker-mark,
.maker-badge.has-logo .maker-wordmark {
  display: none;
}

.maker-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 48px;
  border-radius: 14px;
  background: #111;
  color: #fff;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.05em;
}

.maker-wordmark {
  display: none;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #111;
}

.maker-badge[data-maker="fujifilm"] .maker-mark {
  background: linear-gradient(135deg, #111 0%, #222 100%);
  border-radius: 999px;
  font-style: italic;
}

.maker-badge[data-maker="canon"] .maker-mark {
  background: #c41d23;
}

.maker-badge[data-maker="nikon"] .maker-mark {
  background: #ffd22a;
  color: #111;
}

.maker-badge[data-maker="sony"] .maker-mark {
  background: #111;
  color: #f5f5f5;
}

.maker-badge[data-maker="leica"] .maker-mark {
  background: #d81920;
  border-radius: 999px;
  width: clamp(58px, 7vh, 90px);
  height: clamp(58px, 7vh, 90px);
  font-family: "Brush Script MT", "Apple Chancery", cursive;
  font-size: clamp(1.05rem, 2.5vw, 1.95rem);
  font-style: italic;
  letter-spacing: -0.08em;
}

.maker-badge[data-maker="dji"] .maker-mark,
.maker-badge[data-maker="gopro"] .maker-mark,
.maker-badge[data-maker="apple"] .maker-mark,
.maker-badge[data-maker="google"] .maker-mark,
.maker-badge[data-maker="samsung"] .maker-mark,
.maker-badge[data-maker="panasonic"] .maker-mark,
.maker-badge[data-maker="olympus"] .maker-mark,
.maker-badge[data-maker="omsystem"] .maker-mark {
  background: #222;
}

.photo-spec-copy {
  display: grid;
  gap: 0.889cqw;
  align-self: center;
  margin-top: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.photo-spec-primary,
.photo-spec-secondary {
  margin: 0;
  color: #111;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  transform-origin: left center;
}

.photo-spec-primary {
  font-size: clamp(0.72rem, 2.667cqw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.052em;
}

.photo-spec-secondary {
  font-size: clamp(0.66rem, 2.444cqw, 2.75rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.058em;
  color: rgba(17, 17, 17, 0.84);
}

.lightbox-controls {
  position: absolute;
  top: 0;
  right: -0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  transform: translateX(100%);
}

.lightbox-menu {
  position: relative;
}

.lightbox-nav-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  width: 48px;
  height: 64px;
  border-radius: 999px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72);
}

.lightbox-nav-button:disabled {
  cursor: default;
  opacity: 0.24;
}

.lightbox-nav-prev {
  left: -0.75rem;
  transform: translate(-100%, -50%);
}

.lightbox-nav-next {
  right: -0.75rem;
  transform: translate(100%, -50%);
}

.lightbox-menu-button,
.lightbox-close {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.55rem;
  cursor: pointer;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.lightbox-menu-button {
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.lightbox-menu-panel {
  position: absolute;
  top: 0;
  right: calc(100% + 0.45rem);
  min-width: 170px;
  padding: 0.35rem;
  border-radius: 16px;
  background: rgba(17, 17, 17, 0.92);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.lightbox-menu-item {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
}

.lightbox-menu-item:hover,
.lightbox-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.portfolio-sections {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.portfolio-section {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.photo-card figcaption {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem;
}

.photo-card span {
  color: var(--muted);
}

.portfolio-photo-card {
  width: 100%;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
}

.portfolio-lightbox {
  width: min(96vw, 1180px);
  max-height: 92vh;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.portfolio-lightbox::backdrop {
  background: rgba(2, 2, 3, 0.92);
  backdrop-filter: blur(6px);
}

.portfolio-lightbox-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 1rem;
  max-height: 92vh;
}

.portfolio-lightbox-layout img,
.portfolio-lightbox-details {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.portfolio-lightbox-layout img {
  width: 100%;
  max-height: 92vh;
  object-fit: contain;
}

.portfolio-lightbox-details {
  overflow: auto;
  padding: 1.25rem;
}

.portfolio-lightbox-details h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.portfolio-lightbox-details dl {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.portfolio-lightbox-details dl div {
  display: grid;
  gap: 0.2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.portfolio-lightbox-details dt {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portfolio-lightbox-details dd {
  margin: 0;
}

.portfolio-lightbox-close {
  position: absolute;
  top: 0;
  right: -0.75rem;
  transform: translateX(100%);
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.55rem;
  cursor: pointer;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.portfolio-lightbox .lightbox-nav-button {
  top: 50%;
}

.about-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.auth-shell {
  display: flex;
  justify-content: center;
}

.quick-upload-shell {
  display: grid;
  gap: 1rem;
  width: min(560px, 100%);
  margin: 0 auto;
  padding-top: 1rem;
}

.quick-upload-header,
.quick-upload-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.quick-upload-header,
.quick-upload-card {
  padding: 1.4rem;
}

.quick-upload-header h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 9vw, 3.8rem);
  line-height: 0.96;
  margin: 0 0 0.8rem;
}

.quick-upload-header p:last-child {
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
}

.quick-upload-button {
  min-height: 58px;
  font-size: 1rem;
}

.quick-upload-actions {
  display: flex;
  gap: 0.8rem;
}

.quick-upload-actions .button {
  flex: 1;
}

.crop-tool {
  display: grid;
  gap: 0.8rem;
}

.crop-tool[hidden] {
  display: none;
}

.crop-preview {
  width: min(320px, 100%);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)),
    rgba(0, 0, 0, 0.28);
}

.crop-preview img {
  position: absolute;
  max-width: none;
  display: block;
}

.crop-slider-label {
  color: var(--muted);
}

.crop-slider-label input {
  padding: 0;
  accent-color: var(--accent);
}

.file-picker-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.file-picker-row input[type="file"] {
  flex: 0 0 auto;
  width: auto;
  max-width: 52%;
  color: transparent;
}

.file-picker-row input[type="file"]::file-selector-button {
  color: #111;
}

.selected-file-name {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.auth-card {
  width: min(460px, 100%);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-hint {
  margin: 0;
  color: var(--muted);
}

.auth-hint.is-error {
  color: #ffb2a8;
}

.passkey-button {
  width: 100%;
}

.security-card,
.passkey-actions {
  display: grid;
  gap: 1rem;
}

.security-card {
  margin-top: 1.5rem;
}

.passkey-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.stack-form,
.auth-card {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-row input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.admin-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-card-wide {
  grid-column: 1 / -1;
}

.admin-card-spaced {
  margin-top: 1rem;
}

.admin-tabs {
  margin-top: 1.5rem;
}

.admin-tab-nav {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.admin-tab-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  cursor: pointer;
}

.admin-tab-button.is-active {
  background: var(--accent);
  color: #fffaf4;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.is-active {
  display: block;
}

.admin-list {
  display: grid;
  gap: 0.8rem;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.inline-form {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 120px auto;
  gap: 0.75rem;
  flex: 1;
}

.email-subscriber-form {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  align-items: end;
}

.email-test-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.email-subscriber-form .button,
.email-test-form .button {
  box-sizing: border-box;
  min-height: 3.15rem;
  padding-block: 0.85rem;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.admin-sort-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.admin-sort-card {
  display: grid;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.admin-sort-card.is-dragging {
  opacity: 0.55;
}

.admin-sort-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
}

.admin-sort-card img.portfolio-crop-preview {
  object-fit: cover;
  outline: 1px solid rgba(255, 255, 255, 0.16);
  outline-offset: -1px;
}

.portfolio-crop-controls {
  display: grid;
  gap: 0.65rem;
}

.portfolio-crop-controls .admin-note {
  margin: 0;
  font-size: 0.82rem;
}

.portfolio-crop-controls label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.portfolio-crop-controls input[type="range"] {
  width: 100%;
}

.portfolio-crop-controls .button {
  justify-self: start;
  padding: 0.7rem 0.95rem;
}

.portfolio-crop-controls .button:disabled {
  cursor: default;
  opacity: 0.48;
}

.portfolio-crop-controls .sort-status {
  min-height: 1.2em;
}

.drag-handle {
  justify-self: start;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  cursor: grab;
}

.admin-sort-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-sort-copy span,
.admin-note,
.sort-status {
  color: var(--muted);
}

.sort-status.is-error {
  color: #ff9d8e;
}

.portfolio-admin-sections {
  display: grid;
  gap: 1rem;
}

.flash-stack {
  display: grid;
  gap: 0.5rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.flash-success {
  background: rgba(88, 140, 96, 0.18);
}

.flash-error {
  background: rgba(177, 71, 55, 0.16);
}

.empty-state {
  padding: 2rem;
  border-radius: 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 960px) {
  .site-header,
  .hero,
  .about-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .site-header,
  .section-heading,
  .admin-topbar,
  .list-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .compact-grid,
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-home {
    min-height: auto;
  }

  .admin-grid-two,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .admin-tab-nav,
  .admin-sort-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-upload-actions {
    flex-direction: column;
  }

  .passkey-actions {
    grid-template-columns: 1fr;
  }

  .portfolio-lightbox {
    width: min(96vw, 720px);
  }

  .portfolio-lightbox-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .portfolio-lightbox-layout img {
    max-height: 62vh;
  }

  .portfolio-lightbox-close {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top));
    right: max(0.75rem, env(safe-area-inset-right));
    transform: none;
    z-index: 3;
  }

  .lightbox-controls {
    top: 0;
    right: -0.5rem;
  }
}

@media (max-height: 900px) {
  .lightbox {
    width: min(calc(100vw - 6rem), calc((100vh - 1rem) * 0.7643));
  }
}

@media (max-width: 640px) {
  :root {
    --content-width: min(100vw - 1rem, 1180px);
  }

  .site-header,
  .section-heading,
  .admin-topbar,
  .list-row,
  .admin-tab-nav,
  .admin-sort-copy {
    align-items: center;
    text-align: center;
  }

  .site-nav,
  .hero-actions,
  .quick-upload-actions {
    justify-content: center;
  }

  .brand,
  .hero-copy,
  .page-intro,
  .about-copy,
  .body-copy,
  .portfolio-section,
  .quick-upload-header,
  .admin-card {
    text-align: center;
  }

  body.home-page .hero-copy,
  body.home-page .hero-text,
  .page-intro p,
  .about-copy p,
  .body-copy p {
    margin-inline: auto;
  }

  .site-nav,
  .compact-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1,
  .page-intro h1,
  .about-copy h1,
  .auth-card h1,
  .admin-topbar h1 {
    font-size: 2.6rem;
  }

  .feed-grid {
    gap: 0.42rem;
  }

  .feed-actions {
    justify-content: center;
    margin-bottom: 0.8rem;
  }

  .feed-signup-button {
    width: min(100%, 18rem);
  }

  .feed-photo-frame {
    width: calc(100% - 0.64rem);
    margin: 0.32rem auto 0;
  }

  .feed-photo-chin {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.12rem;
    min-height: 0;
    padding: 0.34rem 0.32rem;
  }

  .feed-maker-brand {
    width: clamp(24px, 8.4vw, 34px);
    max-height: 34px;
    overflow: visible;
  }

  .feed-maker-logo {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-position: center;
  }

  .feed-photo-copy {
    gap: 0.12rem;
  }

  .feed-photo-primary {
    font-size: clamp(0.24rem, 1.68vw, 0.58rem);
    letter-spacing: -0.075em;
  }

  .feed-photo-secondary {
    font-size: clamp(0.22rem, 1.55vw, 0.54rem);
    letter-spacing: -0.07em;
  }

  .email-signup-modal {
    width: min(calc(100vw - 1rem), 430px);
  }

  .email-signup-card {
    padding: 1.5rem;
    text-align: center;
  }

  .email-signup-card h2 {
    max-width: none;
  }

  .lightbox {
    width: min(calc(100vw - 1rem), calc((100vh - 1rem) * 0.7643));
    max-height: calc(100vh - 1rem);
  }

  .photo-spec-card {
    justify-items: center;
  }

  .photo-spec-frame,
  .photo-spec-footer {
    width: 100%;
  }

  .photo-spec-footer {
    overflow: hidden;
  }

  .lightbox-controls {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top));
    right: max(0.75rem, env(safe-area-inset-right));
    transform: none;
    gap: 0.35rem;
  }

  .lightbox-menu-button,
  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.35rem;
  }

  .lightbox-menu-button {
    font-size: 1rem;
  }

  .lightbox-menu-panel {
    top: 0;
    right: calc(100% + 0.45rem);
  }

  .lightbox-nav-button {
    position: fixed;
    top: 50%;
    width: 38px;
    height: 52px;
    font-size: 2rem;
    background: rgba(17, 17, 17, 0.18);
    backdrop-filter: blur(8px);
  }

  .lightbox-nav-prev {
    left: max(0.35rem, env(safe-area-inset-left));
    transform: translateY(-50%);
  }

  .lightbox-nav-next {
    right: max(0.35rem, env(safe-area-inset-right));
    transform: translateY(-50%);
  }
}
