:root {
  --bg: #0F1117;
  --bg-card: #1A1D27;
  --bg-elevated: #222633;
  --border: rgba(255, 255, 255, 0.08);
  --text: #F0F0F5;
  --text-muted: #8B90A0;
  --accent: #6C8EFF;
  --accent-soft: rgba(108, 142, 255, 0.12);
  --green: #4ADE80;
  --green-soft: rgba(34, 197, 94, 0.12);
  --font: 'DM Sans', 'Noto Sans JP', sans-serif;
  --header-h: 64px;
  --toolbar-h: 120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--toolbar-h)); }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--header-h);
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.header__logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.05rem; font-weight: 700;
}
.header__logo-img {
  width: 34px; height: 34px; object-fit: contain; border-radius: 8px;
  background: #223f2d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px;
}
.header__nav { display: flex; gap: 28px; }
.header__nav a { font-size: 0.85rem; color: var(--text-muted); transition: color 0.2s; }
.header__nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: calc(var(--header-h) + 48px) 0 40px;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, var(--accent-soft), transparent);
}
.hero__inner {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center;
}
.hero__label {
  font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700;
  line-height: 1.35; margin-bottom: 16px;
}
.hero__desc { color: var(--text-muted); font-size: 0.9rem; max-width: 480px; margin-bottom: 20px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px; border-radius: 8px; font: inherit; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: 0.2s; border: none; text-decoration: none;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #5a7aee; }
.btn--outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--full { width: 100%; }
.hero__stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.stat {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; text-align: center;
}
.stat strong { display: block; font-size: 1.8rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat span { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; display: block; }

/* Toolbar — sticky */
.main { padding-bottom: 80px; }
.toolbar {
  position: sticky; top: var(--header-h); z-index: 100;
  background: rgba(15, 17, 23, 0.95); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 28px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.toolbar__search {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 14px;
}
.toolbar__search svg { color: var(--text-muted); flex-shrink: 0; }
.toolbar__search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font: inherit; font-size: 0.9rem; padding: 12px 0;
}
.toolbar__search input::placeholder { color: var(--text-muted); }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter__btn {
  padding: 8px 16px; border-radius: 100px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font: inherit; font-size: 0.8rem; cursor: pointer; transition: 0.2s;
}
.filter__btn:hover { border-color: var(--accent); color: var(--text); }
.filter__btn.is-active {
  background: var(--accent-soft); border-color: rgba(108, 142, 255, 0.4); color: var(--accent);
}
.toolbar__count { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

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

/* Category groups */
.works-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.works-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.01);
  overflow: hidden;
}
.works-group__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}
.works-group__toggle:hover { background: var(--bg-elevated); }
.works-group__label { flex: 1; }
.works-group__count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font);
}
.works-group__chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-right: 4px;
}
.works-group__toggle[aria-expanded="true"] .works-group__chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.works-group__panel { padding: 0 12px 12px; }
.works-group__panel[hidden] { display: none; }
.works-group__grid { margin-top: 4px; }

/* Card */
.card {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(108, 142, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.card__thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-elevated); }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card__thumb img { transform: scale(1.04); }
.card__badge {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 9px; border-radius: 4px; font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.05em; background: rgba(15, 17, 23, 0.85);
  border: 1px solid var(--border); backdrop-filter: blur(4px);
}
.card__badge--hp { background: var(--accent-soft); border-color: rgba(108,142,255,0.3); color: var(--accent); }
.card__badge--tool { background: var(--green-soft); border-color: rgba(34,197,94,0.3); color: var(--green); }
.card__badge--app { background: rgba(0, 120, 212, 0.15); border-color: rgba(0, 120, 212, 0.35); color: #58a6ff; }
.card--featured { border-color: rgba(34, 197, 94, 0.2); }
.card--featured:hover { border-color: rgba(34, 197, 94, 0.45); }
.card__body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.card__category { font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.card h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; line-height: 1.35; }
.card__body > p { font-size: 0.82rem; color: var(--text-muted); flex: 1; margin-bottom: 12px; line-height: 1.65; }
.card__stack { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.card__tech {
  font-size: 0.62rem; font-weight: 500; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.card__tech--html { border-color: rgba(228, 77, 38, 0.35); color: #f0a080; }
.card__tech--css { border-color: rgba(38, 77, 228, 0.35); color: #80a8f0; }
.card__tech--javascript { border-color: rgba(247, 223, 30, 0.35); color: #e8d878; }
.card__tech--chartjs { border-color: rgba(255, 99, 132, 0.35); color: #f0a0b0; }
.card__tech--canvas-api { border-color: rgba(155, 89, 182, 0.35); color: #c8a0e0; }
.card__tech--localstorage { border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.card__tech--fetch-api { border-color: rgba(139, 92, 246, 0.35); color: #c4b5fd; }
.card__tech--webhook { border-color: rgba(236, 72, 153, 0.35); color: #f9a8d4; }
.card__tech--csv { border-color: rgba(56, 189, 248, 0.35); color: #7dd3fc; }
.card__tech--auth { border-color: rgba(251, 191, 36, 0.35); color: #fcd34d; }
.card__tech--drag-drop { border-color: rgba(245, 158, 11, 0.35); color: #fbbf24; }
.card__link { font-size: 0.8rem; font-weight: 500; color: var(--accent); margin-top: auto; }

/* Case study on cards */
.card__case {
  margin-bottom: 12px; padding: 12px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
}
.case-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.case-row:last-child { margin-bottom: 0; }
.case-label {
  flex-shrink: 0; font-size: 0.58rem; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 6px; border-radius: 3px; margin-top: 2px;
}
.case-label--challenge { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.case-label--solution { background: rgba(108, 142, 255, 0.15); color: #a5b4fc; }
.case-label--effect { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.case-row p { font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; flex: 1; }

/* Section heads */
.section-head { margin-bottom: 24px; }
.section-head h2 { font-size: 1.5rem; margin-bottom: 8px; }
.section-desc { color: var(--text-muted); font-size: 0.88rem; max-width: 560px; }

/* Profile */
.profile {
  padding: 64px 0; border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.profile__grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; align-items: start; }
.profile__card { display: flex; gap: 20px; align-items: center; }
.profile__avatar {
  width: 72px; height: 72px; border-radius: 16px; flex-shrink: 0;
  border: 1px solid var(--border);
  background: #223f2d;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.profile__avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.profile__avatar--logo {
  width: 180px;
  height: 180px;
  border-radius: 20px;
  background: transparent;
  border: none;
}
.profile__avatar--logo img {
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.profile__role { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.profile__body p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; line-height: 1.75; }
.profile__body strong { color: var(--text); }
.profile__skills { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.profile__skills li {
  font-size: 0.85rem; color: var(--text-muted); padding-left: 16px; position: relative;
}
.profile__skills li::before {
  content: ''; position: absolute; left: 0; top: 0.55em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.profile__tech { display: flex; flex-wrap: wrap; gap: 6px; }
.profile__tech span {
  font-size: 0.7rem; padding: 4px 10px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--text-muted);
}

/* Pricing */
.pricing { padding: 80px 0; border-top: 1px solid var(--border); }
.pricing h2 { font-size: 1.5rem; margin-bottom: 8px; }
.pricing__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: 32px;
}
.pricing__subhead {
  margin-top: 36px;
}
.pricing__subhead h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.pricing__subhead p {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.pricing__grid--subscription {
  margin-top: 20px;
}
.price-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 24px; display: flex; flex-direction: column;
}
.price-card--featured { border-color: rgba(108, 142, 255, 0.4); box-shadow: 0 0 0 1px rgba(108, 142, 255, 0.1); }
.price-card__badge {
  position: absolute; top: -10px; right: 20px;
  background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}
.price-card__type { font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.price-card__amount {
  font-size: 2rem; font-weight: 700; margin-bottom: 20px; line-height: 1;
}
.price-card__amount span { font-size: 1rem; font-weight: 500; }
.price-card__from { font-size: 0.85rem; font-weight: 400; color: var(--text-muted); }
.price-card ul { list-style: none; flex: 1; margin-bottom: 24px; }
.price-card li {
  font-size: 0.82rem; color: var(--text-muted); padding: 8px 0;
  border-bottom: 1px solid var(--border); padding-left: 16px; position: relative;
}
.price-card li::before {
  content: '✓'; position: absolute; left: 0; color: var(--green); font-size: 0.75rem;
}
.pricing__note { margin-top: 20px; font-size: 0.75rem; color: var(--text-muted); text-align: center; }

/* Contact */
.contact__grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; margin: 28px 0; text-align: left; }
.contact__channels { display: flex; flex-direction: column; gap: 12px; }
.contact__link {
  display: block; padding: 18px 20px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px; transition: 0.2s;
}
a.contact__link:hover { border-color: var(--accent); }
.contact__link strong { display: block; font-size: 0.85rem; margin-bottom: 4px; }
.contact__link span { font-size: 0.8rem; color: var(--text-muted); }
.contact__form { display: flex; flex-direction: column; gap: 14px; }
.contact__form label { font-size: 0.8rem; color: var(--text-muted); }
.contact__form input,
.contact__form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 0.9rem;
}
.contact__form input:focus,
.contact__form textarea:focus { outline: none; border-color: var(--accent); }
.contact__honeypot {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.form-status {
  font-size: 0.82rem; padding: 10px 14px; border-radius: 8px; margin: 0;
}
.form-status--success {
  background: var(--green-soft); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--green);
}
.form-status--error {
  background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5;
}
.contact__form .btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Empty */
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty p { margin-bottom: 16px; }

/* About */
.about {
  padding: 80px 0; border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.about__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.section-label { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.about h2 { font-size: 1.5rem; margin-bottom: 16px; }
.about p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }
.about__list { list-style: none; }
.about__list li {
  padding: 16px 0; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.about__list strong { font-size: 0.95rem; }
.about__list span { font-size: 0.82rem; color: var(--text-muted); }

/* CTA */
.cta { padding: 80px 0; text-align: center; border-top: 1px solid var(--border); }
.cta h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); margin-bottom: 12px; }
.cta > .container > p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }
.cta__tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.cta__tags span {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 100px;
  font-size: 0.78rem; color: var(--text-muted);
}

/* Footer */
.footer { padding: 28px 0; text-align: center; font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border); }

@media (max-width: 768px) {
  .header__nav { display: none; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__stats { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 12px 8px; }
  .stat strong { font-size: 1.3rem; }
  .stat span { font-size: 0.65rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar__count { margin-left: 0; text-align: right; }
  .about__grid { grid-template-columns: 1fr; }
  .profile__grid { grid-template-columns: 1fr; }
  .profile__card { flex-direction: column; align-items: flex-start; }
  .profile__avatar--logo { width: 130px; height: 130px; }
  .pricing__grid { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
}

/* Mobile: portrait 2-col, landscape 3-col */
@media (max-width: 767px) and (orientation: portrait) {
  .grid,
  .works-group__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .card__body { padding: 10px 12px 12px; }
  .card h2 { font-size: 0.82rem; margin-bottom: 4px; }
  .card__category { font-size: 0.58rem; margin-bottom: 4px; }
  .card__body > p {
    font-size: 0.72rem;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card__case,
  .card__stack { display: none; }
  .card__link { font-size: 0.72rem; }
  .card__badge { font-size: 0.58rem; padding: 2px 6px; top: 6px; right: 6px; }
  .card:hover { transform: none; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .grid,
  .works-group__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .card__body { padding: 10px 12px 12px; }
  .card h2 { font-size: 0.8rem; }
  .card__body > p {
    font-size: 0.7rem;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card__case,
  .card__stack { display: none; }
}

@media (max-width: 480px) {
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .filter { width: 100%; }
  .filter__btn { flex: 1; text-align: center; padding: 8px 10px; }
}
