/* ============================================================
   Art Portfolio — Refined Dark Elegance
   Fonts : Cormorant Garamond (display) + Noto Sans JP (body)
   Palette: near-black bg, soft white text, muted teal accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Noto+Sans+JP:wght@300;400&display=swap');

/* ---------- Variables ---------- */
:root {
  --accent:       #8ecfcb;
  --accent-dim:   rgba(142, 207, 203, 0.13);
  --bg:           #07080d;
  --surface:      rgba(12, 14, 22, 0.76);
  --border:       rgba(255, 255, 255, 0.08);
  --border-hover: rgba(142, 207, 203, 0.3);
  --text-1:       #e8e8ee;
  --text-2:       #6e6e88;
  --radius:       4px;
  --ease:         0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Canvas ---------- */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.38;
}

/* ---------- Deep vignette — keeps bg subtle ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    ellipse 100% 100% at 50% 50%,
    rgba(7, 8, 13, 0.25) 0%,
    rgba(7, 8, 13, 0.88) 100%
  );
  pointer-events: none;
}

/* ---------- Container ---------- */
.container {
  position: relative;
  z-index: 2;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 36px 100px;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 24px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.brand h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.9rem, 3.5vw, 2.9rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-1);
}

.brand p {
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-top: 8px;
}

/* ---------- Nav ---------- */
.topnav { display: flex; gap: 8px; }

.pill {
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 9px 22px;
  border-radius: var(--radius);
  transition: var(--ease);
}

.pill:hover {
  color: var(--accent);
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.input { flex: 1; max-width: 400px; position: relative; }

.input::before {
  content: '⌕';
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  font-size: 1rem;
  pointer-events: none;
}

#q {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 10px 14px 10px 36px;
  outline: none;
  transition: var(--ease);
}

#q::placeholder { color: var(--text-2); opacity: 0.6; }

#q:focus {
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

.metaNote {
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--text-2);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Loading ---------- */
.loading {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--text-2);
  text-align: center;
  padding: 80px 0;
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.8; }
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 22px;
}

/* ---------- Card ---------- */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: cardIn 0.55s ease both;
}

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

.card:nth-child(1)  { animation-delay: 0.00s; }
.card:nth-child(2)  { animation-delay: 0.05s; }
.card:nth-child(3)  { animation-delay: 0.10s; }
.card:nth-child(4)  { animation-delay: 0.15s; }
.card:nth-child(5)  { animation-delay: 0.20s; }
.card:nth-child(6)  { animation-delay: 0.25s; }
.card:nth-child(7)  { animation-delay: 0.30s; }
.card:nth-child(8)  { animation-delay: 0.35s; }
.card:nth-child(9)  { animation-delay: 0.40s; }
.card:nth-child(10) { animation-delay: 0.45s; }
.card:nth-child(11) { animation-delay: 0.50s; }
.card:nth-child(12) { animation-delay: 0.55s; }

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
}

/* ---------- Thumbnail ---------- */
.thumb {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #0a0c14;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease), filter 0.5s;
  filter: brightness(0.88) saturate(0.82);
}

.card:hover .thumb img {
  transform: scale(1.05);
  filter: brightness(0.98) saturate(1.0);
}

/* Soft highlight on hover */
.thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(142, 207, 203, 0.07) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.45s;
  pointer-events: none;
}
.card:hover .thumb::after { opacity: 1; }

/* ---------- Badge (date) ---------- */
.badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-weight: 300;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-2);
  background: rgba(7, 8, 13, 0.72);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 2px;
  backdrop-filter: blur(6px);
  z-index: 3;
}

/* ---------- Card body ---------- */
.cardBody {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-top: 1px solid var(--border);
}

.title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s;
}

.card:hover .title { color: var(--accent); }

.desc {
  font-size: 0.72rem;
  color: var(--text-2);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.02em;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(142, 207, 203, 0.2);
  border-radius: 2px;
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(142, 207, 203, 0.2);
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {/* ============================================================
   Art Portfolio — Refined Dark Elegance
   Fonts : Cormorant Garamond (display) + Noto Sans JP (body)
   Palette: near-black bg, soft white text, muted teal accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Noto+Sans+JP:wght@300;400&display=swap');

/* ---------- Variables ---------- */
:root {
  --accent:       #8ecfcb;
  --accent-dim:   rgba(142, 207, 203, 0.13);
  --bg:           #07080d;
  --surface:      rgba(12, 14, 22, 0.76);
  --border:       rgba(255, 255, 255, 0.08);
  --border-hover: rgba(142, 207, 203, 0.3);
  --text-1:       #e8e8ee;
  --text-2:       #6e6e88;
  --radius:       4px;
  --ease:         0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Canvas ---------- */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.38;
}

/* ---------- Deep vignette — keeps bg subtle ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    ellipse 100% 100% at 50% 50%,
    rgba(7, 8, 13, 0.25) 0%,
    rgba(7, 8, 13, 0.88) 100%
  );
  pointer-events: none;
}

/* ---------- Container ---------- */
.container {
  position: relative;
  z-index: 2;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 36px 100px;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 24px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.brand h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(1.9rem, 3.5vw, 2.9rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-1);
}

.brand p {
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-top: 8px;
}

/* ---------- Nav ---------- */
.topnav { display: flex; gap: 8px; }

.pill {
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 9px 22px;
  border-radius: var(--radius);
  transition: var(--ease);
}

.pill:hover {
  color: var(--accent);
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.input { flex: 1; max-width: 400px; position: relative; }

.input::before {
  content: '⌕';
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  font-size: 1rem;
  pointer-events: none;
}

#q {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 10px 14px 10px 36px;
  outline: none;
  transition: var(--ease);
}

#q::placeholder { color: var(--text-2); opacity: 0.6; }

#q:focus {
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

.metaNote {
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--text-2);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- Loading ---------- */
.loading {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--text-2);
  text-align: center;
  padding: 16px 0;
  animation: breathe 2.4s ease-in-out infinite;
}

.loading:empty {
  display: none;
}

@keyframes breathe {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.8; }
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 22px;
}

/* ---------- Card ---------- */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: cardIn 0.55s ease both;
}

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

.card:nth-child(1)  { animation-delay: 0.00s; }
.card:nth-child(2)  { animation-delay: 0.05s; }
.card:nth-child(3)  { animation-delay: 0.10s; }
.card:nth-child(4)  { animation-delay: 0.15s; }
.card:nth-child(5)  { animation-delay: 0.20s; }
.card:nth-child(6)  { animation-delay: 0.25s; }
.card:nth-child(7)  { animation-delay: 0.30s; }
.card:nth-child(8)  { animation-delay: 0.35s; }
.card:nth-child(9)  { animation-delay: 0.40s; }
.card:nth-child(10) { animation-delay: 0.45s; }
.card:nth-child(11) { animation-delay: 0.50s; }
.card:nth-child(12) { animation-delay: 0.55s; }

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
}

/* ---------- Thumbnail ---------- */
.thumb {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #0a0c14;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease), filter 0.5s;
  filter: brightness(0.88) saturate(0.82);
}

.card:hover .thumb img {
  transform: scale(1.05);
  filter: brightness(0.98) saturate(1.0);
}

/* Soft highlight on hover */
.thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(142, 207, 203, 0.07) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.45s;
  pointer-events: none;
}
.card:hover .thumb::after { opacity: 1; }

/* ---------- Badge (date) ---------- */
.badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-weight: 300;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-2);
  background: rgba(7, 8, 13, 0.72);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 2px;
  backdrop-filter: blur(6px);
  z-index: 3;
}

/* ---------- Card body ---------- */
.cardBody {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-top: 1px solid var(--border);
}

.title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s;
}

.card:hover .title { color: var(--accent); }

.desc {
  font-size: 0.72rem;
  color: var(--text-2);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: 0.02em;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(142, 207, 203, 0.2);
  border-radius: 2px;
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(142, 207, 203, 0.2);
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .container  { padding: 0 18px 60px; }
  .header     { flex-direction: column; gap: 10px; padding: 18px 0 12px; align-items: flex-start; }
  .toolbar    { margin-bottom: 14px; }
  .grid       { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .brand h1   { font-size: 1.7rem; }
}
  .container  { padding: 0 18px 60px; }
  .header     { flex-direction: column; gap: 10px; padding: 18px 0 12px; align-items: flex-start; }
  .toolbar    { margin-bottom: 14px; }
  .grid       { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .brand h1   { font-size: 1.7rem; }
}