/* ==========================================================
   TPchannel — Homepage Minimal Futuristic Redesign
   Branch: design/antigravity-redesign
   ========================================================== */

/* 1. HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
html.dark .site-header {
    background: rgba(17, 28, 22, 0.7);
}
@media (prefers-color-scheme: dark) {
  html:not(.light):not([data-theme="light"]) .site-header {
    background: rgba(17, 28, 22, 0.7);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  min-height: 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--ink);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  flex-shrink: 0;
}
.brand img {
  width: 42px;
  height: 42px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}
.brand:hover {
  text-decoration: none;
}

.header-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}
.header-menu { position: relative; }
.header-menu summary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-full); background: var(--bg); color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer; list-style: none;
}
.header-menu summary::-webkit-details-marker { display: none; }
.header-menu summary:hover, .header-menu[open] summary { background: var(--green-faint); border-color: var(--green); }
.header-menu nav {
  position: absolute; top: calc(100% + 12px); right: 0;
  width: min(320px, calc(100vw - 32px)); max-height: min(480px, calc(100dvh - 100px));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 12px; border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: var(--bg); box-shadow: var(--shadow-xl); z-index: var(--z-header);
}
.header-menu:not([open]) nav { display: none; }
.header-menu .menu-caption { padding: 6px 10px 10px; font-size: 12px; color: var(--muted); }
.header-menu nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
}
.header-menu nav a:hover, .header-menu nav a:focus-visible { background: var(--green-faint); color: var(--green); }
.header-menu nav a small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.header-menu nav a > span:last-child { color: var(--green); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  transition: all var(--duration);
}
.theme-toggle:hover {
  background: var(--green-faint);
  color: var(--green);
}

/* 2. HERO */
.hero {
  padding-block: var(--sp-12) var(--sp-10);
  background: linear-gradient(145deg, #e0f2eb 0%, #ffffff 100%);
  border-radius: var(--radius-xl);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-8);
  position: relative;
  overflow: hidden;
}

html.dark .hero {
    background: linear-gradient(145deg, #162a20 0%, #111c16 100%);
}
@media (prefers-color-scheme: dark) {
  html:not(.light):not([data-theme="light"]) .hero {
    background: linear-gradient(145deg, #162a20 0%, #111c16 100%);
  }
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(61,186,138,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--sp-8);
  position: relative;
  z-index: 2;
}

.hero-intro .eyebrow {
  justify-content: center;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
}

.hero h1 span {
  color: var(--green);
  background: linear-gradient(135deg, var(--green-light), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  font-size: 18px;
  color: var(--muted);
  margin-top: var(--sp-4);
}

/* 3. WORKSPACE */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(17, 28, 22, 0.08);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

html.dark .workspace {
    background: rgba(26, 40, 32, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}
@media (prefers-color-scheme: dark) {
  html:not(.light):not([data-theme="light"]) .workspace {
    background: rgba(26, 40, 32, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  }
}

.shortener-panel {
  padding: var(--sp-8);
  min-width: 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

/* 4. URL-ROW */
.url-row {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.url-row input {
  flex: 1;
}

.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-6);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-mid) 100%);
  color: var(--on-green);
  border: none;
  box-shadow: var(--shadow-glow);
  transition: all var(--duration);
  white-space: nowrap;
}
.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 107, 79, 0.4);
  text-decoration: none;
}
.primary span {
  transition: transform var(--duration);
}
.primary:hover span {
  transform: translateX(4px);
}

.secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  border: 1px solid var(--line);
  background: transparent;
  transition: all var(--duration);
}
.secondary:hover {
  background: var(--surface);
  border-color: var(--green);
  text-decoration: none;
}

.quiet-button {
  background: none;
  border: none;
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
  padding: var(--sp-2);
  cursor: pointer;
}
.quiet-button:hover {
  text-decoration: underline;
}

details#custom-options {
  margin-top: var(--sp-5);
  border-top: 1px solid var(--line);
  padding-top: var(--sp-2);
}
summary {
  cursor: pointer;
  font-weight: 600;
  padding-block: var(--sp-3);
  color: var(--ink);
}
.custom-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.custom-row span {
  color: var(--muted);
  font-size: 14px;
}

/* 5. RESULT-CARD */
.result-card {
  margin-top: var(--sp-6);
  padding: var(--sp-6);
  border-left: 4px solid var(--green);
  background: linear-gradient(90deg, var(--green-faint) 0%, transparent 100%);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  animation: g-slideDown var(--duration) ease-out forwards;
}

.success-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: var(--sp-2);
}
.success-label::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
}

.result-card h2 {
  font-size: 20px;
  margin-bottom: var(--sp-3);
}

.share-row {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
}
#short-url {
  font-size: 24px;
  font-weight: 700;
  color: var(--green);
  word-break: break-all;
}
.destination {
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--sp-3);
  word-break: break-all;
}

.stats-result {
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--surface);
  border-radius: var(--radius-md);
}
.stats-result h3 {
  font-size: 15px;
}
.stats-result p {
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--sp-1);
}
.result-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

/* Workspace Note */
.workspace-note {
  background: rgba(244, 247, 245, 0.4);
  border-left: 1px solid var(--line);
  padding: var(--sp-8) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
html.dark .workspace-note {
    background: rgba(26, 40, 32, 0.4);
}
@media (prefers-color-scheme: dark) {
  html:not(.light):not([data-theme="light"]) .workspace-note {
    background: rgba(26, 40, 32, 0.4);
  }
}
.line-icon {
  color: var(--green);
  width: 32px; height: 32px;
}
.workspace-note h2 {
  font-size: 24px;
  line-height: 1.3;
}
.workspace-note p {
  font-size: 14px;
  color: var(--muted);
}
.note-divider {
  height: 1px;
  background: var(--line);
  width: 100%;
}
.note-detail {
  font-size: 13px;
}

/* 6. STEPS */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-8);
}
.steps article {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  animation: g-fadeInUp 0.6s ease-out both;
}
.steps article:nth-child(1) { animation-delay: 0.1s; }
.steps article:nth-child(2) { animation-delay: 0.2s; }
.steps article:nth-child(3) { animation-delay: 0.3s; }

.steps b {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-faint), var(--surface));
  color: var(--green);
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid var(--green-light);
  box-shadow: 0 4px 12px rgba(15, 107, 79, 0.1);
}
.steps h3 {
  font-size: 18px;
  margin-bottom: var(--sp-1);
}
.steps p {
  font-size: 14px;
  color: var(--muted);
}

/* 7. FAQ-SECTION */
.faq-section {
  background: var(--surface);
  padding-block: var(--sp-12);
  border-block: 1px solid var(--line);
  margin-top: var(--sp-10);
}
.faq-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--sp-10);
}
.faq-list details {
  border-bottom: 1px solid var(--line);
}
.faq-list details:first-child {
  border-top: 1px solid var(--line);
}
.faq-list summary {
  padding-block: var(--sp-4);
  font-size: 16px;
  font-weight: 600;
  transition: color var(--duration);
}
.faq-list details[open] summary {
  color: var(--green);
}
.faq-list p {
  padding-bottom: var(--sp-4);
  color: var(--muted);
  font-size: 15px;
}

/* 8. TOOL-GRID */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-6);
}
.tool-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  transition: all var(--duration) var(--ease);
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
  text-decoration: none;
}

.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.tool-card:nth-child(1) .icon-box { background: rgba(15, 107, 79, 0.1); color: var(--green); }
.tool-card:nth-child(2) .icon-box { background: rgba(91, 95, 199, 0.1); color: var(--accent-purple); }
.tool-card:nth-child(3) .icon-box { background: rgba(196, 122, 32, 0.1); color: var(--accent-amber); }

html.dark .tool-card:nth-child(1) .icon-box { background: rgba(61, 186, 138, 0.15); }
html.dark .tool-card:nth-child(2) .icon-box { background: rgba(139, 143, 232, 0.15); color: #8b8fe8;}
html.dark .tool-card:nth-child(3) .icon-box { background: rgba(224, 150, 60, 0.15); color: #e0963c;}
@media (prefers-color-scheme: dark) {
  html:not(.light):not([data-theme="light"]) .tool-card:nth-child(1) .icon-box { background: rgba(61, 186, 138, 0.15); }
  html:not(.light):not([data-theme="light"]) .tool-card:nth-child(2) .icon-box { background: rgba(139, 143, 232, 0.15); color: #8b8fe8; }
  html:not(.light):not([data-theme="light"]) .tool-card:nth-child(3) .icon-box { background: rgba(224, 150, 60, 0.15); color: #e0963c; }
}


.tool-card small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-1);
}
.tool-card h3 {
  font-size: 18px;
  color: var(--ink);
}
.tool-card p {
  font-size: 14px;
  color: var(--muted);
  margin-top: var(--sp-1);
}
.out-arrow {
  margin-left: auto;
  color: var(--green);
  font-weight: 600;
}

/* 9. LATEST-ARTICLES */
.home-article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}
.article-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  transition: transform var(--duration), box-shadow var(--duration);
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.article-cover img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.article-card-body {
  padding: var(--sp-5);
}
.article-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
}
.article-card h2 {
  font-size: 18px;
  margin-block: var(--sp-2) var(--sp-3);
}
.article-card h2 a {
  color: var(--ink);
}
.article-card-body > p {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--sp-4);
}

.article-empty, .article-loading {
  grid-column: 1 / -1;
  padding: var(--sp-8);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
}

/* 10. FOLLOW-SECTION */
.follow-section {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--sp-12);
}
.follow-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-6);
}

.radio-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}
.radio-heading {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.radio-heading .icon-box {
  background: rgba(15, 107, 79, 0.1);
  color: var(--green);
}
.radio-heading small {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: block;
}
.radio-heading h3 {
  font-size: 18px;
}
.radio-card > .muted {
  font-size: 14px;
  margin-block: var(--sp-4);
}
.radio-controls {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
#radio-status {
  font-size: 13px;
  margin-top: var(--sp-3);
}
#radio-status.is-error {
  color: var(--danger);
}

.ott-card {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  overflow: hidden;
  transition: all var(--duration);
}
.ott-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.ott-card img {
  width: 140px;
  height: auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.ott-card span {
  display: block;
  flex: 1;
}
.ott-card strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: var(--sp-1);
}
.ott-card small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

/* 11. FOOTER */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: var(--sp-8);
  border-top: 1px solid var(--line);
}
footer > div {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
footer a {
  color: var(--muted);
  font-size: 14px;
}
footer a:hover {
  color: var(--green);
}
footer small {
  color: var(--muted);
  font-size: 13px;
  margin-left: var(--sp-2);
}

/* Breakpoints */
@media (max-width: 1023px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .workspace-note {
    border-left: none;
    border-top: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
  }
  .workspace-note h2 {
    font-size: 20px;
  }
  .note-divider {
    width: 1px;
    height: 40px;
  }
  .faq-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
  .home-article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .header-inner {
    gap: 8px;
    min-height: auto;
    padding-block: var(--sp-3);
  }
  .header-inner .brand { font-size: 17px; gap: 8px; }
  .header-inner .brand img { width: 36px; height: 36px; }
  .header-menu nav { right: -52px; }
  
  .hero {
    border-radius: var(--radius-lg);
  }
  .hero h1 {
    font-size: 28px;
  }
  .lead {
    font-size: 16px;
  }
  
  .workspace-note {
    display: none; /* Hide sidebar on mobile */
  }
  .url-row {
    flex-direction: column;
  }
  .share-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .custom-row {
    flex-wrap: wrap;
  }
  .custom-row input {
    width: 100%;
  }

  .steps {
    grid-template-columns: 1fr;
  }
  
  .tool-grid {
    grid-template-columns: 1fr;
  }
  
  .home-article-grid {
    grid-template-columns: 1fr;
  }
  
  .follow-grid {
    grid-template-columns: 1fr;
  }
  .ott-card {
    flex-direction: column;
    text-align: center;
  }
  
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-4);
  }
  footer > div {
    flex-wrap: wrap;
  }
}

/* Reduced Motion */
@media (max-width: 359px) {
  .header-inner .brand { font-size: 15px; }
  .header-inner .brand img { width: 32px; height: 32px; }
  .header-menu summary { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .result-card, .steps article {
    animation: none !important;
  }
}
