* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #fdfbf7;
    /* JSTOR Beige */
    color: #2c2925;
    /* Dark scholarly brown/black */
    font-family: "Georgia", "Times New Roman", serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
    position: relative;
}

.back-link {
    position: absolute;
    top: 30px;
    left: 30px;
    color: #5b4c3e;
    text-decoration: none;
    font-size: 1rem;
    font-style: italic;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #9d8161;
}

/* Scholarly Instructions Panel */
.scholarly-panel {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 320px;
    border: 1px solid #c2b6a6;
    padding: 20px;
    background-color: #f9f5ed;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.05);
}

.scholarly-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    border-bottom: 1px solid #dcd3c6;
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #5b4c3e;
}

.scholarly-panel p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
    text-align: justify;
}

/* Main Content */
.main-container {
    text-align: center;
    max-width: 900px;
    margin-top: 50px;
}

h1 {
    font-size: 3rem;
    font-weight: normal;
    letter-spacing: 5px;
    margin-bottom: 10px;
    color: #3e332a;
    text-transform: uppercase;
}

.subtitle {
    font-style: italic;
    color: #706354;
    margin-bottom: 30px;
}

.input-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

input[type="number"] {
    background: transparent;
    border: 1px solid #c2b6a6;
    border-bottom: 2px solid #5b4c3e;
    color: #2c2925;
    font-family: "Georgia", serif;
    font-size: 1.2rem;
    padding: 10px;
    width: 120px;
    text-align: center;
    outline: none;
    transition: box-shadow 0.3s ease, border-color 0.3s;
}

input[type="number"]:focus {
    box-shadow: 0 4px 10px rgba(91, 76, 62, 0.1);
    border-bottom-color: #9d8161;
}

button {
    background: transparent;
    border: 1px solid #5b4c3e;
    color: #5b4c3e;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-family: "Georgia", serif;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

button:hover {
    background: rgba(91, 76, 62, 0.05);
    box-shadow: 0 0 10px rgba(91, 76, 62, 0.2);
}

.disclaimer {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    margin-bottom: 40px;
}

/* Astrolabe Chart Container */
#chart-container {
    width: 600px;
    height: 600px;
    margin: 0 auto 50px auto;
    position: relative;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

#chart-container.visible {
    opacity: 1;
    transform: scale(1);
}

svg#astrolabe {
    width: 100%;
    height: 100%;
    /* Rotating entire chart slightly to signify processing */
    animation: slowRotate 120s linear infinite;
}

/* SVG Styling */
.base-line {
    fill: none;
    stroke: #5b4c3e;
    stroke-width: 1.5;
}

.axis {
    stroke-dasharray: 5 5;
    opacity: 0.5;
}

.fill-center {
    fill: #5b4c3e;
}

.zodiac-line {
    stroke: #8a7c6b;
    stroke-width: 1;
}

.zodiac-glyph {
    fill: #3e332a;
    font-family: Arial, sans-serif;
    /* Fallback for esoteric symbols */
    font-size: 24px;
    text-anchor: middle;
    dominant-baseline: central;
}

.planet-group {
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: 400px 400px;
    /* Center of viewBox */
}

/* Planet marker on the inner wheel */
.planet-marker {
    fill: #b33939;
    /* A classic red ink color */
    stroke: #fdfbf7;
    stroke-width: 2;
}

/* Planet Symbol */
.planet-glyph {
    fill: #2c2925;
    font-family: Arial, sans-serif;
    font-size: 28px;
    text-anchor: middle;
    dominant-baseline: central;
    /* Reverse rotation so text stays upright */
}

/* Connective lines for aspects/visuals */
.aspect-line {
    stroke: #8ba1b6;
    /* Faded blue ink */
    stroke-width: 0.5;
    opacity: 0;
    transition: opacity 2s ease 2s;
    /* reveals after planets move */
}

#chart-container.visible .aspect-line {
    opacity: 0.6;
}

@keyframes slowRotate {
    to {
        transform: rotate(360deg);
    }
}

/* Interpretations Container */
#reading-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 1s, transform 1s ease 1s;
    border-top: 1px solid #dcd3c6;
    padding-top: 30px;
}

#reading-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.reading-item {
    margin-bottom: 20px;
    padding-left: 20px;
    border-left: 3px solid #5b4c3e;
}

.reading-planet {
    font-weight: bold;
    font-size: 1.2rem;
    color: #3e332a;
    margin-bottom: 5px;
}

.reading-text {
    font-style: italic;
    color: #555;
    line-height: 1.5;
}

/* Dignity highlights */
.domicile {
    color: #218c74;
    font-weight: bold;
}

.exaltation {
    color: #227093;
    font-weight: bold;
}

.detriment {
    color: #b33939;
    font-weight: bold;
}

.fall {
    color: #84817a;
    font-weight: bold;
}